แก้ไขหน้า ปรับเลื่อนเงินเดือน และปรับโควต้า

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-28 13:09:50 +07:00
parent d9ca4b0aed
commit 1ca6d4955d
43 changed files with 2854 additions and 372 deletions

View File

@@ -271,47 +271,7 @@ namespace TodoAPI2.Controllers
return BadRequest(ModelState);
}
/// <summary>
/// ReCreatePostponementDetailNormal
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="adjust_postponement_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>
[HttpPut("ReCreatePostponementDetailNormal")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult ReCreatePostponementDetailNormal(int? adjust_postponement_id)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.ReCreatePostponementDetailNormal(adjust_postponement_id);
string rowCount = _repository.ReCreatePostponementDetailNormal(adjust_postponement_id);
var message = new CommonResponseMessage();
message.code = "200";
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน " + rowCount + " รายการ";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while ReCreatePostponementDetailNormal.", ex);
return StatusCode(500, $"Exception while ReCreatePostponementDetailNormal. {ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary>
/// Delete item
/// </summary>

View File

@@ -0,0 +1,355 @@
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;
namespace TodoAPI2.Controllers
{
//[Authorize]
[Produces("application/json")]
[Route("api/eva_adjust_postponement_detail_normal_02")]
public class eva_adjust_postponement_detail_normal_02Controller : BaseController
{
#region Private Variables
private ILogger<eva_adjust_postponement_detail_normal_02Controller> _logger;
private Ieva_adjust_postponement_detail_normal_02Service _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_normal_02Controller(ILogger<eva_adjust_postponement_detail_normal_02Controller> logger, Ieva_adjust_postponement_detail_normal_02Service 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_normal_02WithSelectionViewModel), 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, $"Exception in IActionResult Get. {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_normal_02WithSelectionViewModel), 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, $"Exception in IActionResult GetBlankItem. {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_normal_02ViewModel>), 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, $"Exception in IActionResult GetList. {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_normal_02ViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel 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, $"Exception in IActionResult GetListBySearch. {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_normal_02_report")]
[ProducesResponseType(typeof(FileStreamResult), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult eva_adjust_postponement_detail_normal_02_report(eva_adjust_postponement_detail_normal_02ReportRequestModel model)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var httpclient = MyHelper.getHttpClient(Configuration);
string mainurl = Configuration["JasperReportServer:MainURL"];
string url = $"{mainurl}/ro519eva/eva_adjust_postponement_detail_normal_02_report.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
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, $"Exception while GetReport. {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_normal_02InputModel 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, $"Exception while insert. {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_normal_02InputModel 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, $"Exception while update {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, $"Exception while delete {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_normal_02InputModel> 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, $"Exception while UpdateMultiple. {ex.Message}");
}
}
return BadRequest(ModelState);
}
}
}

View File

@@ -0,0 +1,355 @@
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;
namespace TodoAPI2.Controllers
{
//[Authorize]
[Produces("application/json")]
[Route("api/eva_adjust_postponement_detail_quota_02")]
public class eva_adjust_postponement_detail_quota_02Controller : BaseController
{
#region Private Variables
private ILogger<eva_adjust_postponement_detail_quota_02Controller> _logger;
private Ieva_adjust_postponement_detail_quota_02Service _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_quota_02Controller(ILogger<eva_adjust_postponement_detail_quota_02Controller> logger, Ieva_adjust_postponement_detail_quota_02Service 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_quota_02WithSelectionViewModel), 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, $"Exception in IActionResult Get. {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_quota_02WithSelectionViewModel), 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, $"Exception in IActionResult GetBlankItem. {ex.Message}");
}
}
/// <summary>
/// Get list items by adjust_postponement_quota_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_quota_02ViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetList(int? adjust_postponement_quota_id)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
return Ok(_repository.GetListByadjust_postponement_quota_id(adjust_postponement_quota_id));
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
return StatusCode(500, $"Exception in IActionResult GetList. {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_quota_02ViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetListBySearch(eva_adjust_postponement_detail_quota_02SearchModel 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, $"Exception in IActionResult GetListBySearch. {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_quota_02_report")]
[ProducesResponseType(typeof(FileStreamResult), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult eva_adjust_postponement_detail_quota_02_report(eva_adjust_postponement_detail_quota_02ReportRequestModel model)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var httpclient = MyHelper.getHttpClient(Configuration);
string mainurl = Configuration["JasperReportServer:MainURL"];
string url = $"{mainurl}/ro519eva/eva_adjust_postponement_detail_quota_02_report.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
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, $"Exception while GetReport. {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_quota_02InputModel 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, $"Exception while insert. {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_quota_02InputModel 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, $"Exception while update {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, $"Exception while delete {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_quota_02InputModel> 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, $"Exception while UpdateMultiple. {ex.Message}");
}
}
return BadRequest(ModelState);
}
}
}

View File

@@ -23,15 +23,18 @@ namespace TodoAPI2.Models
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,
IMyDatabase mydb, Iexternal_linkageService inext,
Iexternal_employeeService inemp)
Iexternal_employeeService inemp,
Ieva_adjust_postponement_detail_normalService indetail)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
detail = indetail;
}
#region Private Functions
@@ -166,9 +169,9 @@ namespace TodoAPI2.Models
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var inserted = _repository.Insert(entity);
detail.ReCreatePostponementDetailNormal(entity);
return Get(inserted.id);
}
@@ -257,6 +260,8 @@ namespace TodoAPI2.Models
}
public void Delete(int id)
{
_repository.Delete(id);
return;

View File

@@ -21,7 +21,7 @@ namespace TodoAPI2.Models
eva_adjust_postponement_detail_normalWithSelectionViewModel GetWithSelection(int id);
eva_adjust_postponement_detail_normalWithSelectionViewModel GetBlankItem();
string ReCreatePostponementDetailNormal(int? adjust_postponement_id);
string ReCreatePostponementDetailNormal(eva_adjust_postponementEntity entity);
}
}

View File

@@ -209,8 +209,10 @@ namespace TodoAPI2.Models
throw new NotificationException("No data to update");
}
public string ReCreatePostponementDetailNormal(int? adjust_postponement_id)
public string ReCreatePostponementDetailNormal(eva_adjust_postponementEntity entity)
{
int? adjust_postponement_id = entity.id;
var cylinder = (from z in _repository.Context.eva_salary_cylinder
select z).ToList();
@@ -221,17 +223,24 @@ namespace TodoAPI2.Models
select i;
_repository.Context.RemoveRange(olddata);
var adjust_postponement = (from j in _repository.Context.eva_adjust_postponement
where j.id == adjust_postponement_id
select j).FirstOrDefault();
var adjust_postponement = entity;
var current_eva_create_evaluation_detail = from k in _repository.Context.eva_create_evaluation_detail
where k.create_evaluation_id == adjust_postponement.create_evaluation_id
select k;
var evaluation_group_id = (from m in _repository.Context.eva_create_evaluation
where m.id == adjust_postponement.create_evaluation_id
select m.evaluation_group_id).FirstOrDefault();
var current_eva_evaluation_group_detail = from k in _repository.Context.eva_evaluation_group_detail
where k.evaluation_group_id == evaluation_group_id
select k;
//var current_eva_create_evaluation_detail = from k in _repository.Context.eva_create_evaluation_detail
// where k.create_evaluation_id == adjust_postponement.create_evaluation_id
// select k;
int newkey = GetNewPrimaryKey();
decimal sum_salary = 0;
foreach (var m in current_eva_create_evaluation_detail)
foreach (var m in current_eva_evaluation_group_detail)
{
var theemp = (from i in all_emp where i.id == m.employee_id select i).FirstOrDefault();
@@ -245,6 +254,7 @@ namespace TodoAPI2.Models
if (theemp.salary.HasValue)
{
n.sarary = theemp.salary;
sum_salary += n.sarary.Value;
}
else
{
@@ -272,14 +282,16 @@ namespace TodoAPI2.Models
n.created = DateTime.Now;
n.updated = DateTime.Now;
n.isActive = true;
n.isActive = true;
_repository.Context.eva_adjust_postponement_detail.Add(n);
}
_repository.Context.SaveChanges();
entity.limit = sum_salary;
return current_eva_create_evaluation_detail.Count().ToString();
//_repository.Context.SaveChanges();
return current_eva_evaluation_group_detail.Count().ToString();
}
private eva_salary_cylinderEntity getCylinderForEmployee(external_employeeViewModel theemp,
@@ -356,6 +368,11 @@ namespace TodoAPI2.Models
}
public void Delete(int id)
{
var data = from i in _repository.Context.eva_adjust_postponement_detail
where i.adjust_postponement_quota_id == null && i.adjust_postponement_id == id
select i;
_repository.Context.RemoveRange(data);
_repository.Delete(id);
return;

View File

@@ -0,0 +1,28 @@
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_normal_02Service : IBaseService<int, eva_adjust_postponement_detail_normal_02InputModel, eva_adjust_postponement_detail_normal_02ViewModel>
{
new eva_adjust_postponement_detail_normal_02ViewModel Insert(eva_adjust_postponement_detail_normal_02InputModel model);
new eva_adjust_postponement_detail_normal_02ViewModel Update(int id, eva_adjust_postponement_detail_normal_02InputModel model);
List<eva_adjust_postponement_detail_normal_02ViewModel> GetListByadjust_postponement_id(int? adjust_postponement_id);
List<eva_adjust_postponement_detail_normal_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel model);
string UpdateMultiple(List<eva_adjust_postponement_detail_normal_02InputModel> model);
eva_adjust_postponement_detail_normal_02WithSelectionViewModel GetWithSelection(int id);
eva_adjust_postponement_detail_normal_02WithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,56 @@
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_normal_02InputModel
{
public int? id { get; set; }
public int? adjust_postponement_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 string emp_code { get; set; }
public string emp_fullname { get; set; }
public string emp_position { get; set; }
public string emp_level { get; set; }
public decimal? total_score { get; set; }
public string eva_result { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_adjust_postponement_detail_normal_02ReportRequestModel : eva_adjust_postponement_detail_normal_02SearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,23 @@
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_normal_02SearchModel
{
public int id { get; set; }
public int? adjust_postponement_id { get; set; }
}
}

View File

@@ -0,0 +1,284 @@
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_normal_02Service : Ieva_adjust_postponement_detail_normal_02Service
{
private IBaseRepository2<eva_adjust_postponement_detailEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
public eva_adjust_postponement_detail_normal_02Service(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_normal_02InputModel model)
{
return Mapper.Map<eva_adjust_postponement_detailEntity>(model);
}
private List<eva_adjust_postponement_detailEntity> GetEntityList(List<eva_adjust_postponement_detail_normal_02InputModel> models)
{
return Mapper.Map<List<eva_adjust_postponement_detailEntity>>(models);
}
private eva_adjust_postponement_detail_normal_02ViewModel GetDto(eva_adjust_postponement_detailEntity entity)
{
return Mapper.Map<eva_adjust_postponement_detail_normal_02ViewModel>(entity);
}
private List<eva_adjust_postponement_detail_normal_02ViewModel> GetDtoList(List<eva_adjust_postponement_detailEntity> entities)
{
return Mapper.Map<List<eva_adjust_postponement_detail_normal_02ViewModel>>(entities);
}
#endregion
#region Public Functions
#region Query Functions
public eva_adjust_postponement_detail_normal_02ViewModel Get(int id)
{
var entity = _repository.Get(id);
return GetDto(entity);
}
public eva_adjust_postponement_detail_normal_02WithSelectionViewModel GetWithSelection(int id)
{
var entity = _repository.Get(id);
var i = Mapper.Map<eva_adjust_postponement_detail_normal_02WithSelectionViewModel>(entity);
return i;
}
public eva_adjust_postponement_detail_normal_02WithSelectionViewModel GetBlankItem()
{
var i = new eva_adjust_postponement_detail_normal_02WithSelectionViewModel();
return i;
}
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListByadjust_postponement_id(int? adjust_postponement_id)
{
var model = new eva_adjust_postponement_detail_normal_02SearchModel();
model.adjust_postponement_id = adjust_postponement_id;
return GetListBySearch(model);
}
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel model)
{
var all_emp = emp.GetListByemployee_type(null, null);
var data = (
from m_eva_adjust_postponement_detail_normal_02 in _repository.Context.eva_adjust_postponement_detail
join fk_eva_adjust_postponement1 in _repository.Context.eva_adjust_postponement on m_eva_adjust_postponement_detail_normal_02.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_external_linkage2 in all_emp on m_eva_adjust_postponement_detail_normal_02.employee_id equals fk_external_linkage2.id
into external_linkageResult2
from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty()
join create_detail in _repository.Context.eva_create_evaluation_detail
on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
into create_detailResult
from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
where 1==1
//&& (m_eva_adjust_postponement_detail_normal_02.id == model.id || !model.id.HasValue)
&& (m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id == model.adjust_postponement_id || !model.adjust_postponement_id.HasValue)
&& fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id
orderby m_eva_adjust_postponement_detail_normal_02.created descending
select new eva_adjust_postponement_detail_normal_02ViewModel()
{
id = m_eva_adjust_postponement_detail_normal_02.id,
adjust_postponement_id = m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id,
employee_id = m_eva_adjust_postponement_detail_normal_02.employee_id,
sarary = m_eva_adjust_postponement_detail_normal_02.sarary,
cost_living = m_eva_adjust_postponement_detail_normal_02.cost_living,
middle = m_eva_adjust_postponement_detail_normal_02.middle,
promoted_percentage = m_eva_adjust_postponement_detail_normal_02.promoted_percentage,
total_promote = m_eva_adjust_postponement_detail_normal_02.total_promote,
new_sarary = m_eva_adjust_postponement_detail_normal_02.new_sarary,
new_cost_living = m_eva_adjust_postponement_detail_normal_02.new_cost_living,
remark = m_eva_adjust_postponement_detail_normal_02.remark,
emp_code = fk_external_linkageResult2.employee_no,
emp_fullname = fk_external_linkageResult2.fullname,
emp_position = fk_external_linkageResult2.position_name,
emp_level = fk_external_linkageResult2.position_level_text,
total_score = fk_create_detailResult.score_supervisor,
eva_result = fk_create_detailResult.level_score_supervisor,
adjust_postponement_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
isActive = m_eva_adjust_postponement_detail_normal_02.isActive,
Created = m_eva_adjust_postponement_detail_normal_02.created,
Updated = m_eva_adjust_postponement_detail_normal_02.updated
}
).Take(100).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_normal_02ViewModel Insert(eva_adjust_postponement_detail_normal_02InputModel model)
{
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var inserted = _repository.Insert(entity);
return Get(inserted.id);
}
public eva_adjust_postponement_detail_normal_02ViewModel Update(int id, eva_adjust_postponement_detail_normal_02InputModel model)
{
var existingEntity = _repository.Get(id);
if (existingEntity != null)
{
//existingEntity.adjust_postponement_id = model.adjust_postponement_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.emp_code = model.emp_code;
//existingEntity.emp_fullname = model.emp_fullname;
//existingEntity.emp_position = model.emp_position;
//existingEntity.emp_level = model.emp_level;
//existingEntity.total_score = model.total_score;
//existingEntity.eva_result = model.eva_result;
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_normal_02InputModel> 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.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.emp_code = i.emp_code;
//existingEntity.emp_fullname = i.emp_fullname;
//existingEntity.emp_position = i.emp_position;
//existingEntity.emp_level = i.emp_level;
//existingEntity.total_score = i.total_score;
//existingEntity.eva_result = i.eva_result;
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
}
else if (i.active_mode == "1" && !i.id.HasValue) // add
{
var entity = GetEntity(i);
entity.id = GetNewPrimaryKey();
_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_normal_02ViewModel SetAsActive(int id)
{
var updated = _repository.SetAsActive(id);
return Get(updated.id);
}
public eva_adjust_postponement_detail_normal_02ViewModel SetAsInactive(int id)
{
var updated = _repository.SetAsInActive(id);
return Get(updated.id);
}
public void Delete(int id)
{
_repository.Delete(id);
return;
}
#endregion
#region Match Item
#endregion
#endregion
}
}

View File

@@ -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_normal_02ViewModel : BaseViewModel2<int>
{
public int? adjust_postponement_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 string emp_code { get; set; }
public string emp_fullname { get; set; }
public string emp_position { get; set; }
public string emp_level { get; set; }
public decimal? total_score { get; set; }
public string eva_result { get; set; }
public int? adjust_postponement_id_eva_adjust_postponement_fiscal_year { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class eva_adjust_postponement_detail_normal_02WithSelectionViewModel: eva_adjust_postponement_detail_normal_02ViewModel
{
}
}

View File

@@ -0,0 +1,28 @@
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_quota_02Service : IBaseService<int, eva_adjust_postponement_detail_quota_02InputModel, eva_adjust_postponement_detail_quota_02ViewModel>
{
new eva_adjust_postponement_detail_quota_02ViewModel Insert(eva_adjust_postponement_detail_quota_02InputModel model);
new eva_adjust_postponement_detail_quota_02ViewModel Update(int id, eva_adjust_postponement_detail_quota_02InputModel model);
List<eva_adjust_postponement_detail_quota_02ViewModel> GetListByadjust_postponement_quota_id(int? adjust_postponement_quota_id);
List<eva_adjust_postponement_detail_quota_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_quota_02SearchModel model);
string UpdateMultiple(List<eva_adjust_postponement_detail_quota_02InputModel> model);
eva_adjust_postponement_detail_quota_02WithSelectionViewModel GetWithSelection(int id);
eva_adjust_postponement_detail_quota_02WithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,58 @@
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_quota_02InputModel
{
public int? 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 emp_code { get; set; }
public string emp_fullname { get; set; }
public string emp_position { get; set; }
public string emp_level { get; set; }
public decimal? total_score { get; set; }
public string eva_result { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_adjust_postponement_detail_quota_02ReportRequestModel : eva_adjust_postponement_detail_quota_02SearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,23 @@
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_quota_02SearchModel
{
public int id { get; set; }
public int? adjust_postponement_quota_id { get; set; }
}
}

View File

@@ -0,0 +1,290 @@
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_quota_02Service : Ieva_adjust_postponement_detail_quota_02Service
{
private IBaseRepository2<eva_adjust_postponement_detailEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
public eva_adjust_postponement_detail_quota_02Service(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_quota_02InputModel model)
{
return Mapper.Map<eva_adjust_postponement_detailEntity>(model);
}
private List<eva_adjust_postponement_detailEntity> GetEntityList(List<eva_adjust_postponement_detail_quota_02InputModel> models)
{
return Mapper.Map<List<eva_adjust_postponement_detailEntity>>(models);
}
private eva_adjust_postponement_detail_quota_02ViewModel GetDto(eva_adjust_postponement_detailEntity entity)
{
return Mapper.Map<eva_adjust_postponement_detail_quota_02ViewModel>(entity);
}
private List<eva_adjust_postponement_detail_quota_02ViewModel> GetDtoList(List<eva_adjust_postponement_detailEntity> entities)
{
return Mapper.Map<List<eva_adjust_postponement_detail_quota_02ViewModel>>(entities);
}
#endregion
#region Public Functions
#region Query Functions
public eva_adjust_postponement_detail_quota_02ViewModel Get(int id)
{
var entity = _repository.Get(id);
return GetDto(entity);
}
public eva_adjust_postponement_detail_quota_02WithSelectionViewModel GetWithSelection(int id)
{
var entity = _repository.Get(id);
var i = Mapper.Map<eva_adjust_postponement_detail_quota_02WithSelectionViewModel>(entity);
return i;
}
public eva_adjust_postponement_detail_quota_02WithSelectionViewModel GetBlankItem()
{
var i = new eva_adjust_postponement_detail_quota_02WithSelectionViewModel();
return i;
}
public List<eva_adjust_postponement_detail_quota_02ViewModel> GetListByadjust_postponement_quota_id(int? adjust_postponement_quota_id)
{
var model = new eva_adjust_postponement_detail_quota_02SearchModel();
model.adjust_postponement_quota_id = adjust_postponement_quota_id;
return GetListBySearch(model);
}
public List<eva_adjust_postponement_detail_quota_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_quota_02SearchModel model)
{
var all_emp = emp.GetListByemployee_type(null, null);
var data = (
from m_eva_adjust_postponement_detail_quota_02 in _repository.Context.eva_adjust_postponement_detail
join fk_eva_adjust_postponement1 in _repository.Context.eva_adjust_postponement on m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id equals fk_eva_adjust_postponement1.id
into eva_adjust_postponementResult1
from fk_eva_adjust_postponementResult1 in eva_adjust_postponementResult1.DefaultIfEmpty()
join fk_external_linkage2 in all_emp on m_eva_adjust_postponement_detail_quota_02.employee_id equals fk_external_linkage2.id
into external_linkageResult2
from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty()
join create_detail in _repository.Context.eva_create_evaluation_detail
on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
into create_detailResult
from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
where 1==1
//&& (m_eva_adjust_postponement_detail_quota_02.id == model.id || !model.id.HasValue)
&& (m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id == model.adjust_postponement_quota_id || !model.adjust_postponement_quota_id.HasValue)
orderby m_eva_adjust_postponement_detail_quota_02.created descending
select new eva_adjust_postponement_detail_quota_02ViewModel()
{
id = m_eva_adjust_postponement_detail_quota_02.id,
adjust_postponement_quota_id = m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id,
employee_id = m_eva_adjust_postponement_detail_quota_02.employee_id,
sarary = m_eva_adjust_postponement_detail_quota_02.sarary,
cost_living = m_eva_adjust_postponement_detail_quota_02.cost_living,
middle = m_eva_adjust_postponement_detail_quota_02.middle,
promoted_percentage = m_eva_adjust_postponement_detail_quota_02.promoted_percentage,
total_promote = m_eva_adjust_postponement_detail_quota_02.total_promote,
new_sarary = m_eva_adjust_postponement_detail_quota_02.new_sarary,
new_cost_living = m_eva_adjust_postponement_detail_quota_02.new_cost_living,
remark = m_eva_adjust_postponement_detail_quota_02.remark,
receive_quota = m_eva_adjust_postponement_detail_quota_02.receive_quota,
new_sarary_with_quota = m_eva_adjust_postponement_detail_quota_02.new_sarary_with_quota,
emp_code = fk_external_linkageResult2.employee_no,
emp_fullname = fk_external_linkageResult2.fullname,
emp_position = fk_external_linkageResult2.position_name,
emp_level = fk_external_linkageResult2.position_level_text,
total_score = fk_create_detailResult.score_supervisor,
eva_result = fk_create_detailResult.level_score_supervisor,
adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
isActive = m_eva_adjust_postponement_detail_quota_02.isActive,
Created = m_eva_adjust_postponement_detail_quota_02.created,
Updated = m_eva_adjust_postponement_detail_quota_02.updated
}
).Take(100).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_quota_02ViewModel Insert(eva_adjust_postponement_detail_quota_02InputModel model)
{
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var inserted = _repository.Insert(entity);
return Get(inserted.id);
}
public eva_adjust_postponement_detail_quota_02ViewModel Update(int id, eva_adjust_postponement_detail_quota_02InputModel model)
{
var existingEntity = _repository.Get(id);
if (existingEntity != null)
{
//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.emp_code = model.emp_code;
//existingEntity.emp_fullname = model.emp_fullname;
//existingEntity.emp_position = model.emp_position;
//existingEntity.emp_level = model.emp_level;
//existingEntity.total_score = model.total_score;
//existingEntity.eva_result = model.eva_result;
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_quota_02InputModel> 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_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.emp_code = i.emp_code;
//existingEntity.emp_fullname = i.emp_fullname;
//existingEntity.emp_position = i.emp_position;
//existingEntity.emp_level = i.emp_level;
//existingEntity.total_score = i.total_score;
//existingEntity.eva_result = i.eva_result;
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
}
else if (i.active_mode == "1" && !i.id.HasValue) // add
{
var entity = GetEntity(i);
entity.id = GetNewPrimaryKey();
_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_quota_02ViewModel SetAsActive(int id)
{
var updated = _repository.SetAsActive(id);
return Get(updated.id);
}
public eva_adjust_postponement_detail_quota_02ViewModel SetAsInactive(int id)
{
var updated = _repository.SetAsInActive(id);
return Get(updated.id);
}
public void Delete(int id)
{
_repository.Delete(id);
return;
}
#endregion
#region Match Item
#endregion
#endregion
}
}

View File

@@ -0,0 +1,56 @@
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_quota_02ViewModel : BaseViewModel2<int>
{
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 emp_code { get; set; }
public string emp_fullname { get; set; }
public string emp_position { get; set; }
public string emp_level { get; set; }
public decimal? total_score { get; set; }
public string eva_result { get; set; }
public int? adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class eva_adjust_postponement_detail_quota_02WithSelectionViewModel: eva_adjust_postponement_detail_quota_02ViewModel
{
}
}

View File

@@ -37,6 +37,8 @@ namespace TodoAPI2.Models
//public int? org_id { get; set; }
public string active_mode { get; set; }
public List<eva_adjust_postponement_detail_normal_02InputModel> eva_adjust_postponement_detail_normal_02_model;
}
}

View File

@@ -24,17 +24,23 @@ namespace TodoAPI2.Models
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
private Ieva_create_evaluationService create;
private Ieva_adjust_postponement_detail_normalService detail;
private Ieva_adjust_postponement_detail_normal_02Service normal02;
public eva_adjust_postponement_normalService(IBaseRepository2<eva_adjust_postponementEntity, int> repository, IMyDatabase mydb,
Iexternal_linkageService inext,
Iexternal_employeeService inemp,
Ieva_create_evaluationService increate)
Ieva_create_evaluationService increate,
Ieva_adjust_postponement_detail_normalService indetail,
Ieva_adjust_postponement_detail_normal_02Service innormal02)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
create = increate;
detail = indetail;
normal02 = innormal02;
}
#region Private Functions
@@ -186,10 +192,10 @@ namespace TodoAPI2.Models
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
detail.ReCreatePostponementDetailNormal(entity);
var inserted = _repository.Insert(entity);
var inserted = _repository.Insert(entity);
return Get(inserted.id);
}
@@ -209,6 +215,7 @@ namespace TodoAPI2.Models
existingEntity.managed_by = model.managed_by;
//existingEntity.org_id = model.org_id;
normal02.UpdateMultiple(model.eva_adjust_postponement_detail_normal_02_model);
var updated = _repository.Update(id, existingEntity);
return Get(updated.id);
@@ -275,6 +282,11 @@ namespace TodoAPI2.Models
}
public void Delete(int id)
{
var details = from i in _repository.Context.eva_adjust_postponement_detail
where i.adjust_postponement_id == id
select i;
_repository.Context.eva_adjust_postponement_detail.RemoveRange(details);
_repository.Delete(id);
return;

View File

@@ -31,6 +31,8 @@ namespace TodoAPI2.Models
public int? managed_by { get; set; }
public string active_mode { get; set; }
public List<eva_adjust_postponement_detail_quota_02InputModel> adjust_postponement_detail_quota_02_model;
}
}

View File

@@ -23,14 +23,17 @@ namespace TodoAPI2.Models
private IMyDatabase db;
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
private Ieva_adjust_postponement_detail_quota_02Service quota02;
public eva_adjust_postponement_quotaService(IBaseRepository2<eva_adjust_postponementEntity, int> repository, IMyDatabase mydb,
Iexternal_linkageService inext, Iexternal_employeeService inemp)
Iexternal_linkageService inext, Iexternal_employeeService inemp,
Ieva_adjust_postponement_detail_quota_02Service inquota02)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
quota02 = inquota02;
}
#region Private Functions
@@ -147,18 +150,159 @@ namespace TodoAPI2.Models
return newkey.Value;
}
public int GetNewPrimaryKeyDetail()
{
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_quotaViewModel Insert(eva_adjust_postponement_quotaInputModel model)
{
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var all_emp = (from i in emp.GetListByemployee_type(null, null) select i.id).ToList();
AddMultipleDetail(entity.id, all_emp, entity.fiscal_year, entity.theRound);
var inserted = _repository.Insert(entity);
return Get(inserted.id);
}
public string AddMultipleDetail(int? adjust_postponement_quota_id, List<int> model, int? fiscal_year, int? theRound)
{
if (!adjust_postponement_quota_id.HasValue)
{
return "0";
}
else
{
int k = 0;
var all_emp = emp.GetListByemployee_type(null, null);
var cylinder = (from z in _repository.Context.eva_salary_cylinder
select z).ToList();
int newkey = GetNewPrimaryKeyDetail();
var ex = (from x in _repository.Context.eva_adjust_postponement_detail
where x.adjust_postponement_quota_id == adjust_postponement_quota_id
select x.employee_id).ToList();
decimal sum_salary = 0;
foreach (var i in model)
{
if (checkExistEmployeeInExternal(i, all_emp))
{
if (!checkExistEmployeeInInternal(i, ex))
{
var q = (from p in _repository.Context.eva_adjust_postponement_detail
where p.employee_id == i
&& p.eva_adjust_postponement.fiscal_year == fiscal_year
&& p.eva_adjust_postponement.theRound == theRound
select p).FirstOrDefault();
if (q != null)
{
q.adjust_postponement_quota_id = adjust_postponement_quota_id;
q.updated = DateTime.Now;
q.isActive = true;
k++;
}
else
{
var theemp = (from x in all_emp where x.id == i select x).FirstOrDefault();
var r = new eva_adjust_postponement_detailEntity();
r.id = newkey;
r.adjust_postponement_id = null;
r.adjust_postponement_quota_id = adjust_postponement_quota_id;
r.employee_id = i;
if (theemp.salary.HasValue)
{
r.sarary = theemp.salary;
sum_salary += r.sarary.Value;
}
else
{
r.sarary = 0;
}
var c = getCylinderForEmployee(theemp, cylinder);
r.cost_living = 0;
r.middle = 0;
if (c != null)
{
r.middle = c.middle;
r.cost_living = c.cost_living;
}
r.promoted_percentage = 0;
r.total_promote = 0;
r.new_sarary = r.sarary;
r.new_cost_living = r.cost_living;
r.remark = null;
r.receive_quota = 0;
r.new_sarary_with_quota = r.sarary;
r.created = DateTime.Now;
r.updated = DateTime.Now;
r.isActive = true;
_repository.Context.Add(r);
newkey++;
}
}
}
}
//_repository.Context.SaveChanges();
return k.ToString();
}
}
private eva_salary_cylinderEntity getCylinderForEmployee(external_employeeViewModel theemp,
List<eva_salary_cylinderEntity> all_cylinder)
{
var c = (from i in all_cylinder
where i.position_level == theemp.position_level_id
&& i.position_type == theemp.position_type_id
select i).FirstOrDefault();
return c;
}
private bool checkExistEmployeeInExternal(int emp_id, List<external_employeeViewModel> emp)
{
foreach (var i in emp)
{
if (i.id == emp_id) return true;
}
return false;
}
private bool checkExistEmployeeInInternal(int emp_id, List<int?> ex)
{
foreach (var i in ex)
{
if (i.Value == emp_id) return true;
}
return false;
}
public eva_adjust_postponement_quotaViewModel Update(int id, eva_adjust_postponement_quotaInputModel model)
{
var existingEntity = _repository.Get(id);
@@ -172,6 +316,7 @@ namespace TodoAPI2.Models
existingEntity.command_no = model.command_no;
existingEntity.managed_by = model.managed_by;
quota02.UpdateMultiple(model.adjust_postponement_detail_quota_02_model);
var updated = _repository.Update(id, existingEntity);
return Get(updated.id);
@@ -235,6 +380,11 @@ namespace TodoAPI2.Models
}
public void Delete(int id)
{
var data = from i in _repository.Context.eva_adjust_postponement_detail
where i.adjust_postponement_quota_id == id && i.adjust_postponement_id == null
select i;
_repository.Context.RemoveRange(data);
_repository.Delete(id);
return;

View File

@@ -118,6 +118,11 @@ and opd.deleted_at is null and htm.deleted_at is null;
i.position_level_id = Convert.ToInt32(dr["department_id"]);
i.position_level_text = dr["position_level_name"].ToString();
}
i.salary = 0;
if (dr["salary"] != DBNull.Value)
{
i.salary = Convert.ToDecimal(dr["salary"]);
}
result.Add(i);
}

View File

@@ -264,6 +264,10 @@ namespace Test01
services.AddScoped<Iexternal_competencyService, external_competencyService>();
services.AddScoped<Ieva_adjust_postponement_detail_normal_02Service, eva_adjust_postponement_detail_normal_02Service>();
services.AddScoped<Ieva_adjust_postponement_detail_quota_02Service, eva_adjust_postponement_detail_quota_02Service>();
#endregion
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
@@ -447,7 +451,13 @@ namespace Test01
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quotaViewModel>();
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quotaWithSelectionViewModel>();
cfg.CreateMap<eva_adjust_postponement_detail_normal_02InputModel, eva_adjust_postponement_detailEntity>();
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normal_02ViewModel>();
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_normal_02WithSelectionViewModel>();
cfg.CreateMap<eva_adjust_postponement_detail_quota_02InputModel, eva_adjust_postponement_detailEntity>();
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quota_02ViewModel>();
cfg.CreateMap<eva_adjust_postponement_detailEntity, eva_adjust_postponement_detail_quota_02WithSelectionViewModel>();
});
#endregion

View File

@@ -0,0 +1,83 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewData["Title"] = "eva_adjust_postponement_detail_normal_02";
}
<section class="wrapper">
<div class="row">
<div class="col-sm-12">
<section class="card">
<header class="card-header">
จัดการ eva_adjust_postponement_detail_normal_02
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
</span>
</header>
<div class="card-body">
<div style="padding-bottom:20px">
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_detail_normal_02_Add()">
<i class="fa fa-plus" style="color:white;"></i> เพิ่มรายการ
</button>
</div>
<table id="eva_adjust_postponement_detail_normal_02Table" class="display table table-bordered table-striped">
<thead>
<tr>
<th>ลำดับ</th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_id'>รหัสอ้างอิง</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_adjust_postponement_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_employee_id'>ผู้รับการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_remark'>หมายเหตุ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_eva_result'>ผลการประเมิน</label></th>
<th>กิจกรรม</th>
</tr>
</thead>
<tbody class="thin-border-bottom" id="eva_adjust_postponement_detail_normal_02Body"></tbody>
</table>
<div style="text-align:right; padding-bottom:20px">
<label id="score_label">Total Score: 0</label>
</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_normal_02_Save(getUrlParameter('id'))">บันทึก</button>
</div>
</div>
</section>
</div>
</div>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js"></script>
<script>
$(document).ready(function () {
//var id = getUrlParameter("id");
//if (id) {
// eva_adjust_postponement_detail_normal_02_InitialForm(id);
//}
eva_adjust_postponement_detail_normal_02_InitialForm('');
});
$(document).on("change", ".input_score", function () {
eva_adjust_postponement_detail_normal_02_Summary();
});
</script>
}

View File

@@ -0,0 +1,85 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewData["Title"] = "eva_adjust_postponement_detail_quota_02";
}
<section class="wrapper">
<div class="row">
<div class="col-sm-12">
<section class="card">
<header class="card-header">
จัดการ eva_adjust_postponement_detail_quota_02
<span class="tools pull-right">
<a href="javascript:;" class="fa fa-chevron-down"></a>
</span>
</header>
<div class="card-body">
<div style="padding-bottom:20px">
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_detail_quota_02_Add()">
<i class="fa fa-plus" style="color:white;"></i> เพิ่มรายการ
</button>
</div>
<table id="eva_adjust_postponement_detail_quota_02Table" class="display table table-bordered table-striped">
<thead>
<tr>
<th>ลำดับ</th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_id'>รหัสอ้างอิง</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id'>รหัสอ้างอิงตาราง eva_adjust_postponement</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_employee_id'>ผู้รับการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_remark'>หมายเหตุ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_eva_result'>ผลการประเมิน</label></th>
<th>กิจกรรม</th>
</tr>
</thead>
<tbody class="thin-border-bottom" id="eva_adjust_postponement_detail_quota_02Body"></tbody>
</table>
<div style="text-align:right; padding-bottom:20px">
<label id="score_label">Total Score: 0</label>
</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_quota_02_Save(getUrlParameter('id'))">บันทึก</button>
</div>
</div>
</section>
</div>
</div>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js"></script>
<script>
$(document).ready(function () {
//var id = getUrlParameter("id");
//if (id) {
// eva_adjust_postponement_detail_quota_02_InitialForm(id);
//}
eva_adjust_postponement_detail_quota_02_InitialForm('');
});
$(document).on("change", ".input_score", function () {
eva_adjust_postponement_detail_quota_02_Summary();
});
</script>
}

View File

@@ -46,29 +46,12 @@
<select class="form-control" id="eva_adjust_postponement_normal_create_evaluation_id" iLabel="กลุ่มการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_normal"></select>
</div>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit" for="eva_adjust_postponement_normal_limit">บริหารวงเงิน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit" iLabel="บริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit_frame" for="eva_adjust_postponement_normal_limit_frame">กรอบวงเงินร้อยละ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_normal_limit" iLabel="บริหารวงเงิน" iRequire="false" iGroup="eva_adjust_postponement_normal" />
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_normal_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_normal" />
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงิน" iRequire="false" iGroup="eva_adjust_postponement_normal" />
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_normal_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="false" iGroup="eva_adjust_postponement_normal" />
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit_quota" for="eva_adjust_postponement_normal_limit_quota">จำนวนเงินที่สามารถบริหารวงเงิน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_percentage" for="eva_adjust_postponement_normal_percentage">ร้อยละที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
</div>
</div>
</div>

View File

@@ -5,81 +5,6 @@
Layout = "_LayoutDirect";
}
<div class="modal fade" id="eva_adjust_postponement_detail_normalModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_detail_normalModelLabel" 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_normalModelLabel">บันทึกข้อมูล การปรับเลื่อนค่าตอบแทน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</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_normal_id" />
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_adjust_postponement_id" />
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_employee_id" for="eva_adjust_postponement_detail_normal_employee_id">ผู้รับการประเมิน</label>
<select class="form-control" id="eva_adjust_postponement_detail_normal_employee_id" iLabel="ผู้รับการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_detail_normal"></select>
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_sarary" for="eva_adjust_postponement_detail_normal_sarary">เงินเดือน ก่อนปรับเลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_sarary" iLabel="เงินเดือน ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_cost_living" for="eva_adjust_postponement_detail_normal_cost_living">ค่าครองชีพ ก่อนปรับเลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_cost_living" iLabel="ค่าครองชีพ ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_middle" for="eva_adjust_postponement_detail_normal_middle">ค่ากลางฐานในการคำนวณ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_middle" iLabel="ค่ากลางฐานในการคำนวณ" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_promoted_percentage" for="eva_adjust_postponement_detail_normal_promoted_percentage">ร้อยละที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_promoted_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_total_promote" for="eva_adjust_postponement_detail_normal_total_promote">จำนวนเงินที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_total_promote" iLabel="จำนวนเงินที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_new_sarary" for="eva_adjust_postponement_detail_normal_new_sarary">เงินเดือนใหม่</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_new_sarary" iLabel="เงินเดือนใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_normal_new_cost_living" for="eva_adjust_postponement_detail_normal_new_cost_living">ค่าครองชีพใหม่</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_new_cost_living" iLabel="ค่าครองชีพใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_adjust_postponement_detail_normal_remark" for="eva_adjust_postponement_detail_normal_remark">หมายเหตุ</label>
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_detail_normal_remark" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_postponement_detail_normal"></textarea>
</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_normal_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
@@ -125,35 +50,39 @@
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_managed_by" for="eva_adjust_postponement_normal_managed_by">ผู้จัดทำข้อมูล</label>
<select class="form-control" id="eva_adjust_postponement_normal_managed_by" iLabel="ผู้จัดทำข้อมูล" iRequire="true" iGroup="eva_adjust_postponement_normal"></select>
<select disabled class="form-control" id="eva_adjust_postponement_normal_managed_by" iLabel="ผู้จัดทำข้อมูล" iRequire="true" iGroup="eva_adjust_postponement_normal"></select>
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_create_evaluation_id" for="eva_adjust_postponement_normal_create_evaluation_id">กลุ่มการประเมิน</label>
<select class="form-control" id="eva_adjust_postponement_normal_create_evaluation_id" iLabel="กลุ่มการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_normal"></select>
<select disabled class="form-control" id="eva_adjust_postponement_normal_create_evaluation_id" iLabel="กลุ่มการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_normal"></select>
</div>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit" for="eva_adjust_postponement_normal_limit">บริหารวงเงิน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit" iLabel="บริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
<input disabled class="form-control" type="number" id="eva_adjust_postponement_normal_limit" iLabel="บริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit_frame" for="eva_adjust_postponement_normal_limit_frame">กรอบวงเงินร้อยละ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="true" iGroup="eva_adjust_postponement_normal" />
<input class="form-control" type="number" onchange="Oneva_adjust_postponement_normal_limit_frameChange();" id="eva_adjust_postponement_normal_limit_frame" iLabel="กรอบวงเงินร้อยละ" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_limit_quota" for="eva_adjust_postponement_normal_limit_quota">จำนวนเงินที่สามารถบริหารวงเงิน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
<input disabled class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงิน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_normal_percentage" for="eva_adjust_postponement_normal_percentage">ร้อยละที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_normal_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
<input class="form-control" type="number" onchange="Oneva_adjust_postponement_normal_percentageChange();" id="eva_adjust_postponement_normal_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_normal" />
</div>
<div class="form-group col-md-6">
<label for="eva_adjust_postponement_normal_percentage">จำนวนเงินที่ใช้เลื่อนคงเหลือ</label>
<input disabled class="form-control" type="number" id="remain_cost" iLabel="จำนวนเงินที่ใช้เลื่อนคงเหลือ" iRequire="true" iGroup="" />
</div>
</div>
@@ -163,6 +92,49 @@
</div>
</section>
</section>
<br/>
<section class="wrapper">
<div class="title"><div class="line"></div>รายชื่อบุคคลากร</div>
<table id="eva_adjust_postponement_detail_normal_02Table" class="display table table-bordered table-striped">
<thead>
<tr>
<th>ลำดับ</th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_02_remark'>หมายเหตุ</label></th>
</tr>
</thead>
<tbody class="thin-border-bottom" id="eva_adjust_postponement_detail_normal_02Body"></tbody>
</table>
</section>
<br/>
<section class="wrapper">
<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>
@@ -172,59 +144,19 @@
</section>
<br/>
<section class="wrapper">
<div class="title"><div class="line"></div>รายชื่อบุคคลากร</div>
<div class="tools">
<div class="row">
<div class="col-md-3">
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_normal_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> ประมวลผลรายชื่อบุคคลากร</button>
</div>
</div>
</div>
<table id="eva_adjust_postponement_detail_normalTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th><label id='h_eva_adjust_postponement_detail_normal_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_normal_remark'>หมายเหตุ</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js"></script>
<script src="~/js/eva_adjust_postponement_detail_normal/eva_adjust_postponement_detail_normal.js"></script>
<script src="~/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js"></script>
<script>
$(document).ready(function () {
var id = getUrlParameter("id");
if (id) {
eva_adjust_postponement_normal_SetEditForm(id);
eva_adjust_postponement_detail_normal_InitiateDataTable(id);
eva_adjust_postponement_detail_normal_InitialForm();
eva_adjust_postponement_normal_SetEditForm(id);
eva_adjust_postponement_detail_normal_02_InitialForm(id);
} else {
eva_adjust_postponement_normal_SetCreateForm();
}
SetupValidationRemark("eva_adjust_postponement_normal");
SetupValidationRemark("eva_adjust_postponement_detail_normal");
});
</script>
}

View File

@@ -18,6 +18,8 @@
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_adjust_postponement_quota_id" />
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_quota_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงินโควต้าพิเศษ" iRequire="false" iGroup="eva_adjust_postponement_quota" />
<input style="display:none;" class="form-control" type="number" id="eva_adjust_postponement_quota_limit_frame_quota" iLabel="กรอบโควต้าพิเศษร้อยละ" iRequire="false" iGroup="eva_adjust_postponement_quota" />
<div class='row'>
<div class="form-group col-md-6">
@@ -41,17 +43,6 @@
<select class="form-control" id="eva_adjust_postponement_quota_managed_by" iLabel="ผู้จัดทำข้อมูล" iRequire="true" iGroup="eva_adjust_postponement_quota"></select>
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_quota_limit_frame_quota" for="eva_adjust_postponement_quota_limit_frame_quota">กรอบโควต้าพิเศษร้อยละ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_quota_limit_frame_quota" iLabel="กรอบโควต้าพิเศษร้อยละ" iRequire="true" iGroup="eva_adjust_postponement_quota" />
</div>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_quota_limit_quota" for="eva_adjust_postponement_quota_limit_quota">จำนวนเงินที่สามารถบริหารวงเงินโควต้าพิเศษ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_quota_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงินโควต้าพิเศษ" iRequire="true" iGroup="eva_adjust_postponement_quota" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_quota_command_no" for="eva_adjust_postponement_quota_command_no">เลขที่คำสั่ง</label>

View File

@@ -6,93 +6,6 @@
}
<div class="modal fade" id="eva_adjust_postponement_detail_quotaModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_detail_quotaModelLabel" 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_quotaModelLabel">บันทึกข้อมูล eva_adjust_postponement_detail_quota</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</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_quota_id" />
<input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_adjust_postponement_quota_id" />
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_employee_id" for="eva_adjust_postponement_detail_quota_employee_id">ผู้รับการประเมิน</label>
<select class="form-control" id="eva_adjust_postponement_detail_quota_employee_id" iLabel="ผู้รับการประเมิน" iRequire="true" iGroup="eva_adjust_postponement_detail_quota"></select>
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_sarary" for="eva_adjust_postponement_detail_quota_sarary">เงินเดือน ก่อนปรับเลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_sarary" iLabel="เงินเดือน ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_cost_living" for="eva_adjust_postponement_detail_quota_cost_living">ค่าครองชีพ ก่อนปรับเลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_cost_living" iLabel="ค่าครองชีพ ก่อนปรับเลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_middle" for="eva_adjust_postponement_detail_quota_middle">ค่ากลางฐานในการคำนวณ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_middle" iLabel="ค่ากลางฐานในการคำนวณ" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_promoted_percentage" for="eva_adjust_postponement_detail_quota_promoted_percentage">ร้อยละที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_promoted_percentage" iLabel="ร้อยละที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_total_promote" for="eva_adjust_postponement_detail_quota_total_promote">จำนวนเงินที่ได้เลื่อน</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_total_promote" iLabel="จำนวนเงินที่ได้เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_new_sarary" for="eva_adjust_postponement_detail_quota_new_sarary">เงินเดือนใหม่</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_new_sarary" iLabel="เงินเดือนใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_new_cost_living" for="eva_adjust_postponement_detail_quota_new_cost_living">ค่าครองชีพใหม่</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_new_cost_living" iLabel="ค่าครองชีพใหม่" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_receive_quota" for="eva_adjust_postponement_detail_quota_receive_quota">ได้รับเงินโควต้าพิเศษ</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_receive_quota" iLabel="ได้รับเงินโควต้าพิเศษ" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_adjust_postponement_detail_quota_new_sarary_with_quota" for="eva_adjust_postponement_detail_quota_new_sarary_with_quota">เงินเดือนใหม่ (รวมโควต้า)</label>
<input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_new_sarary_with_quota" iLabel="เงินเดือนใหม่ (รวมโควต้า)" iRequire="true" iGroup="eva_adjust_postponement_detail_quota" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_adjust_postponement_detail_quota_remark" for="eva_adjust_postponement_detail_quota_remark">หมายเหตุ</label>
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_detail_quota_remark" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_postponement_detail_quota"></textarea>
</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_quota_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@@ -177,50 +90,48 @@
<section class="wrapper">
<div class="title"><div class="line"></div>รายชื่อบุคลลากร</div>
<div class="tools">
<div class="row">
<div class="col-md-3">
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_detail_quota_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มบุคคลากร ผู้มีสิทธิได้รับเงินโควต้าพิเศษ</button>
</div>
</div>
</div>
<table id="eva_adjust_postponement_detail_quotaTable" class="display table table-bordered table-striped">
<table id="eva_adjust_postponement_detail_quota_02Table" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th><label id='h_eva_adjust_postponement_detail_quota_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_remark'>หมายเหตุ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
<th>ลำดับ</th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_remark'>หมายเหตุ</label></th>
</tr>
</thead>
<tbody></tbody>
<tbody class="thin-border-bottom" id="eva_adjust_postponement_detail_quota_02Body"></tbody>
</table>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js"></script>
<script src="~/js/eva_adjust_postponement_detail_quota/eva_adjust_postponement_detail_quota.js"></script>
<script src="~/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js"></script>
<script>
$(document).ready(function () {
var id = getUrlParameter("id");
if (id) {
eva_adjust_postponement_quota_SetEditForm(id);
eva_adjust_postponement_detail_quota_InitiateDataTable(id);
eva_adjust_postponement_detail_quota_InitialForm();
eva_adjust_postponement_detail_quota_02_InitialForm(id);
} else {
eva_adjust_postponement_quota_SetCreateForm();
}

View File

@@ -1,7 +1,7 @@
{
"connectionStrings": {
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;"
},
"IdentityServer": {
"url": "",

View File

@@ -1,7 +1,7 @@
{
"connectionStrings": {
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;"
},
"IdentityServer": {
"url": "",

View File

@@ -1,7 +1,7 @@
{
"connectionStrings": {
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;"
},
"IdentityServer": {
"url": "",

View File

@@ -106,18 +106,6 @@
<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.ReCreatePostponementDetailNormal(System.Nullable{System.Int32})">
<summary>
ReCreatePostponementDetailNormal
</summary>
<remarks>
</remarks>
<param name="adjust_postponement_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_normalController.Delete(System.Int32)">
<summary>
Delete item
@@ -142,6 +130,113 @@
<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_normal_02Controller.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_detail_normal_02Controller},TodoAPI2.Models.Ieva_adjust_postponement_detail_normal_02Service,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_normal_02Controller.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_normal_02Controller.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_normal_02Controller.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_normal_02Controller.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_detail_normal_02SearchModel)">
<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_normal_02Controller.eva_adjust_postponement_detail_normal_02_report(TodoAPI2.Models.eva_adjust_postponement_detail_normal_02ReportRequestModel)">
<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_normal_02Controller.Insert(TodoAPI2.Models.eva_adjust_postponement_detail_normal_02InputModel)">
<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_normal_02Controller.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_detail_normal_02InputModel)">
<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_normal_02Controller.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_normal_02Controller.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_adjust_postponement_detail_normal_02InputModel})">
<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_quotaController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_detail_quotaController},TodoAPI2.Models.Ieva_adjust_postponement_detail_quotaService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection
@@ -264,6 +359,113 @@
<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_quota_02Controller.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_detail_quota_02Controller},TodoAPI2.Models.Ieva_adjust_postponement_detail_quota_02Service,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_quota_02Controller.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_quota_02Controller.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_quota_02Controller.GetList(System.Nullable{System.Int32})">
<summary>
Get list items by adjust_postponement_quota_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_quota_02Controller.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_detail_quota_02SearchModel)">
<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_quota_02Controller.eva_adjust_postponement_detail_quota_02_report(TodoAPI2.Models.eva_adjust_postponement_detail_quota_02ReportRequestModel)">
<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_quota_02Controller.Insert(TodoAPI2.Models.eva_adjust_postponement_detail_quota_02InputModel)">
<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_quota_02Controller.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_detail_quota_02InputModel)">
<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_quota_02Controller.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_quota_02Controller.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_adjust_postponement_detail_quota_02InputModel})">
<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_normalController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_normalController},TodoAPI2.Models.Ieva_adjust_postponement_normalService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection

View File

@@ -203,7 +203,7 @@ var eva_adjust_postponement_detail_normal_setupTable = function (result) {
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_detail_normal_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_normal_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_detail_normal_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
}
}],
"language": {

View File

@@ -0,0 +1,200 @@
function eva_adjust_postponement_detail_normal_02_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_adjust_postponement_detail_normal_02_id_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_middle_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_level_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text("");
}
function eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, i, blankItem) {
$("#eva_adjust_postponement_detail_normal_02_id_" + i).val(data.id);
$("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val(data.adjust_postponement_id);
$("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val(data.employee_id);
$("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text(data.sarary);
$("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text(data.cost_living);
$("#eva_adjust_postponement_detail_normal_02_middle_" + i).text(data.middle);
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(data.promoted_percentage);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(data.total_promote);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val(data.remark);
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text(data.emp_code);
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text(data.emp_fullname);
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text(data.emp_position);
$("#eva_adjust_postponement_detail_normal_02_emp_level_" + i).text(data.emp_level);
$("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text(data.total_score);
$("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text(data.eva_result);
}
function eva_adjust_postponement_detail_normal_02_GetFromForm(obj, i) {
var eva_adjust_postponement_detail_normal_02Object = new Object();
eva_adjust_postponement_detail_normal_02Object.id = obj.find("#eva_adjust_postponement_detail_normal_02_id_" + i).val();
eva_adjust_postponement_detail_normal_02Object.adjust_postponement_id = obj.find("#eva_adjust_postponement_detail_normal_02_adjust_postponement_id_" + i).val();
eva_adjust_postponement_detail_normal_02Object.employee_id = obj.find("#eva_adjust_postponement_detail_normal_02_employee_id_" + i).val();
eva_adjust_postponement_detail_normal_02Object.sarary = obj.find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text();
eva_adjust_postponement_detail_normal_02Object.cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_cost_living_" + i).text();
eva_adjust_postponement_detail_normal_02Object.middle = obj.find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text();
eva_adjust_postponement_detail_normal_02Object.promoted_percentage = obj.find("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val();
eva_adjust_postponement_detail_normal_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val();
eva_adjust_postponement_detail_normal_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text();
eva_adjust_postponement_detail_normal_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text();
eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).val();
eva_adjust_postponement_detail_normal_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_fullname = obj.find("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_position = obj.find("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_level = obj.find("#eva_adjust_postponement_detail_normal_02_emp_level_" + i).text();
eva_adjust_postponement_detail_normal_02Object.total_score = obj.find("#eva_adjust_postponement_detail_normal_02_total_score_" + i).text();
eva_adjust_postponement_detail_normal_02Object.eva_result = obj.find("#eva_adjust_postponement_detail_normal_02_eva_result_" + i).text();
eva_adjust_postponement_detail_normal_02Object.active_mode = obj.find("#isActive_" + i + "_eva_adjust_postponement_detail_normal_02").val();
return eva_adjust_postponement_detail_normal_02Object;
}
function eva_adjust_postponement_detail_normal_02_Save(id) {
//Insert eva_adjust_postponement_detail_normal_02 List
var eva_adjust_postponement_detail_normal_02 = [];
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_normal_02 = eva_adjust_postponement_detail_normal_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_normal_02.push(eacheva_adjust_postponement_detail_normal_02);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_adjust_postponement_detail_normal_02/UpdateMultiple', eva_adjust_postponement_detail_normal_02, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
$('#eva_adjust_postponement_detail_normal_02Body').empty();
var successFunc = function (response) {
//console.log(response);
$.each(response, function (i, data) {
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_normal_02" value="1" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_adjust_postponement_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_code_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, (i + 1), blankItem);
});
eva_adjust_postponement_detail_normal_02_Summary();
endLoad();
};
startLoad();
//AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02", successFunc, AlertDanger);
AjaxGetRequest(apisite + '/api/eva_adjust_postponement_detail_normal_02?adjust_postponement_id=' + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_normal_02_Add() {
var successFunc = function (result) {
var i = $("#eva_adjust_postponement_detail_normal_02Body tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_normal_02" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_adjust_postponement_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_code_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_adjust_postponement_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
eva_adjust_postponement_detail_normal_02_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02/" + "GetBlankItem", successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_detail_normal_02_Summary();
}
}
function eva_adjust_postponement_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_detail_normal_02_Summary();
}
}
function eva_adjust_postponement_detail_normal_02_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_adjust_postponement_detail_normal_02_InitialForm(id) {
var successFunc = function (result) {
eva_adjust_postponement_detail_normal_02_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,208 @@
function eva_adjust_postponement_detail_quota_02_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_adjust_postponement_detail_quota_02_id_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_employee_id_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_middle_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_emp_fullname_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_emp_position_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_emp_level_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_total_score_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_eva_result_" + i).val("");
}
function eva_adjust_postponement_detail_quota_02_FeedDataToForm(data, i, blankItem) {
$("#eva_adjust_postponement_detail_quota_02_id_" + i).val(data.id);
$("#eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_" + i).val(data.adjust_postponement_quota_id);
$("#eva_adjust_postponement_detail_quota_02_employee_id_" + i).val(data.employee_id);
$("#eva_adjust_postponement_detail_quota_02_sarary_" + i).text(data.sarary);
$("#eva_adjust_postponement_detail_quota_02_cost_living_" + i).text(data.cost_living);
$("#eva_adjust_postponement_detail_quota_02_middle_" + i).text(data.middle);
$("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text(data.promoted_percentage);
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text(data.total_promote);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val(data.remark);
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(data.receive_quota);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(data.new_sarary_with_quota);
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text(data.emp_code);
$("#eva_adjust_postponement_detail_quota_02_emp_fullname_" + i).text(data.emp_fullname);
$("#eva_adjust_postponement_detail_quota_02_emp_position_" + i).text(data.emp_position);
$("#eva_adjust_postponement_detail_quota_02_emp_level_" + i).text(data.emp_level);
$("#eva_adjust_postponement_detail_quota_02_total_score_" + i).text(data.total_score);
$("#eva_adjust_postponement_detail_quota_02_eva_result_" + i).val(data.eva_result);
}
function eva_adjust_postponement_detail_quota_02_GetFromForm(obj, i) {
var eva_adjust_postponement_detail_quota_02Object = new Object();
eva_adjust_postponement_detail_quota_02Object.id = obj.find("#eva_adjust_postponement_detail_quota_02_id_" + i).val();
eva_adjust_postponement_detail_quota_02Object.adjust_postponement_quota_id = obj.find("#eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_" + i).val();
eva_adjust_postponement_detail_quota_02Object.employee_id = obj.find("#eva_adjust_postponement_detail_quota_02_employee_id_" + i).val();
eva_adjust_postponement_detail_quota_02Object.sarary = obj.find("#eva_adjust_postponement_detail_quota_02_sarary_" + i).text();
eva_adjust_postponement_detail_quota_02Object.cost_living = obj.find("#eva_adjust_postponement_detail_quota_02_cost_living_" + i).text();
eva_adjust_postponement_detail_quota_02Object.middle = obj.find("#eva_adjust_postponement_detail_quota_02_middle_" + i).text();
eva_adjust_postponement_detail_quota_02Object.promoted_percentage = obj.find("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text();
eva_adjust_postponement_detail_quota_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text();
eva_adjust_postponement_detail_quota_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text();
eva_adjust_postponement_detail_quota_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text();
eva_adjust_postponement_detail_quota_02Object.remark = obj.find("#eva_adjust_postponement_detail_quota_02_remark_" + i).val();
eva_adjust_postponement_detail_quota_02Object.receive_quota = obj.find("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val();
eva_adjust_postponement_detail_quota_02Object.new_sarary_with_quota = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text();
eva_adjust_postponement_detail_quota_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text();
eva_adjust_postponement_detail_quota_02Object.emp_fullname = obj.find("#eva_adjust_postponement_detail_quota_02_emp_fullname_" + i).text();
eva_adjust_postponement_detail_quota_02Object.emp_position = obj.find("#eva_adjust_postponement_detail_quota_02_emp_position_" + i).text();
eva_adjust_postponement_detail_quota_02Object.emp_level = obj.find("#eva_adjust_postponement_detail_quota_02_emp_level_" + i).text();
eva_adjust_postponement_detail_quota_02Object.total_score = obj.find("#eva_adjust_postponement_detail_quota_02_total_score_" + i).text();
eva_adjust_postponement_detail_quota_02Object.eva_result = obj.find("#eva_adjust_postponement_detail_quota_02_eva_result_" + i).val();
eva_adjust_postponement_detail_quota_02Object.active_mode = obj.find("#isActive_" + i + "_eva_adjust_postponement_detail_quota_02").val();
return eva_adjust_postponement_detail_quota_02Object;
}
function eva_adjust_postponement_detail_quota_02_Save(id) {
//Insert eva_adjust_postponement_detail_quota_02 List
var eva_adjust_postponement_detail_quota_02 = [];
$('#eva_adjust_postponement_detail_quota_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_quota_02 = eva_adjust_postponement_detail_quota_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_quota_02.push(eacheva_adjust_postponement_detail_quota_02);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_adjust_postponement_detail_quota_02/UpdateMultiple', eva_adjust_postponement_detail_quota_02, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
$('#eva_adjust_postponement_detail_quota_02Body').empty();
var successFunc = function (response) {
//console.log(response);
$.each(response, function (i, data) {
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_quota_02" value="1" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_code_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_02_receive_quota_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_quota_02Body').append($(tag));
eva_adjust_postponement_detail_quota_02_FeedDataToForm(data, (i + 1), blankItem);
});
eva_adjust_postponement_detail_quota_02_Summary();
endLoad();
};
startLoad();
//AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_quota_02", successFunc, AlertDanger);
AjaxGetRequest(apisite + '/api/eva_adjust_postponement_detail_quota_02/?adjust_postponement_quota_id=' + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_quota_02_Add() {
var successFunc = function (result) {
var i = $("#eva_adjust_postponement_detail_quota_02Body tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_quota_02" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_adjust_postponement_quota_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_quota_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_quota_02_receive_quota_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_code_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_detail_quota_02_Removeeva_adjust_postponement_detail_quota_02(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_adjust_postponement_detail_quota_02_Restoreeva_adjust_postponement_detail_quota_02(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_quota_02Body').append($(tag));
eva_adjust_postponement_detail_quota_02_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_quota_02/" + "GetBlankItem", successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_quota_02_Removeeva_adjust_postponement_detail_quota_02(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_detail_quota_02_Summary();
}
}
function eva_adjust_postponement_detail_quota_02_Restoreeva_adjust_postponement_detail_quota_02(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_detail_quota_02_Summary();
}
}
function eva_adjust_postponement_detail_quota_02_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_adjust_postponement_detail_quota_02_InitialForm(id) {
var successFunc = function (result) {
eva_adjust_postponement_detail_quota_02_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_quota_02/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -20,18 +20,26 @@ DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by")
function eva_adjust_postponement_normal_GetFromForm() {
var eva_adjust_postponement_normalObject = new Object();
eva_adjust_postponement_normalObject.id = $("#eva_adjust_postponement_normal_id").val();
eva_adjust_postponement_normalObject.fiscal_year = $("#eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalObject.theDate = getDate($("#eva_adjust_postponement_normal_theDate").val());
eva_adjust_postponement_normalObject.theRound = $("#eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalObject.create_evaluation_id = $("#eva_adjust_postponement_normal_create_evaluation_id").val();
eva_adjust_postponement_normalObject.limit = $("#eva_adjust_postponement_normal_limit").val();
eva_adjust_postponement_normalObject.limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
eva_adjust_postponement_normalObject.limit_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
eva_adjust_postponement_normalObject.percentage = $("#eva_adjust_postponement_normal_percentage").val();
eva_adjust_postponement_normalObject.managed_by = $("#eva_adjust_postponement_normal_managed_by").val();
//eva_adjust_postponement_normalObject.org_id = $("#eva_adjust_postponement_normal_org_id").val();
eva_adjust_postponement_normalObject.id = $("#eva_adjust_postponement_normal_id").val();
eva_adjust_postponement_normalObject.fiscal_year = $("#eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalObject.theDate = getDate($("#eva_adjust_postponement_normal_theDate").val());
eva_adjust_postponement_normalObject.theRound = $("#eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalObject.create_evaluation_id = $("#eva_adjust_postponement_normal_create_evaluation_id").val();
eva_adjust_postponement_normalObject.limit = $("#eva_adjust_postponement_normal_limit").val();
eva_adjust_postponement_normalObject.limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
eva_adjust_postponement_normalObject.limit_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
eva_adjust_postponement_normalObject.percentage = $("#eva_adjust_postponement_normal_percentage").val();
eva_adjust_postponement_normalObject.managed_by = $("#eva_adjust_postponement_normal_managed_by").val();
//eva_adjust_postponement_normalObject.org_id = $("#eva_adjust_postponement_normal_org_id").val();
var eva_adjust_postponement_detail_normal_02 = [];
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_normal_02 = eva_adjust_postponement_detail_normal_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_normal_02.push(eacheva_adjust_postponement_detail_normal_02);
});
eva_adjust_postponement_normalObject.eva_adjust_postponement_detail_normal_02_model = eva_adjust_postponement_detail_normal_02;
return eva_adjust_postponement_normalObject;
}
@@ -51,6 +59,8 @@ function eva_adjust_postponement_normal_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_normal_editMode = "UPDATE";
eva_adjust_postponement_normal_FeedDataToForm(result);
Oneva_adjust_postponement_normal_limit_frameChange();
Oneva_adjust_postponement_normal_percentageChange();
endLoad();
};
startLoad();
@@ -114,3 +124,35 @@ function eva_adjust_postponement_normal_GoDelete(a) {
//================= Multi-Selection Function =========================================
//================= Control Function =========================================
function Oneva_adjust_postponement_normal_limit_frameChange(){
var limit = $("#eva_adjust_postponement_normal_limit").val();
var limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
$("#eva_adjust_postponement_normal_limit_quota").val(limit*limit_frame/100);
}
function Oneva_adjust_postponement_normal_percentageChange(){
var percentage = $("#eva_adjust_postponement_normal_percentage").val();
var current_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
var sum_postpone = 0;
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text());
var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text());
var new_salary = parseFloat(old_salary + (percentage * middle));
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(percentage * middle);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(new_salary);
sum_postpone += percentage * middle;
});
$("#remain_cost").val(current_quota - sum_postpone);
}

View File

@@ -17,15 +17,23 @@ DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_quota_managed_by"),
function eva_adjust_postponement_quota_GetFromForm() {
var eva_adjust_postponement_quotaObject = new Object();
eva_adjust_postponement_quotaObject.id = $("#eva_adjust_postponement_quota_id").val();
eva_adjust_postponement_quotaObject.fiscal_year = $("#eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaObject.theDate = getDate($("#eva_adjust_postponement_quota_theDate").val());
eva_adjust_postponement_quotaObject.theRound = $("#eva_adjust_postponement_quota_theRound").val();
eva_adjust_postponement_quotaObject.limit_quota = $("#eva_adjust_postponement_quota_limit_quota").val();
eva_adjust_postponement_quotaObject.limit_frame_quota = $("#eva_adjust_postponement_quota_limit_frame_quota").val();
eva_adjust_postponement_quotaObject.command_no = $("#eva_adjust_postponement_quota_command_no").val();
eva_adjust_postponement_quotaObject.managed_by = $("#eva_adjust_postponement_quota_managed_by").val();
eva_adjust_postponement_quotaObject.id = $("#eva_adjust_postponement_quota_id").val();
eva_adjust_postponement_quotaObject.fiscal_year = $("#eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaObject.theDate = getDate($("#eva_adjust_postponement_quota_theDate").val());
eva_adjust_postponement_quotaObject.theRound = $("#eva_adjust_postponement_quota_theRound").val();
eva_adjust_postponement_quotaObject.limit_quota = $("#eva_adjust_postponement_quota_limit_quota").val();
eva_adjust_postponement_quotaObject.limit_frame_quota = $("#eva_adjust_postponement_quota_limit_frame_quota").val();
eva_adjust_postponement_quotaObject.command_no = $("#eva_adjust_postponement_quota_command_no").val();
eva_adjust_postponement_quotaObject.managed_by = $("#eva_adjust_postponement_quota_managed_by").val();
var eva_adjust_postponement_detail_quota_02 = [];
$('#eva_adjust_postponement_detail_quota_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_detail_quota_02 = eva_adjust_postponement_detail_quota_02_GetFromForm($(this), i);
eva_adjust_postponement_detail_quota_02.push(eacheva_adjust_postponement_detail_quota_02);
});
eva_adjust_postponement_quotaObject.adjust_postponement_detail_quota_02_model = eva_adjust_postponement_detail_quota_02;
return eva_adjust_postponement_quotaObject;
}