Add new report
This commit is contained in:
127
ApiControllers/rep_summary_a01Controllers.cs
Normal file
127
ApiControllers/rep_summary_a01Controllers.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/rep_summary_a01")]
|
||||
public class rep_summary_a01Controller : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<rep_summary_a01Controller> _logger;
|
||||
private Irep_summary_a01Service _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public rep_summary_a01Controller(ILogger<rep_summary_a01Controller> logger, Irep_summary_a01Service repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(rep_summary_a01WithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("rep_summary_a01_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult rep_summary_a01_report(rep_summary_a01ReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_summary_a01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
BIN
EXCEL/eva_level_score@rep_summary_a01.xlsx
Normal file
BIN
EXCEL/eva_level_score@rep_summary_a01.xlsx
Normal file
Binary file not shown.
@@ -60,7 +60,6 @@ namespace TodoAPI2.Models
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_eva01WithSelectionViewModel GetBlankItem()
|
||||
@@ -69,7 +68,6 @@ namespace TodoAPI2.Models
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -82,4 +80,5 @@ namespace TodoAPI2.Models
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
Models/rep_summary_a01/Irep_summary_a01Service.cs
Normal file
22
Models/rep_summary_a01/Irep_summary_a01Service.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public interface Irep_summary_a01Service
|
||||
{
|
||||
|
||||
rep_summary_a01WithSelectionViewModel GetWithSelection(Guid id);
|
||||
rep_summary_a01WithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
28
Models/rep_summary_a01/rep_summary_a01InputModel.cs
Normal file
28
Models/rep_summary_a01/rep_summary_a01InputModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01InputModel
|
||||
{
|
||||
|
||||
public Guid? id { get; set; }
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
21
Models/rep_summary_a01/rep_summary_a01ReportRequestModel.cs
Normal file
21
Models/rep_summary_a01/rep_summary_a01ReportRequestModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01ReportRequestModel : rep_summary_a01SearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
27
Models/rep_summary_a01/rep_summary_a01SearchModel.cs
Normal file
27
Models/rep_summary_a01/rep_summary_a01SearchModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01SearchModel
|
||||
{
|
||||
|
||||
public Guid id { get; set; }
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
56
Models/rep_summary_a01/rep_summary_a01Service.cs
Normal file
56
Models/rep_summary_a01/rep_summary_a01Service.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01Service : Irep_summary_a01Service
|
||||
{
|
||||
private IBaseRepository<eva_level_scoreEntity, Guid> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
|
||||
public rep_summary_a01Service(IBaseRepository<eva_level_scoreEntity, Guid> repository, IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
public rep_summary_a01WithSelectionViewModel GetWithSelection(Guid id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<rep_summary_a01WithSelectionViewModel>(entity);
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) orderby x.fullname select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public rep_summary_a01WithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new rep_summary_a01WithSelectionViewModel();
|
||||
i.item_org_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
i.item_round_id = (from x in ext.GetEvaRound() orderby x.external_code descending select x).ToList();
|
||||
i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) orderby x.fullname select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
Models/rep_summary_a01/rep_summary_a01ViewModel.cs
Normal file
28
Models/rep_summary_a01/rep_summary_a01ViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01ViewModel : BaseViewModel2<Guid>
|
||||
{
|
||||
|
||||
public int? org_id { get; set; }
|
||||
|
||||
public int? round_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public string org_id_external_linkage_external_name { get; set; }
|
||||
public string round_id_external_linkage_external_name { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rep_summary_a01WithSelectionViewModel: rep_summary_a01ViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_org_id { get; set; }
|
||||
public List<external_linkageViewModel> item_round_id { get; set; }
|
||||
public List<external_employeeViewModel> item_employee_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -335,6 +335,8 @@ namespace Test01
|
||||
services.AddScoped<IBaseRepository2<eva_create_evaluation_detail_historyEntity, int>, BaseRepository2<eva_create_evaluation_detail_historyEntity, int>>();
|
||||
services.AddScoped<Ieva_create_evaluation_detail_historyService, eva_create_evaluation_detail_historyService>();
|
||||
|
||||
services.AddScoped<Irep_summary_a01Service, rep_summary_a01Service>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -630,6 +632,10 @@ namespace Test01
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyViewModel>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_study_historyWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<rep_summary_a01InputModel, eva_level_scoreEntity>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_summary_a01ViewModel>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_summary_a01WithSelectionViewModel>();
|
||||
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
66
ViewControllers/rep_summary_a01ViewControllers.cs
Normal file
66
ViewControllers/rep_summary_a01ViewControllers.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TodoAPI2.Models;
|
||||
using STAFF_API.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using TodoAPI2.Controllers;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
public class rep_summary_a01ViewController : Controller
|
||||
{
|
||||
private ILogger<rep_summary_a01Controller> _logger;
|
||||
private Irep_summary_a01Service _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public rep_summary_a01ViewController(ILogger<rep_summary_a01Controller> logger, Irep_summary_a01Service repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
// public IActionResult rep_summary_a01()
|
||||
// {
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
// }
|
||||
|
||||
// public IActionResult rep_summary_a01_d()
|
||||
// {
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
// }
|
||||
|
||||
public IActionResult rep_summary_a01_report()
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
return View();
|
||||
}
|
||||
|
||||
//public IActionResult rep_summary_a01_inline()
|
||||
//{
|
||||
// if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
//}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
<ul>
|
||||
<li><a href="~/rep_eva03View/rep_eva03_report"><div style="display: flex;align-items: center;"><span class="menu-dot">·</span>รายงานโครงสร้างของขั้นเงินเดือน</div></a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="~/rep_summary_a01View/rep_summary_a01_report"><div style="display: flex;align-items: center;"><span class="menu-dot">·</span>สรุปการประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</div></a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="~/rpt_payroll_summaryView/rpt_payroll_summary_report"><div style="display: flex;align-items: center;"><span class="menu-dot">·</span>รายงานเงินเดือน</div></a>
|
||||
</ul>
|
||||
|
||||
68
Views/rep_summary_a01View/rep_summary_a01_report.cshtml
Normal file
68
Views/rep_summary_a01View/rep_summary_a01_report.cshtml
Normal file
@@ -0,0 +1,68 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "rep_summary_a01";
|
||||
}
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:mainsite"]');">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:modulesite"]');">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">สรุปการประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>สรุปการประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_rep_summary_a01_org_id' for='s_rep_summary_a01_org_id'>หน่วยงาน</label>
|
||||
<select class="form-control" id="s_rep_summary_a01_org_id" iLabel="หน่วยงาน" iRequire="false" iGroup="s_rep_summary_a01" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_rep_summary_a01_round_id' for='s_rep_summary_a01_round_id'>รอบการประเมิน</label>
|
||||
<select class="form-control" id="s_rep_summary_a01_round_id" iLabel="รอบการประเมิน" iRequire="false" iGroup="s_rep_summary_a01" title='รอบการประเมิน' placeholder='รอบการประเมิน'></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_rep_summary_a01_employee_id' for='s_rep_summary_a01_employee_id'>ชื่อ-สกุล</label>
|
||||
<select class="form-control" id="s_rep_summary_a01_employee_id" iLabel="ชื่อ-สกุล" iRequire="false" iGroup="s_rep_summary_a01" title='ชื่อ-สกุล' placeholder='ชื่อ-สกุล'></select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-info" onclick="javascript:rep_summary_a01_DoSearch('pdf');">แสดงรายงาน</button>
|
||||
<button class="btn btn-info" onclick="javascript:rep_summary_a01_DoSearch('xlsx');">ดาวน์โหลดเป็น Excel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<br />
|
||||
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/rep_summary_a01/rep_summary_a01_report.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
rep_summary_a01_InitialForm();
|
||||
SetupValidationRemark("s_rep_summary_a01");
|
||||
$("#s_rep_summary_a01_org_id").select2();
|
||||
$("#s_rep_summary_a01_round_id").select2();
|
||||
$("#s_rep_summary_a01_employee_id").select2();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan.cshtml" />
|
||||
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_d.cshtml" />
|
||||
<None Include="Views\rep_eva_limit_frame_planView\rep_eva_limit_frame_plan_report.cshtml" />
|
||||
<None Include="Views\rep_summary_a01View\rep_summary_a01_report.cshtml" />
|
||||
<None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan.cshtml" />
|
||||
<None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan_d.cshtml" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
|
||||
@@ -101,6 +102,10 @@
|
||||
<None Include="wwwroot\js\rep_eva_limit_frame_plan\rep_eva_limit_frame_plan_report.js" />
|
||||
<None Include="wwwroot\js\rep_eva_self_review\rep_eva_self_review_report.js" />
|
||||
<None Include="wwwroot\js\rep_eva_self_review_all\rep_eva_self_review_all_report.js" />
|
||||
<None Include="wwwroot\js\rep_summary_a01\rep_summary_a01.js" />
|
||||
<None Include="wwwroot\js\rep_summary_a01\rep_summary_a01_d.js" />
|
||||
<None Include="wwwroot\js\rep_summary_a01\rep_summary_a01_inline.js" />
|
||||
<None Include="wwwroot\js\rep_summary_a01\rep_summary_a01_report.js" />
|
||||
<None Include="wwwroot\js\vw_limit_frame_plan\vw_limit_frame_plan.js" />
|
||||
<None Include="wwwroot\js\vw_limit_frame_plan\vw_limit_frame_plan_d.js" />
|
||||
<Content Update="nlog.config">
|
||||
|
||||
36
tb320eva.xml
36
tb320eva.xml
@@ -5047,6 +5047,34 @@
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_summary_a01Controller.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rep_summary_a01Controller},TodoAPI2.Models.Irep_summary_a01Service,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_summary_a01Controller.GetBlankItem">
|
||||
<summary>
|
||||
Get Blank Item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return a blank item</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_summary_a01Controller.rep_summary_a01_report(TodoAPI2.Models.rep_summary_a01ReportRequestModel)">
|
||||
<summary>
|
||||
Download Report
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_working_typeController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rep_working_typeController},TodoAPI2.Models.Irep_working_typeService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
@@ -5688,6 +5716,14 @@
|
||||
<param name="logger"></param>
|
||||
<param name="inemp"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_summary_a01ViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rep_summary_a01Controller},TodoAPI2.Models.Irep_summary_a01Service,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rep_working_typeViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rep_working_typeController},TodoAPI2.Models.Iexternal_employeeService,TodoAPI2.Models.Irep_working_typeService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
228
wwwroot/js/rep_summary_a01/rep_summary_a01.js
Normal file
228
wwwroot/js/rep_summary_a01/rep_summary_a01.js
Normal file
@@ -0,0 +1,228 @@
|
||||
var rep_summary_a01_editMode = "CREATE";
|
||||
var rep_summary_a01_API = "/api/rep_summary_a01/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function rep_summary_a01_GetSearchParameter() {
|
||||
var rep_summary_a01SearchObject = new Object();
|
||||
rep_summary_a01SearchObject.org_id = $("#s_rep_summary_a01_org_id").val();
|
||||
rep_summary_a01SearchObject.round_id = $("#s_rep_summary_a01_round_id").val();
|
||||
rep_summary_a01SearchObject.employee_id = $("#s_rep_summary_a01_employee_id").val();
|
||||
|
||||
return rep_summary_a01SearchObject;
|
||||
}
|
||||
|
||||
function rep_summary_a01_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function rep_summary_a01_FeedDataToForm(data) {
|
||||
$("#rep_summary_a01_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
function rep_summary_a01_GetFromForm() {
|
||||
var rep_summary_a01Object = new Object();
|
||||
rep_summary_a01Object.id = $("#rep_summary_a01_id").val();
|
||||
rep_summary_a01Object.org_id = $("#rep_summary_a01_org_id").val();
|
||||
rep_summary_a01Object.round_id = $("#rep_summary_a01_round_id").val();
|
||||
rep_summary_a01Object.employee_id = $("#rep_summary_a01_employee_id").val();
|
||||
|
||||
|
||||
return rep_summary_a01Object;
|
||||
}
|
||||
|
||||
function rep_summary_a01_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_FeedDataToForm(result);
|
||||
rep_summary_a01_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#rep_summary_a01Model").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rep_summary_a01_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function rep_summary_a01_GoCreate() {
|
||||
// Incase model popup
|
||||
rep_summary_a01_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/rep_summary_a01View/rep_summary_a01_d");
|
||||
}
|
||||
|
||||
function rep_summary_a01_GoEdit(a) {
|
||||
// Incase model popup
|
||||
rep_summary_a01_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/rep_summary_a01View/rep_summary_a01_d?id=" + a);
|
||||
}
|
||||
|
||||
function rep_summary_a01_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_editMode = "UPDATE";
|
||||
rep_summary_a01_FeedDataToForm(result);
|
||||
$("#rep_summary_a01Model").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rep_summary_a01_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_SetCreateForm(s) {
|
||||
rep_summary_a01_editMode = "CREATE";
|
||||
rep_summary_a01_InitialForm(s);
|
||||
}
|
||||
|
||||
function rep_summary_a01_RefreshTable() {
|
||||
// Incase model popup
|
||||
rep_summary_a01_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.rep_summary_a01_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var rep_summary_a01_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function rep_summary_a01_PutUpdate() {
|
||||
if (!ValidateForm('rep_summary_a01', rep_summary_a01_customValidation))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var data = rep_summary_a01_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (rep_summary_a01_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#rep_summary_a01Model").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
rep_summary_a01_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + rep_summary_a01_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#rep_summary_a01Model").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
rep_summary_a01_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + rep_summary_a01_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function rep_summary_a01_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#rep_summary_a01Model").modal("hide");
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
rep_summary_a01_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + rep_summary_a01_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var rep_summary_a01TableV;
|
||||
|
||||
var rep_summary_a01_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
rep_summary_a01TableV = $('#rep_summary_a01Table').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "id" },
|
||||
{ "data": "org_id_external_linkage_external_name" },
|
||||
{ "data": "round_id_external_linkage_external_name" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:rep_summary_a01_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:rep_summary_a01_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function rep_summary_a01_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(rep_summary_a01_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/rep_summary_a01/GetListBySearch?"+p, rep_summary_a01_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_DoSearch() {
|
||||
var p = $.param(rep_summary_a01_GetSearchParameter());
|
||||
var rep_summary_a01_reload = function (result) {
|
||||
rep_summary_a01TableV.destroy();
|
||||
rep_summary_a01_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/rep_summary_a01/GetListBySearch?"+p, rep_summary_a01_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_GetSelect(f) {
|
||||
var rep_summary_a01_selectitem = [];
|
||||
$.each(rep_summary_a01TableV.rows('.selected').data(), function (key, value) {
|
||||
rep_summary_a01_selectitem.push(value[f]);
|
||||
});
|
||||
alert(rep_summary_a01_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
102
wwwroot/js/rep_summary_a01/rep_summary_a01_d.js
Normal file
102
wwwroot/js/rep_summary_a01/rep_summary_a01_d.js
Normal file
@@ -0,0 +1,102 @@
|
||||
var rep_summary_a01_editMode = "CREATE";
|
||||
var rep_summary_a01_API = "/api/rep_summary_a01/";
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function rep_summary_a01_FeedDataToForm(data) {
|
||||
$("#rep_summary_a01_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_employee_id"), data, "id", "external_name", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
function rep_summary_a01_GetFromForm() {
|
||||
var rep_summary_a01Object = new Object();
|
||||
rep_summary_a01Object.id = $("#rep_summary_a01_id").val();
|
||||
rep_summary_a01Object.org_id = $("#rep_summary_a01_org_id").val();
|
||||
rep_summary_a01Object.round_id = $("#rep_summary_a01_round_id").val();
|
||||
rep_summary_a01Object.employee_id = $("#rep_summary_a01_employee_id").val();
|
||||
|
||||
|
||||
return rep_summary_a01Object;
|
||||
}
|
||||
|
||||
function rep_summary_a01_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rep_summary_a01_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function rep_summary_a01_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_editMode = "UPDATE";
|
||||
rep_summary_a01_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rep_summary_a01_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_SetCreateForm() {
|
||||
rep_summary_a01_editMode = "CREATE";
|
||||
rep_summary_a01_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var rep_summary_a01_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function rep_summary_a01_PutUpdate() {
|
||||
if (!ValidateForm('rep_summary_a01', rep_summary_a01_customValidation))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var data = rep_summary_a01_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (rep_summary_a01_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + rep_summary_a01_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + rep_summary_a01_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function rep_summary_a01_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
rep_summary_a01_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + rep_summary_a01_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
140
wwwroot/js/rep_summary_a01/rep_summary_a01_inline.js
Normal file
140
wwwroot/js/rep_summary_a01/rep_summary_a01_inline.js
Normal file
@@ -0,0 +1,140 @@
|
||||
function rep_summary_a01_ClearForm(i, blankItem) {
|
||||
var data = blankItem;
|
||||
$("#rep_summary_a01_id_" + i).val("");
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_round_id_" + i), blankItem, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_employee_id_" + i), blankItem, "id", "external_name", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
function rep_summary_a01_FeedDataToForm(data, i, blankItem) {
|
||||
$("#rep_summary_a01_id_" + i).val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_round_id_" + i), blankItem, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#rep_summary_a01_employee_id_" + i), blankItem, "id", "external_name", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
function rep_summary_a01_GetFromForm(obj, i) {
|
||||
var rep_summary_a01Object = new Object();
|
||||
rep_summary_a01Object.id = obj.find("#rep_summary_a01_id_" + i).val();
|
||||
rep_summary_a01Object.org_id = obj.find("#rep_summary_a01_org_id_" + i).val();
|
||||
rep_summary_a01Object.round_id = obj.find("#rep_summary_a01_round_id_" + i).val();
|
||||
rep_summary_a01Object.employee_id = obj.find("#rep_summary_a01_employee_id_" + i).val();
|
||||
|
||||
rep_summary_a01Object.active_mode = obj.find("#isActive_" + i + "_rep_summary_a01").val();
|
||||
return rep_summary_a01Object;
|
||||
}
|
||||
|
||||
function rep_summary_a01_GetAllData() {
|
||||
//Insert rep_summary_a01 List
|
||||
var rep_summary_a01 = [];
|
||||
$('#rep_summary_a01Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var eachrep_summary_a01 = rep_summary_a01_GetFromForm($(this), i);
|
||||
rep_summary_a01.push(eachrep_summary_a01);
|
||||
});
|
||||
return rep_summary_a01;
|
||||
}
|
||||
|
||||
function rep_summary_a01_Save(id) {
|
||||
//Insert rep_summary_a01 List
|
||||
var rep_summary_a01 = rep_summary_a01_GetAllData();
|
||||
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + '/api/rep_summary_a01/UpdateMultiple', rep_summary_a01, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_Get(id, blankItem) {
|
||||
|
||||
$('#rep_summary_a01Body').empty();
|
||||
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_rep_summary_a01" value="1" /><input class="form-control" type="hidden" id="rep_summary_a01_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_org_id_' + (i + 1) +'"></select></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_round_id_' + (i + 1) +'"></select></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_employee_id_' + (i + 1) +'"></select></td>';
|
||||
|
||||
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_summary_a01_Removerep_summary_a01(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:rep_summary_a01_Restorerep_summary_a01(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
|
||||
tag += '</tr>';
|
||||
$('#rep_summary_a01Body').append($(tag));
|
||||
rep_summary_a01_FeedDataToForm(data, (i + 1), blankItem);
|
||||
});
|
||||
rep_summary_a01_Summary();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/rep_summary_a01", successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/rep_summary_a01/GetListByorg_id/' + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/rep_summary_a01/GetListByround_id/' + a, successFunc, AlertDanger);
|
||||
//AjaxGetRequest(apisite + '/api/rep_summary_a01/GetListByemployee_id/' + a, successFunc, AlertDanger);
|
||||
|
||||
}
|
||||
|
||||
function rep_summary_a01_Add() {
|
||||
var successFunc = function (result) {
|
||||
var i = $("#rep_summary_a01Body tr").length;
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_rep_summary_a01" value="1" /><input class="form-control" type="hidden" id="rep_summary_a01_id_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_org_id_' + (i + 1) +'"></select></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_round_id_' + (i + 1) +'"></select></td>';
|
||||
tag += '<td><select class="form-control" id="rep_summary_a01_employee_id_' + (i + 1) +'"></select></td>';
|
||||
|
||||
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_summary_a01_Removerep_summary_a01(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:rep_summary_a01_Restorerep_summary_a01(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
|
||||
tag += '</tr>';
|
||||
|
||||
$('#rep_summary_a01Body').append($(tag));
|
||||
rep_summary_a01_ClearForm(i + 1, result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/rep_summary_a01/" + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function rep_summary_a01_Removerep_summary_a01(e) {
|
||||
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
|
||||
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
|
||||
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
|
||||
$(e).hide();
|
||||
$(e).closest('tr').find("#restoreBtn").show();
|
||||
$(e).closest('tr').find("input").first().val("0");
|
||||
console.log($(e).closest('tr').find("input").first().val());
|
||||
rep_summary_a01_Summary();
|
||||
}
|
||||
}
|
||||
|
||||
function rep_summary_a01_Restorerep_summary_a01(e) {
|
||||
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
|
||||
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
|
||||
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
|
||||
$(e).hide();
|
||||
$(e).closest('tr').find("#removeBtn").show();
|
||||
$(e).closest('tr').find("input").first().val("1");
|
||||
console.log($(e).closest('tr').find("input").first().val());
|
||||
rep_summary_a01_Summary();
|
||||
}
|
||||
}
|
||||
|
||||
function rep_summary_a01_Summary() {
|
||||
var sum = 0;
|
||||
$(".input_score").each(function () {
|
||||
sum += +$(this).val();
|
||||
});
|
||||
$("#score_label").text("ผลรวม: " + sum);
|
||||
}
|
||||
|
||||
function rep_summary_a01_InitialForm(id) {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_Get(id, result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/rep_summary_a01/" + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
62
wwwroot/js/rep_summary_a01/rep_summary_a01_report.js
Normal file
62
wwwroot/js/rep_summary_a01/rep_summary_a01_report.js
Normal file
@@ -0,0 +1,62 @@
|
||||
var rep_summary_a01_API = "/api/rep_summary_a01/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function rep_summary_a01_GetSearchParameter(fileType) {
|
||||
var rep_summary_a01SearchObject = new Object();
|
||||
rep_summary_a01SearchObject.org_id = $("#s_rep_summary_a01_org_id").val();
|
||||
rep_summary_a01SearchObject.round_id = $("#s_rep_summary_a01_round_id").val();
|
||||
rep_summary_a01SearchObject.employee_id = $("#s_rep_summary_a01_employee_id").val();
|
||||
|
||||
|
||||
rep_summary_a01SearchObject.fileType = fileType;
|
||||
|
||||
console.log(rep_summary_a01SearchObject);
|
||||
|
||||
return rep_summary_a01SearchObject;
|
||||
}
|
||||
|
||||
function rep_summary_a01_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
|
||||
DropDownClearFormAndFeedWithData($("#s_rep_summary_a01_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function rep_summary_a01_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
rep_summary_a01_FeedDataToSearchForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rep_summary_a01_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var s_rep_summary_a01_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
|
||||
function rep_summary_a01_DoSearch(fileType) {
|
||||
if (!ValidateForm('s_rep_summary_a01', s_rep_summary_a01_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var p = $.param(rep_summary_a01_GetSearchParameter(fileType));
|
||||
|
||||
var report_url = apisite + "/api/rep_summary_a01/rep_summary_a01_report?" + p;
|
||||
|
||||
if (fileType === "pdf") {
|
||||
$("#report_result").attr("src", report_url);
|
||||
$("#report_result").show();
|
||||
//window.open(report_url);
|
||||
} else {
|
||||
$("#report_result").hide();
|
||||
window.open(report_url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user