ทำหน้าจอพิเศษ นำเข้าข้อมูลเงินเดือนย้อนหลัง
This commit is contained in:
@@ -0,0 +1,403 @@
|
||||
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/eva_adjust_postponement_detail_migration")]
|
||||
public class eva_adjust_postponement_detail_migrationController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_postponement_detail_migrationController> _logger;
|
||||
private Ieva_adjust_postponement_detail_migrationService _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 eva_adjust_postponement_detail_migrationController(ILogger<eva_adjust_postponement_detail_migrationController> logger, Ieva_adjust_postponement_detail_migrationService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_adjust_postponement_detail_migrationWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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(eva_adjust_postponement_detail_migrationWithSelectionViewModel), 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>
|
||||
/// Get list items by adjust_postponement_id
|
||||
/// </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("")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_detail_migrationViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(int? adjust_postponement_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByadjust_postponement_id(adjust_postponement_id));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </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("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_detail_migrationViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_postponement_detail_migrationSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", 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("eva_adjust_postponement_detail_migration_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_adjust_postponement_detail_migration_report(eva_adjust_postponement_detail_migrationReportRequestModel 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}/xxใส่ชื่อรายงานตรงนี้xx.{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}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_adjust_postponement_detail_migrationInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(int id, [FromBody] eva_adjust_postponement_detail_migrationInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(int id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_adjust_postponement_detail_migrationInputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
403
ApiControllers/eva_adjust_postponement_migrationControllers.cs
Normal file
403
ApiControllers/eva_adjust_postponement_migrationControllers.cs
Normal file
@@ -0,0 +1,403 @@
|
||||
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/eva_adjust_postponement_migration")]
|
||||
public class eva_adjust_postponement_migrationController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_postponement_migrationController> _logger;
|
||||
private Ieva_adjust_postponement_migrationService _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 eva_adjust_postponement_migrationController(ILogger<eva_adjust_postponement_migrationController> logger, Ieva_adjust_postponement_migrationService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_adjust_postponement_migrationWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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(eva_adjust_postponement_migrationWithSelectionViewModel), 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>
|
||||
/// Get list items by fiscal_year
|
||||
/// </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("")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_migrationViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(int? fiscal_year)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByfiscal_year(fiscal_year));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </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("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_migrationViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_postponement_migrationSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", 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("eva_adjust_postponement_migration_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_adjust_postponement_migration_report(eva_adjust_postponement_migrationReportRequestModel 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}/xxใส่ชื่อรายงานตรงนี้xx.{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}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_adjust_postponement_migrationInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(int id, [FromBody] eva_adjust_postponement_migrationInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(int id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_adjust_postponement_migrationInputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
699
Migrations/25631206135022_AddSalaryMigrationField.Designer.cs
generated
Normal file
699
Migrations/25631206135022_AddSalaryMigrationField.Designer.cs
generated
Normal file
@@ -0,0 +1,699 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using TTSW.EF;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("25631206135022_AddSalaryMigrationField")]
|
||||
partial class AddSalaryMigrationField
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("command_no")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<string>("imported_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit");
|
||||
|
||||
b.Property<decimal?>("limit_frame");
|
||||
|
||||
b.Property<decimal?>("limit_frame_quota");
|
||||
|
||||
b.Property<decimal?>("limit_quota");
|
||||
|
||||
b.Property<int?>("managed_by");
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<DateTime?>("theDate");
|
||||
|
||||
b.Property<int?>("theRound");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("adjust_postponement_id");
|
||||
|
||||
b.Property<int?>("adjust_postponement_quota_id");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<decimal?>("new_cost_living");
|
||||
|
||||
b.Property<decimal?>("new_sarary");
|
||||
|
||||
b.Property<decimal?>("new_sarary_with_quota");
|
||||
|
||||
b.Property<string>("position_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<decimal?>("receive_quota");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("sarary");
|
||||
|
||||
b.Property<decimal?>("total_promote");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("adjust_postponement_id");
|
||||
|
||||
b.HasIndex("adjust_postponement_quota_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<decimal?>("score1");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<int?>("supervisor1_id");
|
||||
|
||||
b.Property<int?>("supervisor2_id");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_create_evaluation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("Final_summary_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("achievement_chief");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor2A");
|
||||
|
||||
b.Property<int?>("chief");
|
||||
|
||||
b.Property<decimal?>("competency_chief");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor2A");
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_score_chief")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor1A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor2A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<decimal?>("score_chief");
|
||||
|
||||
b.Property<decimal?>("score_supervisor");
|
||||
|
||||
b.Property<decimal?>("score_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("score_supervisor2A");
|
||||
|
||||
b.Property<string>("status_chief")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_chief_click_date");
|
||||
|
||||
b.Property<string>("status_self")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_self_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_supervisor1A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor1A_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor2A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor2A_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_supervisor_click_date");
|
||||
|
||||
b.Property<int?>("supervisor1");
|
||||
|
||||
b.Property<int?>("supervisor1A");
|
||||
|
||||
b.Property<DateTime?>("supervisor1A_date");
|
||||
|
||||
b.Property<string>("supervisor1A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor1_date");
|
||||
|
||||
b.Property<string>("supervisor1_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor2");
|
||||
|
||||
b.Property<int?>("supervisor2A");
|
||||
|
||||
b.Property<DateTime?>("supervisor2A_date");
|
||||
|
||||
b.Property<string>("supervisor2A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor2_date");
|
||||
|
||||
b.Property<string>("supervisor2_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<decimal?>("total_summary_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor2A");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_create_evaluation_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("achievement")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("thefile")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("behavior")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_behavior");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("thegroup")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_evaluation_group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.ToTable("eva_evaluation_group_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("develop")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("development_method")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("period_text")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_idp_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_level_score");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("theTime");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_performance_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("list_no");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<string>("step")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_performance_plan_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("level_score_id");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("level_score_id");
|
||||
|
||||
b.ToTable("eva_promoted_percentage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<int?>("position_level");
|
||||
|
||||
b.Property<int?>("position_type");
|
||||
|
||||
b.Property<decimal?>("temporary_min");
|
||||
|
||||
b.Property<decimal?>("themax");
|
||||
|
||||
b.Property<decimal?>("themin");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_salary_cylinder");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_quota_id")
|
||||
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
|
||||
.WithMany()
|
||||
.HasForeignKey("level_score_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Migrations/25631206135022_AddSalaryMigrationField.cs
Normal file
43
Migrations/25631206135022_AddSalaryMigrationField.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddSalaryMigrationField : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "level_this_time",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "position_this_time",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "imported_file",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "level_this_time",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "position_this_time",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "imported_file",
|
||||
table: "eva_adjust_postponement");
|
||||
}
|
||||
}
|
||||
}
|
||||
701
Migrations/25631207070013_AddMigratedDate.Designer.cs
generated
Normal file
701
Migrations/25631207070013_AddMigratedDate.Designer.cs
generated
Normal file
@@ -0,0 +1,701 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using TTSW.EF;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("25631207070013_AddMigratedDate")]
|
||||
partial class AddMigratedDate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("command_no")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<DateTime?>("imported_date");
|
||||
|
||||
b.Property<string>("imported_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit");
|
||||
|
||||
b.Property<decimal?>("limit_frame");
|
||||
|
||||
b.Property<decimal?>("limit_frame_quota");
|
||||
|
||||
b.Property<decimal?>("limit_quota");
|
||||
|
||||
b.Property<int?>("managed_by");
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<DateTime?>("theDate");
|
||||
|
||||
b.Property<int?>("theRound");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("adjust_postponement_id");
|
||||
|
||||
b.Property<int?>("adjust_postponement_quota_id");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<decimal?>("new_cost_living");
|
||||
|
||||
b.Property<decimal?>("new_sarary");
|
||||
|
||||
b.Property<decimal?>("new_sarary_with_quota");
|
||||
|
||||
b.Property<string>("position_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<decimal?>("receive_quota");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("sarary");
|
||||
|
||||
b.Property<decimal?>("total_promote");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("adjust_postponement_id");
|
||||
|
||||
b.HasIndex("adjust_postponement_quota_id");
|
||||
|
||||
b.ToTable("eva_adjust_postponement_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<decimal?>("score1");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<int?>("supervisor1_id");
|
||||
|
||||
b.Property<int?>("supervisor2_id");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_create_evaluation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("Final_summary_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("achievement_chief");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor2A");
|
||||
|
||||
b.Property<int?>("chief");
|
||||
|
||||
b.Property<decimal?>("competency_chief");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor2A");
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_score_chief")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor1A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor2A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<decimal?>("score_chief");
|
||||
|
||||
b.Property<decimal?>("score_supervisor");
|
||||
|
||||
b.Property<decimal?>("score_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("score_supervisor2A");
|
||||
|
||||
b.Property<string>("status_chief")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_chief_click_date");
|
||||
|
||||
b.Property<string>("status_self")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_self_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<string>("status_supervisor1A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor1A_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor2A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor2A_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_supervisor_click_date");
|
||||
|
||||
b.Property<int?>("supervisor1");
|
||||
|
||||
b.Property<int?>("supervisor1A");
|
||||
|
||||
b.Property<DateTime?>("supervisor1A_date");
|
||||
|
||||
b.Property<string>("supervisor1A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor1_date");
|
||||
|
||||
b.Property<string>("supervisor1_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor1_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor2");
|
||||
|
||||
b.Property<int?>("supervisor2A");
|
||||
|
||||
b.Property<DateTime?>("supervisor2A_date");
|
||||
|
||||
b.Property<string>("supervisor2A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("supervisor2_date");
|
||||
|
||||
b.Property<string>("supervisor2_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor2_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<decimal?>("total_summary_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor2A");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_create_evaluation_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("achievement")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("thefile")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("behavior")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("score");
|
||||
|
||||
b.Property<decimal?>("score2");
|
||||
|
||||
b.Property<decimal?>("score3");
|
||||
|
||||
b.Property<decimal?>("score4");
|
||||
|
||||
b.Property<decimal?>("sumary");
|
||||
|
||||
b.Property<decimal?>("sumary2");
|
||||
|
||||
b.Property<decimal?>("sumary3");
|
||||
|
||||
b.Property<decimal?>("sumary4");
|
||||
|
||||
b.Property<string>("target_score1")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score2")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score3")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score4")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("target_score5")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("weight");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("create_evaluation_detail_id");
|
||||
|
||||
b.ToTable("eva_evaluation_behavior");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("thegroup")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_evaluation_group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<Guid?>("evaluation_group_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("evaluation_group_id");
|
||||
|
||||
b.ToTable("eva_evaluation_group_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("develop")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("development_method")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("period_text")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_idp_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_level_score");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("theTime");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_performance_plan");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("end_date");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<int?>("list_no");
|
||||
|
||||
b.Property<Guid?>("performance_plan_id");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("start_date");
|
||||
|
||||
b.Property<string>("step")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("performance_plan_id");
|
||||
|
||||
b.ToTable("eva_performance_plan_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("code")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<string>("detail")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("level_score_id");
|
||||
|
||||
b.Property<decimal?>("max_score");
|
||||
|
||||
b.Property<decimal?>("min_score");
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("level_score_id");
|
||||
|
||||
b.ToTable("eva_promoted_percentage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<decimal?>("cost_living");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<int?>("position_level");
|
||||
|
||||
b.Property<int?>("position_type");
|
||||
|
||||
b.Property<decimal?>("temporary_min");
|
||||
|
||||
b.Property<decimal?>("themax");
|
||||
|
||||
b.Property<decimal?>("themin");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_salary_cylinder");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
|
||||
.WithMany()
|
||||
.HasForeignKey("adjust_postponement_quota_id")
|
||||
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
.WithMany()
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
|
||||
.WithMany()
|
||||
.HasForeignKey("evaluation_group_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("performance_plan_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
|
||||
.WithMany()
|
||||
.HasForeignKey("level_score_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Migrations/25631207070013_AddMigratedDate.cs
Normal file
23
Migrations/25631207070013_AddMigratedDate.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddMigratedDate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "imported_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "imported_date",
|
||||
table: "eva_adjust_postponement");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,11 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<DateTime?>("imported_date");
|
||||
|
||||
b.Property<string>("imported_file")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("limit");
|
||||
@@ -75,6 +80,9 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("level_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("middle");
|
||||
|
||||
b.Property<decimal?>("new_cost_living");
|
||||
@@ -83,6 +91,9 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("new_sarary_with_quota");
|
||||
|
||||
b.Property<string>("position_this_time")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("promoted_percentage");
|
||||
|
||||
b.Property<decimal?>("receive_quota");
|
||||
|
||||
@@ -41,6 +41,19 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? managed_by { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string imported_file { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string imported_fileDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string.IsNullOrEmpty(imported_file) ? "" :
|
||||
FileUtil.GetFileInfo(TTSW.Constant.FilePathConstant.DirType.FilesTestUpload, id, imported_file).RelativePath).Replace(@"\", "/");
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime? imported_date { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,19 +20,19 @@ namespace TodoAPI2.Models
|
||||
public class eva_adjust_postponementService : Ieva_adjust_postponementService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private Ieva_adjust_postponement_detail_normalService detail;
|
||||
|
||||
public eva_adjust_postponementService(IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
public eva_adjust_postponementService(IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb, Iexternal_linkageService inext,
|
||||
Iexternal_employeeService inemp,
|
||||
Ieva_adjust_postponement_detail_normalService indetail)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
detail = indetail;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementViewModel>>(entities);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
@@ -89,12 +89,12 @@ namespace TodoAPI2.Models
|
||||
|
||||
public List<eva_adjust_postponementViewModel> GetListByfiscal_year(int? fiscal_year)
|
||||
{
|
||||
var model = new eva_adjust_postponementSearchModel();
|
||||
var model = new eva_adjust_postponementSearchModel();
|
||||
model.fiscal_year = fiscal_year;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponementViewModel> GetListBySearch(eva_adjust_postponementSearchModel model)
|
||||
public List<eva_adjust_postponementViewModel> GetListBySearch(eva_adjust_postponementSearchModel model)
|
||||
{
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace TodoAPI2.Models
|
||||
from fk_external_linkageResult11 in external_linkageResult11.DefaultIfEmpty()
|
||||
|
||||
|
||||
where 1==1
|
||||
where 1 == 1
|
||||
//&& (m_eva_adjust_postponement.id == model.id || !model.id.HasValue)
|
||||
&& (m_eva_adjust_postponement.fiscal_year == model.fiscal_year || !model.fiscal_year.HasValue)
|
||||
&& (m_eva_adjust_postponement.theRound == model.theRound || !model.theRound.HasValue)
|
||||
@@ -153,10 +153,10 @@ namespace TodoAPI2.Models
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
if (x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ namespace TodoAPI2.Models
|
||||
var inserted = _repository.Insert(entity);
|
||||
|
||||
detail.ReCreatePostponementDetailNormal(entity);
|
||||
|
||||
|
||||
return Get(inserted.id);
|
||||
}
|
||||
|
||||
@@ -198,29 +198,29 @@ namespace TodoAPI2.Models
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
public string UpdateMultiple(List<eva_adjust_postponementInputModel> model)
|
||||
public string UpdateMultiple(List<eva_adjust_postponementInputModel> model)
|
||||
{
|
||||
foreach(var i in model)
|
||||
foreach (var i in model)
|
||||
{
|
||||
if (i.active_mode == "1" && i.id.HasValue) // update
|
||||
{
|
||||
{
|
||||
var existingEntity = _repository.Get(i.id.Value);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.fiscal_year = i.fiscal_year;
|
||||
existingEntity.theDate = i.theDate;
|
||||
existingEntity.theRound = i.theRound;
|
||||
existingEntity.create_evaluation_id = i.create_evaluation_id;
|
||||
existingEntity.limit = i.limit;
|
||||
existingEntity.limit_frame = i.limit_frame;
|
||||
existingEntity.limit_quota = i.limit_quota;
|
||||
existingEntity.limit_frame_quota = i.limit_frame_quota;
|
||||
existingEntity.percentage = i.percentage;
|
||||
existingEntity.command_no = i.command_no;
|
||||
existingEntity.managed_by = i.managed_by;
|
||||
existingEntity.fiscal_year = i.fiscal_year;
|
||||
existingEntity.theDate = i.theDate;
|
||||
existingEntity.theRound = i.theRound;
|
||||
existingEntity.create_evaluation_id = i.create_evaluation_id;
|
||||
existingEntity.limit = i.limit;
|
||||
existingEntity.limit_frame = i.limit_frame;
|
||||
existingEntity.limit_quota = i.limit_quota;
|
||||
existingEntity.limit_frame_quota = i.limit_frame_quota;
|
||||
existingEntity.percentage = i.percentage;
|
||||
existingEntity.command_no = i.command_no;
|
||||
existingEntity.managed_by = i.managed_by;
|
||||
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
@@ -233,15 +233,15 @@ namespace TodoAPI2.Models
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
}
|
||||
else if (i.active_mode == "0" && i.id.HasValue) // remove
|
||||
{
|
||||
{
|
||||
_repository.DeleteWithoutCommit(i.id.Value);
|
||||
}
|
||||
else if (i.active_mode == "0" && !i.id.HasValue)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
_repository.Context.SaveChanges();
|
||||
|
||||
return model.Count().ToString();
|
||||
}
|
||||
@@ -259,8 +259,7 @@ namespace TodoAPI2.Models
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
_repository.Delete(id);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace TodoAPI2.Models
|
||||
eva_adjust_postponement_detailWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_detailWithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
int GetNewPrimaryKey();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public decimal? new_sarary_with_quota { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string position_this_time { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string level_this_time { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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 Ieva_adjust_postponement_detail_migrationService : IBaseService<int, eva_adjust_postponement_detail_migrationInputModel, eva_adjust_postponement_detail_migrationViewModel>
|
||||
{
|
||||
new eva_adjust_postponement_detail_migrationViewModel Insert(eva_adjust_postponement_detail_migrationInputModel model);
|
||||
new eva_adjust_postponement_detail_migrationViewModel Update(int id, eva_adjust_postponement_detail_migrationInputModel model);
|
||||
List<eva_adjust_postponement_detail_migrationViewModel> GetListByadjust_postponement_id(int? adjust_postponement_id);
|
||||
List<eva_adjust_postponement_detail_migrationViewModel> GetListBySearch(eva_adjust_postponement_detail_migrationSearchModel model);
|
||||
|
||||
string UpdateMultiple(List<eva_adjust_postponement_detail_migrationInputModel> model);
|
||||
eva_adjust_postponement_detail_migrationWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_detail_migrationWithSelectionViewModel GetBlankItem();
|
||||
|
||||
void RefreshAutoFieldOfAllData();
|
||||
eva_adjust_postponement_detailEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
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 eva_adjust_postponement_detail_migrationInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public int? adjust_postponement_id { get; set; }
|
||||
|
||||
public int? adjust_postponement_quota_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public decimal? sarary { get; set; }
|
||||
|
||||
public decimal? cost_living { get; set; }
|
||||
|
||||
public decimal? middle { get; set; }
|
||||
|
||||
public decimal? promoted_percentage { get; set; }
|
||||
|
||||
public decimal? total_promote { get; set; }
|
||||
|
||||
public decimal? new_sarary { get; set; }
|
||||
|
||||
public decimal? new_cost_living { get; set; }
|
||||
|
||||
public string remark { get; set; }
|
||||
|
||||
public decimal? receive_quota { get; set; }
|
||||
|
||||
public decimal? new_sarary_with_quota { get; set; }
|
||||
|
||||
public string position_this_time { get; set; }
|
||||
|
||||
public string level_this_time { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 eva_adjust_postponement_detail_migrationReportRequestModel : eva_adjust_postponement_detail_migrationSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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 eva_adjust_postponement_detail_migrationSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public int? adjust_postponement_id { get; set; }
|
||||
|
||||
public int? adjust_postponement_quota_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
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 eva_adjust_postponement_detail_migrationService : Ieva_adjust_postponement_detail_migrationService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponement_detailEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
|
||||
public eva_adjust_postponement_detail_migrationService(IBaseRepository2<eva_adjust_postponement_detailEntity, int> repository,
|
||||
IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponement_detailEntity GetEntity(eva_adjust_postponement_detail_migrationInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponement_detailEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponement_detailEntity> GetEntityList(List<eva_adjust_postponement_detail_migrationInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_detailEntity>>(models);
|
||||
}
|
||||
private eva_adjust_postponement_detail_migrationViewModel GetDto(eva_adjust_postponement_detailEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponement_detail_migrationViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_postponement_detail_migrationViewModel> GetDtoList(List<eva_adjust_postponement_detailEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_detail_migrationViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_postponement_detail_migrationViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_detailEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_detail_migrationWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_postponement_detail_migrationWithSelectionViewModel>(entity);
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_employee_id = all_emp.ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_detail_migrationWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_postponement_detail_migrationWithSelectionViewModel();
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_employee_id = all_emp.ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_migrationViewModel> GetListByadjust_postponement_id(int? adjust_postponement_id)
|
||||
{
|
||||
var model = new eva_adjust_postponement_detail_migrationSearchModel();
|
||||
model.adjust_postponement_id = adjust_postponement_id;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_migrationViewModel> GetListBySearch(eva_adjust_postponement_detail_migrationSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_postponement_detail_migration in _repository.Context.eva_adjust_postponement_detail
|
||||
|
||||
join fk_eva_adjust_postponement1 in _repository.Context.eva_adjust_postponement on m_eva_adjust_postponement_detail_migration.adjust_postponement_id equals fk_eva_adjust_postponement1.id
|
||||
into eva_adjust_postponementResult1
|
||||
from fk_eva_adjust_postponementResult1 in eva_adjust_postponementResult1.DefaultIfEmpty()
|
||||
|
||||
join fk_eva_adjust_postponement2 in _repository.Context.eva_adjust_postponement on m_eva_adjust_postponement_detail_migration.adjust_postponement_quota_id equals fk_eva_adjust_postponement2.id
|
||||
into eva_adjust_postponementResult2
|
||||
from fk_eva_adjust_postponementResult2 in eva_adjust_postponementResult2.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage3 in emp.GetListByemployee_type(null, null) on m_eva_adjust_postponement_detail_migration.employee_id equals fk_external_linkage3.id
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
(m_eva_adjust_postponement_detail_migration.id == model.id)
|
||||
|| (model.adjust_postponement_id.HasValue && m_eva_adjust_postponement_detail_migration.adjust_postponement_id == model.adjust_postponement_id)
|
||||
|| (model.adjust_postponement_quota_id.HasValue && m_eva_adjust_postponement_detail_migration.adjust_postponement_quota_id == model.adjust_postponement_quota_id)
|
||||
|
||||
|
||||
orderby m_eva_adjust_postponement_detail_migration.created descending
|
||||
select new eva_adjust_postponement_detail_migrationViewModel()
|
||||
{
|
||||
id = m_eva_adjust_postponement_detail_migration.id,
|
||||
adjust_postponement_id = m_eva_adjust_postponement_detail_migration.adjust_postponement_id,
|
||||
adjust_postponement_quota_id = m_eva_adjust_postponement_detail_migration.adjust_postponement_quota_id,
|
||||
employee_id = m_eva_adjust_postponement_detail_migration.employee_id,
|
||||
sarary = m_eva_adjust_postponement_detail_migration.sarary,
|
||||
cost_living = m_eva_adjust_postponement_detail_migration.cost_living,
|
||||
middle = m_eva_adjust_postponement_detail_migration.middle,
|
||||
promoted_percentage = m_eva_adjust_postponement_detail_migration.promoted_percentage,
|
||||
total_promote = m_eva_adjust_postponement_detail_migration.total_promote,
|
||||
new_sarary = m_eva_adjust_postponement_detail_migration.new_sarary,
|
||||
new_cost_living = m_eva_adjust_postponement_detail_migration.new_cost_living,
|
||||
remark = m_eva_adjust_postponement_detail_migration.remark,
|
||||
receive_quota = m_eva_adjust_postponement_detail_migration.receive_quota,
|
||||
new_sarary_with_quota = m_eva_adjust_postponement_detail_migration.new_sarary_with_quota,
|
||||
position_this_time = m_eva_adjust_postponement_detail_migration.position_this_time,
|
||||
level_this_time = m_eva_adjust_postponement_detail_migration.level_this_time,
|
||||
|
||||
adjust_postponement_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
|
||||
adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult2.fiscal_year,
|
||||
employee_id_external_linkage_external_name = fk_external_linkageResult3.fullname,
|
||||
|
||||
isActive = m_eva_adjust_postponement_detail_migration.isActive,
|
||||
Created = m_eva_adjust_postponement_detail_migration.created,
|
||||
Updated = m_eva_adjust_postponement_detail_migration.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement_detail
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if (x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
|
||||
public eva_adjust_postponement_detail_migrationViewModel Insert(eva_adjust_postponement_detail_migrationInputModel model)
|
||||
{
|
||||
var entity = GetEntity(model);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
|
||||
|
||||
var inserted = _repository.Insert(entity);
|
||||
return Get(inserted.id);
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_detail_migrationViewModel Update(int id, eva_adjust_postponement_detail_migrationInputModel model)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.adjust_postponement_id = model.adjust_postponement_id;
|
||||
existingEntity.adjust_postponement_quota_id = model.adjust_postponement_quota_id;
|
||||
existingEntity.employee_id = model.employee_id;
|
||||
existingEntity.sarary = model.sarary;
|
||||
existingEntity.cost_living = model.cost_living;
|
||||
existingEntity.middle = model.middle;
|
||||
existingEntity.promoted_percentage = model.promoted_percentage;
|
||||
existingEntity.total_promote = model.total_promote;
|
||||
existingEntity.new_sarary = model.new_sarary;
|
||||
existingEntity.new_cost_living = model.new_cost_living;
|
||||
existingEntity.remark = model.remark;
|
||||
existingEntity.receive_quota = model.receive_quota;
|
||||
existingEntity.new_sarary_with_quota = model.new_sarary_with_quota;
|
||||
existingEntity.position_this_time = model.position_this_time;
|
||||
existingEntity.level_this_time = model.level_this_time;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
public string UpdateMultiple(List<eva_adjust_postponement_detail_migrationInputModel> model)
|
||||
{
|
||||
foreach (var i in model)
|
||||
{
|
||||
if (i.active_mode == "1" && i.id.HasValue) // update
|
||||
{
|
||||
var existingEntity = _repository.Get(i.id.Value);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.adjust_postponement_id = i.adjust_postponement_id;
|
||||
existingEntity.adjust_postponement_quota_id = i.adjust_postponement_quota_id;
|
||||
existingEntity.employee_id = i.employee_id;
|
||||
existingEntity.sarary = i.sarary;
|
||||
existingEntity.cost_living = i.cost_living;
|
||||
existingEntity.middle = i.middle;
|
||||
existingEntity.promoted_percentage = i.promoted_percentage;
|
||||
existingEntity.total_promote = i.total_promote;
|
||||
existingEntity.new_sarary = i.new_sarary;
|
||||
existingEntity.new_cost_living = i.new_cost_living;
|
||||
existingEntity.remark = i.remark;
|
||||
existingEntity.receive_quota = i.receive_quota;
|
||||
existingEntity.new_sarary_with_quota = i.new_sarary_with_quota;
|
||||
existingEntity.position_this_time = i.position_this_time;
|
||||
existingEntity.level_this_time = i.level_this_time;
|
||||
|
||||
//existingEntity.SetAutoField(_repository.Context);
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
}
|
||||
else if (i.active_mode == "1" && !i.id.HasValue) // add
|
||||
{
|
||||
var entity = GetEntity(i);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
//entity.SetAutoField(_repository.Context);
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
}
|
||||
else if (i.active_mode == "0" && i.id.HasValue) // remove
|
||||
{
|
||||
_repository.DeleteWithoutCommit(i.id.Value);
|
||||
}
|
||||
else if (i.active_mode == "0" && !i.id.HasValue)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
|
||||
return model.Count().ToString();
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_detail_migrationViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_postponement_detail_migrationViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public void RefreshAutoFieldOfAllData()
|
||||
{
|
||||
var all_items = from i in _repository.Context.eva_adjust_postponement_detail
|
||||
select i;
|
||||
foreach (var item in all_items)
|
||||
{
|
||||
//item.SetAutoField(_repository.Context);
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("adjust_postponement_id", "รหัสอ้างอิงตาราง eva_adjust_postponement");
|
||||
i.Add("adjust_postponement_id_eva_adjust_postponement_fiscal_year", "รหัสอ้างอิงตาราง eva_adjust_postponement");
|
||||
i.Add("adjust_postponement_quota_id", "รหัสอ้างอิงตาราง eva_adjust_postponement");
|
||||
i.Add("adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year", "รหัสอ้างอิงตาราง eva_adjust_postponement");
|
||||
i.Add("employee_id", "ผู้รับการประเมิน");
|
||||
i.Add("employee_id_external_linkage_external_name", "ผู้รับการประเมิน");
|
||||
i.Add("sarary", "เงินเดือน ก่อนปรับเลื่อน");
|
||||
i.Add("cost_living", "ค่าครองชีพ ก่อนปรับเลื่อน");
|
||||
i.Add("middle", "ค่ากลางฐานในการคำนวณ");
|
||||
i.Add("promoted_percentage", "ร้อยละที่ได้เลื่อน");
|
||||
i.Add("total_promote", "จำนวนเงินที่ได้เลื่อน");
|
||||
i.Add("new_sarary", "เงินเดือนใหม่");
|
||||
i.Add("new_cost_living", "ค่าครองชีพใหม่");
|
||||
i.Add("remark", "หมายเหตุ");
|
||||
i.Add("receive_quota", "ได้รับเงินโควต้าพิเศษ");
|
||||
i.Add("new_sarary_with_quota", "เงินเดือนใหม่ (รวมโควต้า)");
|
||||
i.Add("position_this_time", "ตำแหน่ง (ณ วันปรับเลื่อน)");
|
||||
i.Add("level_this_time", "ระดับ (ณ วันปรับเลื่อน)");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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 eva_adjust_postponement_detail_migrationViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public int? adjust_postponement_id { get; set; }
|
||||
|
||||
public int? adjust_postponement_quota_id { get; set; }
|
||||
|
||||
public int? employee_id { get; set; }
|
||||
|
||||
public decimal? sarary { get; set; }
|
||||
|
||||
public decimal? cost_living { get; set; }
|
||||
|
||||
public decimal? middle { get; set; }
|
||||
|
||||
public decimal? promoted_percentage { get; set; }
|
||||
|
||||
public decimal? total_promote { get; set; }
|
||||
|
||||
public decimal? new_sarary { get; set; }
|
||||
|
||||
public decimal? new_cost_living { get; set; }
|
||||
|
||||
public string remark { get; set; }
|
||||
|
||||
public decimal? receive_quota { get; set; }
|
||||
|
||||
public decimal? new_sarary_with_quota { get; set; }
|
||||
|
||||
public string position_this_time { get; set; }
|
||||
|
||||
public string level_this_time { get; set; }
|
||||
|
||||
public int? adjust_postponement_id_eva_adjust_postponement_fiscal_year { get; set; }
|
||||
public int? adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_detail_migrationWithSelectionViewModel: eva_adjust_postponement_detail_migrationViewModel
|
||||
{
|
||||
public List<external_employeeViewModel> item_employee_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,13 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var theemp = (from i in all_emp where i.id == m.employee_id select i).FirstOrDefault();
|
||||
|
||||
if (theemp == null) continue;
|
||||
|
||||
if (theemp.fullname.Contains("ธัญนันท์"))
|
||||
{
|
||||
string zz = "1";
|
||||
}
|
||||
|
||||
var n = new eva_adjust_postponement_detailEntity();
|
||||
n.id = newkey;
|
||||
newkey++;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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 Ieva_adjust_postponement_migrationService : IBaseService<int, eva_adjust_postponement_migrationInputModel, eva_adjust_postponement_migrationViewModel>
|
||||
{
|
||||
new eva_adjust_postponement_migrationViewModel Insert(eva_adjust_postponement_migrationInputModel model);
|
||||
new eva_adjust_postponement_migrationViewModel Update(int id, eva_adjust_postponement_migrationInputModel model);
|
||||
List<eva_adjust_postponement_migrationViewModel> GetListByfiscal_year(int? fiscal_year);
|
||||
List<eva_adjust_postponement_migrationViewModel> GetListBySearch(eva_adjust_postponement_migrationSearchModel model);
|
||||
|
||||
string UpdateMultiple(List<eva_adjust_postponement_migrationInputModel> model);
|
||||
eva_adjust_postponement_migrationWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_migrationWithSelectionViewModel GetBlankItem();
|
||||
|
||||
void RefreshAutoFieldOfAllData();
|
||||
eva_adjust_postponementEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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 eva_adjust_postponement_migrationInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
|
||||
public DateTime? theDate { get; set; }
|
||||
|
||||
public int? theRound { get; set; }
|
||||
|
||||
public int? create_evaluation_id { get; set; }
|
||||
|
||||
public decimal? limit { get; set; }
|
||||
|
||||
public decimal? limit_frame { get; set; }
|
||||
|
||||
public decimal? limit_quota { get; set; }
|
||||
|
||||
public decimal? limit_frame_quota { get; set; }
|
||||
|
||||
public decimal? percentage { get; set; }
|
||||
|
||||
public string command_no { get; set; }
|
||||
|
||||
public int? managed_by { get; set; }
|
||||
|
||||
public string imported_file { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 eva_adjust_postponement_migrationReportRequestModel : eva_adjust_postponement_migrationSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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 eva_adjust_postponement_migrationSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
|
||||
public int? theRound { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,487 @@
|
||||
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;
|
||||
using System.IO;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_migrationService : Ieva_adjust_postponement_migrationService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private Ieva_adjust_postponement_detailService postpone_detail;
|
||||
|
||||
public eva_adjust_postponement_migrationService(IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp, Ieva_adjust_postponement_detailService in_postpone_detail)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
postpone_detail = in_postpone_detail;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponementEntity GetEntity(eva_adjust_postponement_migrationInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponementEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponementEntity> GetEntityList(List<eva_adjust_postponement_migrationInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementEntity>>(models);
|
||||
}
|
||||
private eva_adjust_postponement_migrationViewModel GetDto(eva_adjust_postponementEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponement_migrationViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_postponement_migrationViewModel> GetDtoList(List<eva_adjust_postponementEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_migrationViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_postponement_migrationViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponementEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_migrationWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_postponement_migrationWithSelectionViewModel>(entity);
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation select x).ToList();
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_migrationWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_postponement_migrationWithSelectionViewModel();
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation select x).ToList();
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_migrationViewModel> GetListByfiscal_year(int? fiscal_year)
|
||||
{
|
||||
var model = new eva_adjust_postponement_migrationSearchModel();
|
||||
model.fiscal_year = fiscal_year;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_migrationViewModel> GetListBySearch(eva_adjust_postponement_migrationSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_postponement_migration in _repository.Context.eva_adjust_postponement
|
||||
|
||||
join fk_eva_create_evaluation4 in _repository.Context.eva_create_evaluation on m_eva_adjust_postponement_migration.create_evaluation_id equals fk_eva_create_evaluation4.id
|
||||
into eva_create_evaluationResult4
|
||||
from fk_eva_create_evaluationResult4 in eva_create_evaluationResult4.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage11 in emp.GetListByemployee_type(null, null) on m_eva_adjust_postponement_migration.managed_by equals fk_external_linkage11.id
|
||||
into external_linkageResult11
|
||||
from fk_external_linkageResult11 in external_linkageResult11.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (!model.fiscal_year.HasValue || m_eva_adjust_postponement_migration.fiscal_year == model.fiscal_year)
|
||||
&& (!model.theRound.HasValue || m_eva_adjust_postponement_migration.theRound == model.theRound)
|
||||
|
||||
|
||||
orderby m_eva_adjust_postponement_migration.created descending
|
||||
select new eva_adjust_postponement_migrationViewModel()
|
||||
{
|
||||
id = m_eva_adjust_postponement_migration.id,
|
||||
fiscal_year = m_eva_adjust_postponement_migration.fiscal_year,
|
||||
theDate = m_eva_adjust_postponement_migration.theDate,
|
||||
theRound = m_eva_adjust_postponement_migration.theRound,
|
||||
create_evaluation_id = m_eva_adjust_postponement_migration.create_evaluation_id,
|
||||
limit = m_eva_adjust_postponement_migration.limit,
|
||||
limit_frame = m_eva_adjust_postponement_migration.limit_frame,
|
||||
limit_quota = m_eva_adjust_postponement_migration.limit_quota,
|
||||
limit_frame_quota = m_eva_adjust_postponement_migration.limit_frame_quota,
|
||||
percentage = m_eva_adjust_postponement_migration.percentage,
|
||||
command_no = m_eva_adjust_postponement_migration.command_no,
|
||||
managed_by = m_eva_adjust_postponement_migration.managed_by,
|
||||
imported_file = m_eva_adjust_postponement_migration.imported_file,
|
||||
imported_fileDisplay = m_eva_adjust_postponement_migration.imported_fileDisplay,
|
||||
|
||||
create_evaluation_id_eva_create_evaluation_performance_plan_id = fk_eva_create_evaluationResult4.performance_plan_id,
|
||||
managed_by_external_linkage_external_name = fk_external_linkageResult11.fullname,
|
||||
|
||||
isActive = m_eva_adjust_postponement_migration.isActive,
|
||||
Created = m_eva_adjust_postponement_migration.created,
|
||||
Updated = m_eva_adjust_postponement_migration.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if (x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
|
||||
public eva_adjust_postponement_migrationViewModel Insert(eva_adjust_postponement_migrationInputModel model)
|
||||
{
|
||||
var entity = GetEntity(model);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
|
||||
if (!string.IsNullOrEmpty(model.imported_file))
|
||||
{
|
||||
//Move file from temp to physical
|
||||
string imported_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
model.imported_file, FilePathConstant.DirType.FilesTestUpload, entity.id);
|
||||
entity.imported_file = imported_fileFileName;
|
||||
|
||||
var filepath = FileUtil.GetFileInfo(TTSW.Constant.FilePathConstant.DirType.FilesTestUpload, entity.id, entity.imported_file).PhysicalPath;
|
||||
entity.command_no = AddItems(filepath, entity.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("ไม่ได้แนบไฟล์เข้ามา ไม่สามารถเพิ่มรายการประวัติเงินเดือนย้อนหลัง ได้");
|
||||
}
|
||||
|
||||
entity.imported_date = DateTime.Now;
|
||||
|
||||
var inserted = _repository.Insert(entity);
|
||||
return Get(inserted.id);
|
||||
}
|
||||
|
||||
private string AddItems(string filepath, int id)
|
||||
{
|
||||
string return_text = "";
|
||||
|
||||
var excel = GetDataTableFromExcel(filepath);
|
||||
|
||||
var all_emp = (from q in emp.GetAllEmployee()
|
||||
select q).ToList();
|
||||
|
||||
var newkey = postpone_detail.GetNewPrimaryKey();
|
||||
|
||||
for (int j = 0; j < excel.Rows.Count; j++)
|
||||
{
|
||||
string employee_no = "N/A";
|
||||
|
||||
try
|
||||
{
|
||||
string position = excel.Rows[j]["position"].ToString();
|
||||
string level = excel.Rows[j]["level"].ToString();
|
||||
employee_no = excel.Rows[j]["employee_no"].ToString();
|
||||
decimal? old_salary = Convert.ToDecimal(excel.Rows[j]["old_salary"]);
|
||||
decimal? old_cost_living = Convert.ToDecimal(excel.Rows[j]["old_cost_living"]);
|
||||
decimal? middle = Convert.ToDecimal(excel.Rows[j]["middle"]);
|
||||
decimal? promoted_percentage = Convert.ToDecimal(excel.Rows[j]["promoted_percentage"]);
|
||||
decimal? total_promote = Convert.ToDecimal(excel.Rows[j]["total_promote"]);
|
||||
decimal? receive_quota = Convert.ToDecimal(excel.Rows[j]["receive_quota"]);
|
||||
decimal? new_sarary_with_quota = Convert.ToDecimal(excel.Rows[j]["new_sarary_with_quota"]);
|
||||
decimal? new_cost_living = Convert.ToDecimal(excel.Rows[j]["new_cost_living"]);
|
||||
string remark = excel.Rows[j]["remark"].ToString();
|
||||
|
||||
var item = new eva_adjust_postponement_detailEntity();
|
||||
item.id = newkey;
|
||||
newkey += 1;
|
||||
|
||||
item.adjust_postponement_id = id;
|
||||
item.adjust_postponement_quota_id = id;
|
||||
|
||||
var employee = (from qq in all_emp where qq.employee_no == employee_no select qq).FirstOrDefault();
|
||||
if (employee == null)
|
||||
{
|
||||
return_text += " ไม่พบ " + employee_no;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.employee_id = employee.id;
|
||||
item.sarary = old_salary;
|
||||
item.cost_living = old_cost_living;
|
||||
item.middle = middle;
|
||||
item.promoted_percentage = promoted_percentage;
|
||||
item.total_promote = total_promote;
|
||||
item.new_sarary = old_salary + total_promote;
|
||||
item.new_cost_living = new_cost_living;
|
||||
item.remark = remark;
|
||||
item.receive_quota = receive_quota;
|
||||
item.new_sarary_with_quota = new_sarary_with_quota;
|
||||
item.position_this_time = position;
|
||||
item.level_this_time = level;
|
||||
|
||||
_repository.Context.Add(item);
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
throw new Exception("มีความผิดพลาดในการแปลงข้อมูลของ "+ employee_no + " = "+ ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return return_text;
|
||||
}
|
||||
|
||||
private DataTable GetDataTableFromExcel(string path, bool hasHeader = true)
|
||||
{
|
||||
using (var pck = new OfficeOpenXml.ExcelPackage())
|
||||
{
|
||||
using (var stream = File.OpenRead(path))
|
||||
{
|
||||
pck.Load(stream);
|
||||
}
|
||||
var ws = pck.Workbook.Worksheets.First();
|
||||
DataTable tbl = new DataTable();
|
||||
foreach (var firstRowCell in ws.Cells[1, 1, 1, ws.Dimension.End.Column])
|
||||
{
|
||||
tbl.Columns.Add(hasHeader ? firstRowCell.Text : string.Format("Column {0}", firstRowCell.Start.Column));
|
||||
}
|
||||
var startRow = hasHeader ? 2 : 1;
|
||||
for (int rowNum = startRow; rowNum <= ws.Dimension.End.Row; rowNum++)
|
||||
{
|
||||
var wsRow = ws.Cells[rowNum, 1, rowNum, ws.Dimension.End.Column];
|
||||
DataRow row = tbl.Rows.Add();
|
||||
foreach (var cell in wsRow)
|
||||
{
|
||||
row[cell.Start.Column - 1] = cell.Text;
|
||||
}
|
||||
}
|
||||
return tbl;
|
||||
}
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_migrationViewModel Update(int id, eva_adjust_postponement_migrationInputModel model)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.fiscal_year = model.fiscal_year;
|
||||
existingEntity.theDate = model.theDate;
|
||||
existingEntity.theRound = model.theRound;
|
||||
existingEntity.create_evaluation_id = model.create_evaluation_id;
|
||||
existingEntity.limit = model.limit;
|
||||
existingEntity.limit_frame = model.limit_frame;
|
||||
existingEntity.limit_quota = model.limit_quota;
|
||||
existingEntity.limit_frame_quota = model.limit_frame_quota;
|
||||
existingEntity.percentage = model.percentage;
|
||||
existingEntity.command_no = model.command_no;
|
||||
existingEntity.managed_by = model.managed_by;
|
||||
if (!string.IsNullOrEmpty(model.imported_file))
|
||||
{
|
||||
if (model.imported_file.StartsWith("Uploads"))
|
||||
{
|
||||
var imported_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
model.imported_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.imported_file);
|
||||
existingEntity.imported_file = imported_fileFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.imported_file = model.imported_file;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.imported_file = null;
|
||||
}
|
||||
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
public string UpdateMultiple(List<eva_adjust_postponement_migrationInputModel> model)
|
||||
{
|
||||
foreach (var i in model)
|
||||
{
|
||||
if (i.active_mode == "1" && i.id.HasValue) // update
|
||||
{
|
||||
var existingEntity = _repository.Get(i.id.Value);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.fiscal_year = i.fiscal_year;
|
||||
existingEntity.theDate = i.theDate;
|
||||
existingEntity.theRound = i.theRound;
|
||||
existingEntity.create_evaluation_id = i.create_evaluation_id;
|
||||
existingEntity.limit = i.limit;
|
||||
existingEntity.limit_frame = i.limit_frame;
|
||||
existingEntity.limit_quota = i.limit_quota;
|
||||
existingEntity.limit_frame_quota = i.limit_frame_quota;
|
||||
existingEntity.percentage = i.percentage;
|
||||
existingEntity.command_no = i.command_no;
|
||||
existingEntity.managed_by = i.managed_by;
|
||||
if (!string.IsNullOrEmpty(i.imported_file))
|
||||
{
|
||||
if (i.imported_file.StartsWith("Uploads"))
|
||||
{
|
||||
var imported_fileFileName = FileUtil.MoveTempUploadFileToActualPath(
|
||||
i.imported_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.imported_file);
|
||||
existingEntity.imported_file = imported_fileFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.imported_file = i.imported_file;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
existingEntity.imported_file = null;
|
||||
}
|
||||
|
||||
|
||||
//existingEntity.SetAutoField(_repository.Context);
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
}
|
||||
else if (i.active_mode == "1" && !i.id.HasValue) // add
|
||||
{
|
||||
var entity = GetEntity(i);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
//entity.SetAutoField(_repository.Context);
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
}
|
||||
else if (i.active_mode == "0" && i.id.HasValue) // remove
|
||||
{
|
||||
_repository.DeleteWithoutCommit(i.id.Value);
|
||||
}
|
||||
else if (i.active_mode == "0" && !i.id.HasValue)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
|
||||
return model.Count().ToString();
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_migrationViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_postponement_migrationViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
var postponement = (from i in _repository.Context.eva_adjust_postponement
|
||||
where i.id == id
|
||||
select i).FirstOrDefault();
|
||||
if (postponement == null || !postponement.imported_date.HasValue)
|
||||
{
|
||||
throw new Exception("ไม่สามารถลบรายการได้ เพราะ ไม่ใช่รายการที่นำเข้าย้อนหลัง");
|
||||
}
|
||||
|
||||
var items = (from i in _repository.Context.eva_adjust_postponement_detail
|
||||
where i.adjust_postponement_id == id
|
||||
|| i.adjust_postponement_quota_id == id
|
||||
select i).ToList();
|
||||
_repository.Context.RemoveRange(items);
|
||||
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public void RefreshAutoFieldOfAllData()
|
||||
{
|
||||
var all_items = from i in _repository.Context.eva_adjust_postponement
|
||||
select i;
|
||||
foreach (var item in all_items)
|
||||
{
|
||||
//item.SetAutoField(_repository.Context);
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("fiscal_year", "ปีงบประมาณ ");
|
||||
i.Add("theDate", "วันที่เลื่อน");
|
||||
i.Add("txt_theDate", "วันที่เลื่อน");
|
||||
i.Add("theRound", "ครั้งที่เลื่อน");
|
||||
i.Add("create_evaluation_id", "กลุ่มการประเมิน");
|
||||
i.Add("create_evaluation_id_eva_create_evaluation_performance_plan_id", "กลุ่มการประเมิน");
|
||||
i.Add("limit", "บริหารวงเงิน");
|
||||
i.Add("limit_frame", "กรอบวงเงินร้อยละ");
|
||||
i.Add("limit_quota", "จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ");
|
||||
i.Add("limit_frame_quota", "กรอบโควต้าพิเศษร้อยละ");
|
||||
i.Add("percentage", "ร้อยละที่ได้เลื่อน");
|
||||
i.Add("command_no", "เลขที่คำสั่ง");
|
||||
i.Add("managed_by", "ผู้จัดทำข้อมูล");
|
||||
i.Add("managed_by_external_linkage_external_name", "ผู้จัดทำข้อมูล");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
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 eva_adjust_postponement_migrationViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
|
||||
public DateTime? theDate { get; set; }
|
||||
|
||||
public string txt_theDate { get { return MyHelper.GetDateStringForReport(this.theDate); } }
|
||||
|
||||
public int? theRound { get; set; }
|
||||
|
||||
public int? create_evaluation_id { get; set; }
|
||||
|
||||
public decimal? limit { get; set; }
|
||||
|
||||
public decimal? limit_frame { get; set; }
|
||||
|
||||
public decimal? limit_quota { get; set; }
|
||||
|
||||
public decimal? limit_frame_quota { get; set; }
|
||||
|
||||
public decimal? percentage { get; set; }
|
||||
|
||||
public string command_no { get; set; }
|
||||
|
||||
public int? managed_by { get; set; }
|
||||
|
||||
public string imported_file { get; set; }
|
||||
public string imported_fileDisplay { get; set; }
|
||||
|
||||
public string txt_imported_file
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string.IsNullOrEmpty(imported_file) ? "" :
|
||||
$"<a href='../{imported_fileDisplay}' target='_blank'>{imported_file}</a>");
|
||||
}
|
||||
}
|
||||
|
||||
public Guid? create_evaluation_id_eva_create_evaluation_performance_plan_id { get; set; }
|
||||
public string managed_by_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_migrationWithSelectionViewModel: eva_adjust_postponement_migrationViewModel
|
||||
{
|
||||
public List<eva_create_evaluationEntity> item_create_evaluation_id { get; set; }
|
||||
public List<external_employeeViewModel> item_managed_by { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,8 @@
|
||||
"SiteInformation_chatsite": "http://chat.rmutto.ac.th",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"MIGRATION": "true",
|
||||
"JasperReportServer_MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"JasperReportServer_LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"JasperReportServer_MainURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"JasperReportServer_LoginURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"SiteInformation_appsite": "/eva",
|
||||
"SiteInformation_sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์"
|
||||
}
|
||||
|
||||
12
Startup.cs
12
Startup.cs
@@ -295,6 +295,10 @@ namespace Test01
|
||||
|
||||
services.AddScoped<Icore_permission_listService, core_permission_listService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_postponement_detail_migrationService, eva_adjust_postponement_detail_migrationService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_postponement_migrationService, eva_adjust_postponement_migrationService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -522,6 +526,14 @@ namespace Test01
|
||||
cfg.CreateMap<eva_level_scoreEntity, core_permission_listViewModel>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, core_permission_listWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_postponement_migrationInputModel, eva_adjust_postponementEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_migrationViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_migrationWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_postponement_detail_migrationInputModel, eva_adjust_postponement_detailEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_migrationViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_migrationWithSelectionViewModel>();
|
||||
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
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 eva_adjust_postponement_migrationViewController : Controller
|
||||
{
|
||||
private ILogger<eva_adjust_postponement_migrationController> _logger;
|
||||
private Ieva_adjust_postponement_migrationService _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 eva_adjust_postponement_migrationViewController(ILogger<eva_adjust_postponement_migrationController> logger, Ieva_adjust_postponement_migrationService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IActionResult eva_adjust_postponement_migration()
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult eva_adjust_postponement_migration_d()
|
||||
{
|
||||
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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_postponement_detail_migration";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_detail_migrationModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_detail_migrationModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_adjust_postponement_detail_migrationModelLabel">บันทึกข้อมูล eva_adjust_postponement_detail_migration</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_id" />
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_adjust_postponement_id" />
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_adjust_postponement_quota_id" />
|
||||
|
||||
<div class='row'></div>
|
||||
<div class='row'></div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_employee_id" for="eva_adjust_postponement_detail_migration_employee_id">ผู้รับการประเมิน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_detail_migration_employee_id" iLabel="ผู้รับการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" ></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_sarary" for="eva_adjust_postponement_detail_migration_sarary">เงินเดือน ก่อนปรับเลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_sarary" iLabel="เงินเดือน ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_cost_living" for="eva_adjust_postponement_detail_migration_cost_living">ค่าครองชีพ ก่อนปรับเลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_cost_living" iLabel="ค่าครองชีพ ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_middle" for="eva_adjust_postponement_detail_migration_middle">ค่ากลางฐานในการคำนวณ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_middle" iLabel="ค่ากลางฐานในการคำนวณ" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_promoted_percentage" for="eva_adjust_postponement_detail_migration_promoted_percentage">ร้อยละที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_promoted_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_total_promote" for="eva_adjust_postponement_detail_migration_total_promote">จำนวนเงินที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_total_promote" iLabel="จำนวนเงินที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_sarary" for="eva_adjust_postponement_detail_migration_new_sarary">เงินเดือนใหม่</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_sarary" iLabel="เงินเดือนใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_cost_living" for="eva_adjust_postponement_detail_migration_new_cost_living">ค่าครองชีพใหม่</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_cost_living" iLabel="ค่าครองชีพใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_receive_quota" for="eva_adjust_postponement_detail_migration_receive_quota">ได้รับเงินโควต้าพิเศษ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_receive_quota" iLabel="ได้รับเงินโควต้าพิเศษ" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_sarary_with_quota" for="eva_adjust_postponement_detail_migration_new_sarary_with_quota">เงินเดือนใหม่ (รวมโควต้า)</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_sarary_with_quota" iLabel="เงินเดือนใหม่ (รวมโควต้า)" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_remark" for="eva_adjust_postponement_detail_migration_remark">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_detail_migration_remark" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_position_this_time" for="eva_adjust_postponement_detail_migration_position_this_time">ตำแหน่ง (ณ วันปรับเลื่อน)</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_detail_migration_position_this_time" iLabel="ตำแหน่ง (ณ วันปรับเลื่อน)" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_level_this_time" for="eva_adjust_postponement_detail_migration_level_this_time">ระดับ (ณ วันปรับเลื่อน)</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_detail_migration_level_this_time" iLabel="ระดับ (ณ วันปรับเลื่อน)" iRequire="true" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_detail_migration_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">eva_adjust_postponement_detail_migration</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>ค้นหา eva_adjust_postponement_detail_migration</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_detail_migration_adjust_postponement_id' for='s_eva_adjust_postponement_detail_migration_adjust_postponement_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label>
|
||||
<input class="form-control" type="hidden" id="s_eva_adjust_postponement_detail_migration_adjust_postponement_id" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id' for='s_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label>
|
||||
<input class="form-control" type="hidden" id="s_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_migration_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_migration_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_migration_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_postponement_detail_migrationTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_id'>รหัสอ้างอิง</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_adjust_postponement_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_employee_id'>ผู้รับการประเมิน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_middle'>ค่ากลางฐานในการคำนวณ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_sarary'>เงินเดือนใหม่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_cost_living'>ค่าครองชีพใหม่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_remark'>หมายเหตุ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_position_this_time'>ตำแหน่ง (ณ วันปรับเลื่อน)</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_level_this_time'>ระดับ (ณ วันปรับเลื่อน)</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_detail_migration/eva_adjust_postponement_detail_migration.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_postponement_detail_migration_InitiateDataTable();
|
||||
eva_adjust_postponement_detail_migration_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_postponement_detail_migration");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_postponement_migration";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_migrationModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_migrationModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_adjust_postponement_migrationModelLabel">บันทึกข้อมูล รอบการปรับเงินเดือน</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_migration_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_fiscal_year" for="eva_adjust_postponement_migration_fiscal_year">ปีงบประมาณ </label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_fiscal_year" iLabel="ปีงบประมาณ " iRequire="true" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_theDate" for="eva_adjust_postponement_migration_theDate">วันที่เลื่อน</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_migration_theDate" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_theRound" for="eva_adjust_postponement_migration_theRound">ครั้งที่เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_theRound" iLabel="ครั้งที่เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_postponement_migration_create_evaluation_id" for="eva_adjust_postponement_migration_create_evaluation_id">แบบประเมิน (ไม่ต้องระบุก็ได้)</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_migration_create_evaluation_id" iLabel="แบบประเมิน" iRequire="false" iGroup="eva_adjust_postponement_migration"></select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit" for="eva_adjust_postponement_migration_limit">บริหารวงเงิน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit" iLabel="บริหารวงเงิน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_frame" for="eva_adjust_postponement_migration_limit_frame">กรอบวงเงินร้อยละ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_quota" for="eva_adjust_postponement_migration_limit_quota">จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_frame_quota" for="eva_adjust_postponement_migration_limit_frame_quota">กรอบโควต้าพิเศษร้อยละ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_frame_quota" iLabel="กรอบโควต้าพิเศษร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_percentage" for="eva_adjust_postponement_migration_percentage">ร้อยละที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-8">
|
||||
<label id="lab_eva_adjust_postponement_migration_command_no" for="eva_adjust_postponement_migration_command_no">เลขที่คำสั่ง</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_migration_command_no" iLabel="เลขที่คำสั่ง" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_managed_by" for="eva_adjust_postponement_migration_managed_by">ผู้จัดทำข้อมูล</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_migration_managed_by" iLabel="ผู้จัดทำข้อมูล" iRequire="false" iGroup="eva_adjust_postponement_migration"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_imported_file" for="eva_adjust_postponement_migration_imported_file">ไฟล์นำเข้า</label>
|
||||
<p>
|
||||
<a id="eva_adjust_postponement_migration_imported_file_linkurl" href="#" target="_blank" class="btn btn-info">ดูหรือดาวโหลดไฟล์ของคุณ</a>
|
||||
<a id="eva_adjust_postponement_migration_imported_file_remove" href="javascript:removeFile('eva_adjust_postponement_migration_imported_file');" class="btn btn-danger">ลบไฟล์</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
นำเข้าไฟล์ใหม่
|
||||
<input type="file" id="eva_adjust_postponement_migration_imported_file_file" />
|
||||
<input type="hidden" id="eva_adjust_postponement_migration_imported_file_hidURL" iLabel="ไฟล์นำเข้า" iRequire="true" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_migration_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">หน้าจอนำเข้าข้อมูล ประวัติการปรับเงินเดือนย้อนหลัง (ใช้สำหรับ ZD เท่านั้น)</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>หน้าจอนำเข้าข้อมูล ประวัติการปรับเงินเดือนย้อนหลัง (ใช้สำหรับ ZD เท่านั้น)</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_migration_fiscal_year' for='s_eva_adjust_postponement_migration_fiscal_year'>ปีงบประมาณ </label>
|
||||
<input class="form-control" type="number" id="s_eva_adjust_postponement_migration_fiscal_year" iLabel="ปีงบประมาณ " iRequire="false" iGroup="s_eva_adjust_postponement_migration" title='ปีงบประมาณ ' placeholder='ปีงบประมาณ ' />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_migration_theRound' for='s_eva_adjust_postponement_migration_theRound'>ครั้งที่เลื่อน</label>
|
||||
<input class="form-control" type="number" id="s_eva_adjust_postponement_migration_theRound" iLabel="ครั้งที่เลื่อน" iRequire="false" iGroup="s_eva_adjust_postponement_migration" title='ครั้งที่เลื่อน' placeholder='ครั้งที่เลื่อน' />
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_migration_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_migration_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_postponement_migration_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_postponement_migrationTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_fiscal_year'>ปีงบประมาณ </label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_theRound'>ครั้งที่เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_limit'>บริหารวงเงิน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_limit_frame'>กรอบวงเงินร้อยละ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_limit_quota'>จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_limit_frame_quota'>กรอบโควต้าพิเศษร้อยละ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_percentage'>ร้อยละที่ได้เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_managed_by'>ผู้จัดทำข้อมูล</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_migration_imported_file'>ไฟล์นำเข้า</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_migration/eva_adjust_postponement_migration.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_postponement_migration_InitiateDataTable();
|
||||
eva_adjust_postponement_migration_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_postponement_migration");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_postponement_migration";
|
||||
Layout = "_LayoutDirect";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_detail_migrationModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_detail_migrationModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_adjust_postponement_detail_migrationModelLabel">บันทึกข้อมูล การปรับเลื่อนเงินเดือน</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_id" />
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_adjust_postponement_id" />
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_migration_adjust_postponement_quota_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_employee_id" for="eva_adjust_postponement_detail_migration_employee_id">ผู้รับการประเมิน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_detail_migration_employee_id" iLabel="ผู้รับการประเมิน" iRequire="false" iGroup="eva_adjust_postponement_detail_migration"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_position_this_time" for="eva_adjust_postponement_detail_migration_position_this_time">ตำแหน่ง (ณ วันปรับเลื่อน)</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_detail_migration_position_this_time" iLabel="ตำแหน่ง (ณ วันปรับเลื่อน)" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_level_this_time" for="eva_adjust_postponement_detail_migration_level_this_time">ระดับ (ณ วันปรับเลื่อน)</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_detail_migration_level_this_time" iLabel="ระดับ (ณ วันปรับเลื่อน)" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class='row'>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_sarary" for="eva_adjust_postponement_detail_migration_sarary">เงินเดือน ก่อนปรับเลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_sarary" iLabel="เงินเดือน ก่อนปรับเลื่อน" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_cost_living" for="eva_adjust_postponement_detail_migration_cost_living">ค่าครองชีพ ก่อนปรับเลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_cost_living" iLabel="ค่าครองชีพ ก่อนปรับเลื่อน" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_total_promote" for="eva_adjust_postponement_detail_migration_total_promote">จำนวนเงินที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_total_promote" iLabel="จำนวนเงินที่ได้เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_promoted_percentage" for="eva_adjust_postponement_detail_migration_promoted_percentage">ร้อยละที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_promoted_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_middle" for="eva_adjust_postponement_detail_migration_middle">ค่ากลางฐานในการคำนวณ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_middle" iLabel="ค่ากลางฐานในการคำนวณ" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_sarary" for="eva_adjust_postponement_detail_migration_new_sarary">เงินเดือนใหม่</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_sarary" iLabel="เงินเดือนใหม่" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_cost_living" for="eva_adjust_postponement_detail_migration_new_cost_living">ค่าครองชีพใหม่</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_cost_living" iLabel="ค่าครองชีพใหม่" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_receive_quota" for="eva_adjust_postponement_detail_migration_receive_quota">ได้รับเงินโควต้าพิเศษ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_receive_quota" iLabel="ได้รับเงินโควต้าพิเศษ" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_new_sarary_with_quota" for="eva_adjust_postponement_detail_migration_new_sarary_with_quota">เงินเดือนใหม่ (รวมโควต้า)</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_detail_migration_new_sarary_with_quota" iLabel="เงินเดือนใหม่ (รวมโควต้า)" iRequire="false" iGroup="eva_adjust_postponement_detail_migration" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_detail_migration_remark" for="eva_adjust_postponement_detail_migration_remark">หมายเหตุ</label>
|
||||
<input class="form-control" id="eva_adjust_postponement_detail_migration_remark" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_postponement_detail_migration"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_detail_migration_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">บันทึกข้อมูล รอบการปรับเงินเดือน</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title col-md-12"><div class="line"></div>บันทึกข้อมูล รอบการปรับเงินเดือน</div>
|
||||
|
||||
<section class="card no-border">
|
||||
<div class="card-body" style="">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_migration_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_fiscal_year" for="eva_adjust_postponement_migration_fiscal_year">ปีงบประมาณ </label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_fiscal_year" iLabel="ปีงบประมาณ " iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_theDate" for="eva_adjust_postponement_migration_theDate">วันที่เลื่อน</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_migration_theDate" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_theRound" for="eva_adjust_postponement_migration_theRound">ครั้งที่เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_theRound" iLabel="ครั้งที่เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_create_evaluation_id" for="eva_adjust_postponement_migration_create_evaluation_id">แบบประเมิน (ไม่ต้องระบุก็ได้)</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_migration_create_evaluation_id" iLabel="แบบประเมิน" iRequire="false" iGroup="eva_adjust_postponement_migration"></select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit" for="eva_adjust_postponement_migration_limit">บริหารวงเงิน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit" iLabel="บริหารวงเงิน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_frame" for="eva_adjust_postponement_migration_limit_frame">กรอบวงเงินร้อยละ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_quota" for="eva_adjust_postponement_migration_limit_quota">จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงินหรือวงเงินโควต้าพิเศษ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_limit_frame_quota" for="eva_adjust_postponement_migration_limit_frame_quota">กรอบโควต้าพิเศษร้อยละ</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_limit_frame_quota" iLabel="กรอบโควต้าพิเศษร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_percentage" for="eva_adjust_postponement_migration_percentage">ร้อยละที่ได้เลื่อน</label>
|
||||
<input class="form-control" type="number" id="eva_adjust_postponement_migration_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-8">
|
||||
<label id="lab_eva_adjust_postponement_migration_command_no" for="eva_adjust_postponement_migration_command_no">เลขที่คำสั่ง</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_migration_command_no" iLabel="เลขที่คำสั่ง" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_managed_by" for="eva_adjust_postponement_migration_managed_by">ผู้จัดทำข้อมูล</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_migration_managed_by" iLabel="ผู้จัดทำข้อมูล" iRequire="false" iGroup="eva_adjust_postponement_migration"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_migration_imported_file" for="eva_adjust_postponement_migration_imported_file">ไฟล์นำเข้า</label>
|
||||
<p>
|
||||
<a id="eva_adjust_postponement_migration_imported_file_linkurl" href="#" target="_blank" class="btn btn-info">ดูหรือดาวโหลดไฟล์ของคุณ</a>
|
||||
<a id="eva_adjust_postponement_migration_imported_file_remove" href="javascript:removeFile('eva_adjust_postponement_migration_imported_file');" class="btn btn-danger">ลบไฟล์</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
นำเข้าไฟล์ใหม่
|
||||
<input type="file" id="eva_adjust_postponement_migration_imported_file_file" />
|
||||
<input type="hidden" id="eva_adjust_postponement_migration_imported_file_hidURL" iLabel="ไฟล์นำเข้า" iRequire="false" iGroup="eva_adjust_postponement_migration" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<p>ในการแก้ไข จะไม่อนุญาตให้นำเข้าไฟล์ใหม่ หากต้องการนำเข้าใหม่ ให้ลบรอบการปรับเงินเดือนออก และสร้างรอบการปรับเงินเดือน ใหม่อีกครั้ง</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<button type="button" class="btn btn-outline" onclick="javascript:window_close()" style="background-color: #fff;">กลับ</button>
|
||||
<button type="button" class="btn btn-submit" onclick="javascript:eva_adjust_postponement_migration_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<br/>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>รายชื่อผู้ได้ปรับเลื่อนเงินเดือน ในครั้งนี้</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<input class="form-control" type="hidden" id="s_eva_adjust_postponement_detail_migration_adjust_postponement_id" />
|
||||
<input class="form-control" type="hidden" id="s_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id" />
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_migration_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_migration_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_postponement_detail_migrationTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_employee_id'>ผู้รับการประเมิน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_middle'>ค่ากลางฐานในการคำนวณ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_sarary'>เงินเดือนใหม่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_cost_living'>ค่าครองชีพใหม่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_detail_migration_remark'>หมายเหตุ</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_migration/eva_adjust_postponement_migration_d.js"></script>
|
||||
<script src="~/js/eva_adjust_postponement_detail_migration/eva_adjust_postponement_detail_migration.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var id = getUrlParameter("id");
|
||||
if (id) {
|
||||
eva_adjust_postponement_migration_SetEditForm(id);
|
||||
eva_adjust_postponement_detail_migration_InitiateDataTable();
|
||||
eva_adjust_postponement_detail_migration_InitialForm();
|
||||
|
||||
} else {
|
||||
eva_adjust_postponement_migration_SetCreateForm();
|
||||
}
|
||||
|
||||
$("#eva_adjust_postponement_migration_managed_by").select2();
|
||||
$("#eva_adjust_postponement_detail_migration_employee_id").select2();
|
||||
|
||||
SetupValidationRemark("eva_adjust_postponement_migration");
|
||||
SetupValidationRemark("eva_adjust_postponement_detail_migration");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"MainURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "tb@zd.co.th",
|
||||
"password": "Be$m@rt",
|
||||
"reportsite": "/tb320hr_site2"
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"MainURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "tb@zd.co.th",
|
||||
"password": "Be$m@rt",
|
||||
"reportsite": "/tb320hr_site2"
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"MainURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb-320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "tb@zd.co.th",
|
||||
"password": "Be$m@rt",
|
||||
"reportsite": "/tb320hr"
|
||||
|
||||
@@ -68,6 +68,12 @@
|
||||
<None Remove="Files\**" />
|
||||
<None Remove="Uploads\**" />
|
||||
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
|
||||
<None Include="Views\eva_adjust_postponement_detail_migrationView\eva_adjust_postponement_detail_migration.cshtml" />
|
||||
<None Include="Views\eva_adjust_postponement_migrationView\eva_adjust_postponement_migration.cshtml" />
|
||||
<None Include="Views\eva_adjust_postponement_migrationView\eva_adjust_postponement_migration_d.cshtml" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration_d.js" />
|
||||
<Content Update="nlog.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
244
tb320eva.xml
244
tb320eva.xml
@@ -52,6 +52,124 @@
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController},TodoAPI2.Models.Ieva_adjust_postponement_detail_migrationService,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.eva_adjust_postponement_detail_migrationController.Get(System.Int32)">
|
||||
<summary>
|
||||
Get specific item by id
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return Get specific item by id</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.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.eva_adjust_postponement_detail_migrationController.GetList(System.Nullable{System.Int32})">
|
||||
<summary>
|
||||
Get list items by adjust_postponement_id
|
||||
</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.eva_adjust_postponement_detail_migrationController.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_detail_migrationSearchModel)">
|
||||
<summary>
|
||||
Get list items by search
|
||||
</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.eva_adjust_postponement_detail_migrationController.eva_adjust_postponement_detail_migration_report(TodoAPI2.Models.eva_adjust_postponement_detail_migrationReportRequestModel)">
|
||||
<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.eva_adjust_postponement_detail_migrationController.Insert(TodoAPI2.Models.eva_adjust_postponement_detail_migrationInputModel)">
|
||||
<summary>
|
||||
Create new item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_detail_migrationInputModel)">
|
||||
<summary>
|
||||
Update item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.Delete(System.Int32)">
|
||||
<summary>
|
||||
Delete item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_adjust_postponement_detail_migrationInputModel})">
|
||||
<summary>
|
||||
Update multiple item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_migrationController.RefreshAutoField">
|
||||
<summary>
|
||||
Refresh AutoField of all items
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_detail_normalController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_detail_normalController},TodoAPI2.Models.Ieva_adjust_postponement_detail_normalService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
@@ -455,6 +573,124 @@
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_migrationController},TodoAPI2.Models.Ieva_adjust_postponement_migrationService,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.eva_adjust_postponement_migrationController.Get(System.Int32)">
|
||||
<summary>
|
||||
Get specific item by id
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return Get specific item by id</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.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.eva_adjust_postponement_migrationController.GetList(System.Nullable{System.Int32})">
|
||||
<summary>
|
||||
Get list items by fiscal_year
|
||||
</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.eva_adjust_postponement_migrationController.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_migrationSearchModel)">
|
||||
<summary>
|
||||
Get list items by search
|
||||
</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.eva_adjust_postponement_migrationController.eva_adjust_postponement_migration_report(TodoAPI2.Models.eva_adjust_postponement_migrationReportRequestModel)">
|
||||
<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.eva_adjust_postponement_migrationController.Insert(TodoAPI2.Models.eva_adjust_postponement_migrationInputModel)">
|
||||
<summary>
|
||||
Create new item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_migrationInputModel)">
|
||||
<summary>
|
||||
Update item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.Delete(System.Int32)">
|
||||
<summary>
|
||||
Delete item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_adjust_postponement_migrationInputModel})">
|
||||
<summary>
|
||||
Update multiple item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationController.RefreshAutoField">
|
||||
<summary>
|
||||
Refresh AutoField of all items
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_normalController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_normalController},TodoAPI2.Models.Ieva_adjust_postponement_normalService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
@@ -3763,6 +3999,14 @@
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_migrationViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_migrationController},TodoAPI2.Models.Ieva_adjust_postponement_migrationService,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.eva_adjust_postponement_normalViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_normalController},TodoAPI2.Models.Ieva_adjust_postponement_normalService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
var eva_adjust_postponement_detail_migration_editMode = "CREATE";
|
||||
var eva_adjust_postponement_detail_migration_API = "/api/eva_adjust_postponement_detail_migration/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GetSearchParameter() {
|
||||
var eva_adjust_postponement_detail_migrationSearchObject = new Object();
|
||||
eva_adjust_postponement_detail_migrationSearchObject.adjust_postponement_id = getUrlParameter("id");
|
||||
eva_adjust_postponement_detail_migrationSearchObject.adjust_postponement_quota_id = getUrlParameter("id");
|
||||
|
||||
return eva_adjust_postponement_detail_migrationSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_postponement_detail_migration_adjust_postponement_id").val(data.adjust_postponement_id);
|
||||
$("#s_eva_adjust_postponement_detail_migration_adjust_postponement_quota_id").val(data.adjust_postponement_quota_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_detail_migration_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_detail_migration_id").val(data.id);
|
||||
$("#eva_adjust_postponement_detail_migration_adjust_postponement_id").val(data.adjust_postponement_id);
|
||||
$("#eva_adjust_postponement_detail_migration_adjust_postponement_quota_id").val(data.adjust_postponement_quota_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_detail_migration_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
$("#eva_adjust_postponement_detail_migration_sarary").val(data.sarary);
|
||||
$("#eva_adjust_postponement_detail_migration_cost_living").val(data.cost_living);
|
||||
$("#eva_adjust_postponement_detail_migration_middle").val(data.middle);
|
||||
$("#eva_adjust_postponement_detail_migration_promoted_percentage").val(data.promoted_percentage);
|
||||
$("#eva_adjust_postponement_detail_migration_total_promote").val(data.total_promote);
|
||||
$("#eva_adjust_postponement_detail_migration_new_sarary").val(data.new_sarary);
|
||||
$("#eva_adjust_postponement_detail_migration_new_cost_living").val(data.new_cost_living);
|
||||
$("#eva_adjust_postponement_detail_migration_remark").val(data.remark);
|
||||
$("#eva_adjust_postponement_detail_migration_receive_quota").val(data.receive_quota);
|
||||
$("#eva_adjust_postponement_detail_migration_new_sarary_with_quota").val(data.new_sarary_with_quota);
|
||||
$("#eva_adjust_postponement_detail_migration_position_this_time").val(data.position_this_time);
|
||||
$("#eva_adjust_postponement_detail_migration_level_this_time").val(data.level_this_time);
|
||||
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GetFromForm() {
|
||||
var eva_adjust_postponement_detail_migrationObject = new Object();
|
||||
eva_adjust_postponement_detail_migrationObject.id = $("#eva_adjust_postponement_detail_migration_id").val();
|
||||
eva_adjust_postponement_detail_migrationObject.adjust_postponement_id = $("#eva_adjust_postponement_detail_migration_adjust_postponement_id").val();
|
||||
eva_adjust_postponement_detail_migrationObject.adjust_postponement_quota_id = $("#eva_adjust_postponement_detail_migration_adjust_postponement_quota_id").val();
|
||||
eva_adjust_postponement_detail_migrationObject.employee_id = $("#eva_adjust_postponement_detail_migration_employee_id").val();
|
||||
eva_adjust_postponement_detail_migrationObject.sarary = $("#eva_adjust_postponement_detail_migration_sarary").val();
|
||||
eva_adjust_postponement_detail_migrationObject.cost_living = $("#eva_adjust_postponement_detail_migration_cost_living").val();
|
||||
eva_adjust_postponement_detail_migrationObject.middle = $("#eva_adjust_postponement_detail_migration_middle").val();
|
||||
eva_adjust_postponement_detail_migrationObject.promoted_percentage = $("#eva_adjust_postponement_detail_migration_promoted_percentage").val();
|
||||
eva_adjust_postponement_detail_migrationObject.total_promote = $("#eva_adjust_postponement_detail_migration_total_promote").val();
|
||||
eva_adjust_postponement_detail_migrationObject.new_sarary = $("#eva_adjust_postponement_detail_migration_new_sarary").val();
|
||||
eva_adjust_postponement_detail_migrationObject.new_cost_living = $("#eva_adjust_postponement_detail_migration_new_cost_living").val();
|
||||
eva_adjust_postponement_detail_migrationObject.remark = $("#eva_adjust_postponement_detail_migration_remark").val();
|
||||
eva_adjust_postponement_detail_migrationObject.receive_quota = $("#eva_adjust_postponement_detail_migration_receive_quota").val();
|
||||
eva_adjust_postponement_detail_migrationObject.new_sarary_with_quota = $("#eva_adjust_postponement_detail_migration_new_sarary_with_quota").val();
|
||||
eva_adjust_postponement_detail_migrationObject.position_this_time = $("#eva_adjust_postponement_detail_migration_position_this_time").val();
|
||||
eva_adjust_postponement_detail_migrationObject.level_this_time = $("#eva_adjust_postponement_detail_migration_level_this_time").val();
|
||||
|
||||
|
||||
return eva_adjust_postponement_detail_migrationObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_detail_migration_FeedDataToForm(result);
|
||||
eva_adjust_postponement_detail_migration_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_postponement_detail_migrationModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_detail_migration_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_detail_migration_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_detail_migrationView/eva_adjust_postponement_detail_migration_d");
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GoEdit(a) {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_detail_migration_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_detail_migrationView/eva_adjust_postponement_detail_migration_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_detail_migration_editMode = "UPDATE";
|
||||
eva_adjust_postponement_detail_migration_FeedDataToForm(result);
|
||||
$("#eva_adjust_postponement_detail_migrationModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_detail_migration_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_SetCreateForm(s) {
|
||||
eva_adjust_postponement_detail_migration_editMode = "CREATE";
|
||||
eva_adjust_postponement_detail_migration_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_detail_migration_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_postponement_detail_migration_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_adjust_postponement_detail_migration_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_detail_migration_PutUpdate() {
|
||||
if (!ValidateForm('eva_adjust_postponement_detail_migration', eva_adjust_postponement_detail_migration_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_postponement_detail_migration_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_postponement_detail_migration_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_postponement_detail_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_detail_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_postponement_detail_migration_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_postponement_detail_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_detail_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_postponement_detail_migration_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_postponement_detail_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_detail_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_postponement_detail_migration_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_postponement_detail_migrationTableV;
|
||||
|
||||
var eva_adjust_postponement_detail_migration_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_postponement_detail_migrationTableV = $('#eva_adjust_postponement_detail_migrationTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "sarary" },
|
||||
{ "data": "cost_living" },
|
||||
{ "data": "middle" },
|
||||
{ "data": "promoted_percentage" },
|
||||
{ "data": "total_promote" },
|
||||
{ "data": "new_sarary" },
|
||||
{ "data": "new_cost_living" },
|
||||
{ "data": "receive_quota" },
|
||||
{ "data": "new_sarary_with_quota" },
|
||||
{ "data": "remark" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_detail_migration_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_detail_migration_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 eva_adjust_postponement_detail_migration_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_postponement_detail_migration_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_migration/GetListBySearch?" + p, eva_adjust_postponement_detail_migration_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_DoSearch() {
|
||||
var p = $.param(eva_adjust_postponement_detail_migration_GetSearchParameter());
|
||||
var eva_adjust_postponement_detail_migration_reload = function (result) {
|
||||
eva_adjust_postponement_detail_migrationTableV.destroy();
|
||||
eva_adjust_postponement_detail_migration_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_migration/GetListBySearch?" + p, eva_adjust_postponement_detail_migration_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_detail_migration_GetSelect(f) {
|
||||
var eva_adjust_postponement_detail_migration_selectitem = [];
|
||||
$.each(eva_adjust_postponement_detail_migrationTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_postponement_detail_migration_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_postponement_detail_migration_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
var eva_adjust_postponement_migration_editMode = "CREATE";
|
||||
var eva_adjust_postponement_migration_API = "/api/eva_adjust_postponement_migration/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_migration_GetSearchParameter() {
|
||||
var eva_adjust_postponement_migrationSearchObject = new Object();
|
||||
eva_adjust_postponement_migrationSearchObject.fiscal_year = $("#s_eva_adjust_postponement_migration_fiscal_year").val();
|
||||
eva_adjust_postponement_migrationSearchObject.theRound = $("#s_eva_adjust_postponement_migration_theRound").val();
|
||||
|
||||
return eva_adjust_postponement_migrationSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_postponement_migration_fiscal_year").val(data.fiscal_year);
|
||||
$("#s_eva_adjust_postponement_migration_theRound").val(data.theRound);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_migration_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_migration_id").val(data.id);
|
||||
$("#eva_adjust_postponement_migration_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_adjust_postponement_migration_theDate").val(formatDate(data.theDate));
|
||||
$("#eva_adjust_postponement_migration_theRound").val(data.theRound);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_migration_create_evaluation_id"), data, "id", "performance_plan_id", "item_create_evaluation_id", data.create_evaluation_id);
|
||||
$("#eva_adjust_postponement_migration_limit").val(data.limit);
|
||||
$("#eva_adjust_postponement_migration_limit_frame").val(data.limit_frame);
|
||||
$("#eva_adjust_postponement_migration_limit_quota").val(data.limit_quota);
|
||||
$("#eva_adjust_postponement_migration_limit_frame_quota").val(data.limit_frame_quota);
|
||||
$("#eva_adjust_postponement_migration_percentage").val(data.percentage);
|
||||
$("#eva_adjust_postponement_migration_command_no").val(data.command_no);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_migration_managed_by"), data, "id", "external_name", "item_managed_by", data.managed_by);
|
||||
feedFileToControl(data.imported_file, data.imported_fileDisplay, "eva_adjust_postponement_migration_imported_file", "file");
|
||||
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GetFromForm() {
|
||||
var eva_adjust_postponement_migrationObject = new Object();
|
||||
eva_adjust_postponement_migrationObject.id = $("#eva_adjust_postponement_migration_id").val();
|
||||
eva_adjust_postponement_migrationObject.fiscal_year = $("#eva_adjust_postponement_migration_fiscal_year").val();
|
||||
eva_adjust_postponement_migrationObject.theDate = getDate($("#eva_adjust_postponement_migration_theDate").val());
|
||||
eva_adjust_postponement_migrationObject.theRound = $("#eva_adjust_postponement_migration_theRound").val();
|
||||
eva_adjust_postponement_migrationObject.create_evaluation_id = $("#eva_adjust_postponement_migration_create_evaluation_id").val();
|
||||
eva_adjust_postponement_migrationObject.limit = $("#eva_adjust_postponement_migration_limit").val();
|
||||
eva_adjust_postponement_migrationObject.limit_frame = $("#eva_adjust_postponement_migration_limit_frame").val();
|
||||
eva_adjust_postponement_migrationObject.limit_quota = $("#eva_adjust_postponement_migration_limit_quota").val();
|
||||
eva_adjust_postponement_migrationObject.limit_frame_quota = $("#eva_adjust_postponement_migration_limit_frame_quota").val();
|
||||
eva_adjust_postponement_migrationObject.percentage = $("#eva_adjust_postponement_migration_percentage").val();
|
||||
eva_adjust_postponement_migrationObject.command_no = $("#eva_adjust_postponement_migration_command_no").val();
|
||||
eva_adjust_postponement_migrationObject.managed_by = $("#eva_adjust_postponement_migration_managed_by").val();
|
||||
if ($("#eva_adjust_postponement_migration_imported_file_hidURL").val() !== null) {
|
||||
eva_adjust_postponement_migrationObject.imported_file = $("#eva_adjust_postponement_migration_imported_file_hidURL").val();
|
||||
} else {
|
||||
eva_adjust_postponement_migrationObject.imported_file = "";
|
||||
}
|
||||
|
||||
|
||||
return eva_adjust_postponement_migrationObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_migration_FeedDataToForm(result);
|
||||
eva_adjust_postponement_migration_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_postponement_migrationModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_migration_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_postponement_migration_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_migration_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_migrationView/eva_adjust_postponement_migration_d");
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GoEdit(a) {
|
||||
// Incase model popup
|
||||
//eva_adjust_postponement_migration_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
window_open(appsite + "/eva_adjust_postponement_migrationView/eva_adjust_postponement_migration_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_migration_editMode = "UPDATE";
|
||||
eva_adjust_postponement_migration_FeedDataToForm(result);
|
||||
$("#eva_adjust_postponement_migrationModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_migration_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_SetCreateForm(s) {
|
||||
eva_adjust_postponement_migration_editMode = "CREATE";
|
||||
eva_adjust_postponement_migration_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_migration_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_postponement_migration_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_adjust_postponement_migration_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_migration_PutUpdate() {
|
||||
if (!ValidateForm('eva_adjust_postponement_migration', eva_adjust_postponement_migration_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_postponement_migration_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_postponement_migration_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_postponement_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_postponement_migration_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_postponement_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_postponement_migration_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_postponement_migrationModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_postponement_migration_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_postponement_migrationTableV;
|
||||
|
||||
var eva_adjust_postponement_migration_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_postponement_migrationTableV = $('#eva_adjust_postponement_migrationTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "fiscal_year" },
|
||||
{ "data": "theRound" },
|
||||
{ "data": "limit" },
|
||||
{ "data": "limit_frame" },
|
||||
{ "data": "limit_quota" },
|
||||
{ "data": "limit_frame_quota" },
|
||||
{ "data": "percentage" },
|
||||
{ "data": "managed_by_external_linkage_external_name" },
|
||||
{ "data": "txt_imported_file" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_migration_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_migration_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 eva_adjust_postponement_migration_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_postponement_migration_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_migration/GetListBySearch?" + p, eva_adjust_postponement_migration_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_DoSearch() {
|
||||
var p = $.param(eva_adjust_postponement_migration_GetSearchParameter());
|
||||
var eva_adjust_postponement_migration_reload = function (result) {
|
||||
eva_adjust_postponement_migrationTableV.destroy();
|
||||
eva_adjust_postponement_migration_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_migration/GetListBySearch?" + p, eva_adjust_postponement_migration_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GetSelect(f) {
|
||||
var eva_adjust_postponement_migration_selectitem = [];
|
||||
$.each(eva_adjust_postponement_migrationTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_postponement_migration_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_postponement_migration_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
$('#eva_adjust_postponement_migration_imported_file_file').change(function () {
|
||||
UploadImage($('#eva_adjust_postponement_migration_imported_file_file'), 'eva_adjust_postponement_migration_imported_file');
|
||||
});
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
var eva_adjust_postponement_migration_editMode = "CREATE";
|
||||
var eva_adjust_postponement_migration_API = "/api/eva_adjust_postponement_migration/";
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_migration_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_migration_id").val(data.id);
|
||||
$("#eva_adjust_postponement_migration_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_adjust_postponement_migration_theDate").val(formatDate(data.theDate));
|
||||
$("#eva_adjust_postponement_migration_theRound").val(data.theRound);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_migration_create_evaluation_id"), data, "id", "performance_plan_id", "item_create_evaluation_id", data.create_evaluation_id);
|
||||
$("#eva_adjust_postponement_migration_limit").val(data.limit);
|
||||
$("#eva_adjust_postponement_migration_limit_frame").val(data.limit_frame);
|
||||
$("#eva_adjust_postponement_migration_limit_quota").val(data.limit_quota);
|
||||
$("#eva_adjust_postponement_migration_limit_frame_quota").val(data.limit_frame_quota);
|
||||
$("#eva_adjust_postponement_migration_percentage").val(data.percentage);
|
||||
$("#eva_adjust_postponement_migration_command_no").val(data.command_no);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_migration_managed_by"), data, "id", "fullname", "item_managed_by", data.managed_by);
|
||||
feedFileToControl(data.imported_file, data.imported_fileDisplay, "eva_adjust_postponement_migration_imported_file", "file");
|
||||
//console.log(data.item_managed_by);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GetFromForm() {
|
||||
var eva_adjust_postponement_migrationObject = new Object();
|
||||
eva_adjust_postponement_migrationObject.id = $("#eva_adjust_postponement_migration_id").val();
|
||||
eva_adjust_postponement_migrationObject.fiscal_year = $("#eva_adjust_postponement_migration_fiscal_year").val();
|
||||
eva_adjust_postponement_migrationObject.theDate = getDate($("#eva_adjust_postponement_migration_theDate").val());
|
||||
eva_adjust_postponement_migrationObject.theRound = $("#eva_adjust_postponement_migration_theRound").val();
|
||||
eva_adjust_postponement_migrationObject.create_evaluation_id = $("#eva_adjust_postponement_migration_create_evaluation_id").val();
|
||||
eva_adjust_postponement_migrationObject.limit = $("#eva_adjust_postponement_migration_limit").val();
|
||||
eva_adjust_postponement_migrationObject.limit_frame = $("#eva_adjust_postponement_migration_limit_frame").val();
|
||||
eva_adjust_postponement_migrationObject.limit_quota = $("#eva_adjust_postponement_migration_limit_quota").val();
|
||||
eva_adjust_postponement_migrationObject.limit_frame_quota = $("#eva_adjust_postponement_migration_limit_frame_quota").val();
|
||||
eva_adjust_postponement_migrationObject.percentage = $("#eva_adjust_postponement_migration_percentage").val();
|
||||
eva_adjust_postponement_migrationObject.command_no = $("#eva_adjust_postponement_migration_command_no").val();
|
||||
eva_adjust_postponement_migrationObject.managed_by = $("#eva_adjust_postponement_migration_managed_by").val();
|
||||
if ($("#eva_adjust_postponement_migration_imported_file_hidURL").val() !== null) {
|
||||
eva_adjust_postponement_migrationObject.imported_file = $("#eva_adjust_postponement_migration_imported_file_hidURL").val();
|
||||
} else {
|
||||
eva_adjust_postponement_migrationObject.imported_file = "";
|
||||
}
|
||||
|
||||
|
||||
return eva_adjust_postponement_migrationObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_migration_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_migration_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_postponement_migration_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_migration_editMode = "UPDATE";
|
||||
eva_adjust_postponement_migration_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_migration_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_SetCreateForm() {
|
||||
eva_adjust_postponement_migration_editMode = "CREATE";
|
||||
eva_adjust_postponement_migration_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_adjust_postponement_migration_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_migration_PutUpdate() {
|
||||
if (!ValidateForm('eva_adjust_postponement_migration', eva_adjust_postponement_migration_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_adjust_postponement_migration_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_postponement_migration_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_postponement_migration_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_postponement_migration_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_migration_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_migration_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_postponement_migration_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
$('#eva_adjust_postponement_migration_imported_file_file').change(function () {
|
||||
UploadImage($('#eva_adjust_postponement_migration_imported_file_file'), 'eva_adjust_postponement_migration_imported_file');
|
||||
});
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user