Compare commits
10 Commits
94bf0709d1
...
8a799f9725
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a799f9725 | ||
|
|
d345d579a1 | ||
|
|
eae11f4765 | ||
|
|
8f2e0af11b | ||
|
|
804bb7d9f2 | ||
|
|
ccef30e588 | ||
|
|
bfb9c80fac | ||
|
|
086f101d0f | ||
|
|
42e1878aa8 | ||
|
|
32280778e6 |
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_adjust_postponement_update_status")]
|
||||
public class eva_adjust_postponement_update_statusController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_postponement_update_statusController> _logger;
|
||||
private Ieva_adjust_postponement_update_statusService _repository;
|
||||
private Iexternal_employeeService emp;
|
||||
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_update_statusController(ILogger<eva_adjust_postponement_update_statusController> logger,
|
||||
Ieva_adjust_postponement_update_statusService repository, IConfiguration configuration,
|
||||
Iexternal_employeeService inemp)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
/// <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_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(eva_adjust_postponement_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by postponement_status_note
|
||||
/// </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_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string postponement_status_note)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBypostponement_status_note(postponement_status_note));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_postponement_update_statusSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 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_update_statusInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
|
||||
int? e = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
|
||||
{
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var theEmp = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
if(theEmp != null)
|
||||
{
|
||||
e = theEmp.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
var result = _repository.Update(id, model, true, e);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"บันทึกการอนุมัติและส่งต่อ เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_adjust_quota_update_final_status")]
|
||||
public class eva_adjust_quota_update_final_statusController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_quota_update_final_statusController> _logger;
|
||||
private Ieva_adjust_quota_update_final_statusService _repository;
|
||||
private Iexternal_employeeService emp;
|
||||
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="inemp"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_adjust_quota_update_final_statusController(ILogger<eva_adjust_quota_update_final_statusController> logger,
|
||||
Ieva_adjust_quota_update_final_statusService repository, IConfiguration configuration,
|
||||
Iexternal_employeeService inemp)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
/// <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_quota_update_final_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(eva_adjust_quota_update_final_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by quota_final_status_note
|
||||
/// </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_quota_update_final_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string quota_final_status_note)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByquota_final_status_note(quota_final_status_note));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_quota_update_final_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_quota_update_final_statusSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("eva_adjust_quota_update_final_status_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_adjust_quota_update_final_status_report(eva_adjust_quota_update_final_statusReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 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_quota_update_final_statusInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
|
||||
int? e = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
|
||||
{
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var theEmp = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
if (theEmp != null)
|
||||
{
|
||||
e = theEmp.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
var result = _repository.Update(id, model, true, e);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
230
ApiControllers/eva_adjust_quota_update_statusControllers.cs
Normal file
230
ApiControllers/eva_adjust_quota_update_statusControllers.cs
Normal file
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_adjust_quota_update_status")]
|
||||
public class eva_adjust_quota_update_statusController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_quota_update_statusController> _logger;
|
||||
private Ieva_adjust_quota_update_statusService _repository;
|
||||
private Iexternal_employeeService emp;
|
||||
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>
|
||||
/// <param name="inemp"></param>
|
||||
public eva_adjust_quota_update_statusController(ILogger<eva_adjust_quota_update_statusController> logger, Ieva_adjust_quota_update_statusService repository,
|
||||
IConfiguration configuration,
|
||||
Iexternal_employeeService inemp)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
/// <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_quota_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(eva_adjust_quota_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by quota_status_note
|
||||
/// </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_quota_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string quota_status_note)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByquota_status_note(quota_status_note));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_quota_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_quota_update_statusSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 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_quota_update_statusInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
|
||||
int? e = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
|
||||
{
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var theEmp = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
if (theEmp != null)
|
||||
{
|
||||
e = theEmp.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
var result = _repository.Update(id, model, true, e);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
var httpclient = new WebClient();
|
||||
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
|
||||
@@ -95,7 +95,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
|
||||
@@ -96,23 +96,25 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
|
||||
var stream = new MemoryStream();
|
||||
Document document = new Document();
|
||||
PdfCopy writer = new PdfCopy(document, stream);
|
||||
document.Open();
|
||||
//var stream = new MemoryStream();
|
||||
//Document document = new Document();
|
||||
//PdfCopy writer = new PdfCopy(document, stream);
|
||||
//document.Open();
|
||||
|
||||
var data1 = GetReport01(model);
|
||||
PdfReader reader1 = new PdfReader(data1);
|
||||
reader1.ConsolidateNamedDestinations();
|
||||
for (int i = 1; i <= reader1.NumberOfPages; i++)
|
||||
{
|
||||
PdfImportedPage page = writer.GetImportedPage(reader1, i);
|
||||
writer.AddPage(page);
|
||||
}
|
||||
reader1.Close();
|
||||
//PdfReader reader1 = new PdfReader(data1);
|
||||
//reader1.ConsolidateNamedDestinations();
|
||||
//for (int i = 1; i <= reader1.NumberOfPages; i++)
|
||||
//{
|
||||
// PdfImportedPage page = writer.GetImportedPage(reader1, i);
|
||||
// writer.AddPage(page);
|
||||
//}
|
||||
//reader1.Close();
|
||||
|
||||
//var data2 = GetReport02(model);
|
||||
//PdfReader reader2 = new PdfReader(data2);
|
||||
@@ -124,13 +126,15 @@ namespace TodoAPI2.Controllers
|
||||
//}
|
||||
//reader2.Close();
|
||||
|
||||
writer.Close();
|
||||
document.Close();
|
||||
//writer.Close();
|
||||
//document.Close();
|
||||
|
||||
var datax = stream.ToArray();
|
||||
var streamx = new MemoryStream(datax);
|
||||
//var datax = stream.ToArray();
|
||||
//var streamx = new MemoryStream(datax);
|
||||
|
||||
return File(streamx, model.contentType);
|
||||
var stream = new MemoryStream(data1);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
|
||||
@@ -400,6 +400,7 @@ namespace TodoAPI2.Controllers
|
||||
|
||||
i.chief_fullname = p.chief_fullname;
|
||||
i.chief_position = p.chief_position + checkLevel(p.chief_position_type_id, p.chief_position_level_text, p.chief_fullname);
|
||||
i.supervisor1_remark = p.supervisor1_remark;
|
||||
i.supervisor2_fullname = p.supervisor2_fullname;
|
||||
i.supervisor2_position = p.supervisor2_position + checkLevel(p.supervisor2_position_type_id, p.supervisor2_position_level_text, p.supervisor2_fullname);
|
||||
i.supervisor1A_fullname = p.supervisor1A_fullname;
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
model.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
1257
Migrations/20220501044125_AddPostponementStatus.Designer.cs
generated
Normal file
1257
Migrations/20220501044125_AddPostponementStatus.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
92
Migrations/20220501044125_AddPostponementStatus.cs
Normal file
92
Migrations/20220501044125_AddPostponementStatus.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddPostponementStatus : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "postponement_status",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 5,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "postponement_status_by",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "postponement_status_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "postponement_status_note",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_status",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 5,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "quota_status_by",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "quota_status_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_status_note",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_by",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_date",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_note",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_by",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_date",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_note",
|
||||
table: "eva_adjust_postponement");
|
||||
}
|
||||
}
|
||||
}
|
||||
1270
Migrations/20220502040427_AddFinalApprover.Designer.cs
generated
Normal file
1270
Migrations/20220502040427_AddFinalApprover.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
62
Migrations/20220502040427_AddFinalApprover.cs
Normal file
62
Migrations/20220502040427_AddFinalApprover.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddFinalApprover : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_final_status",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 5,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "quota_final_status_by",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "quota_final_status_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_final_status_note",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "quota_status_submit_to",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_final_status",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_final_status_by",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_final_status_date",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_final_status_note",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_submit_to",
|
||||
table: "eva_adjust_postponement");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,41 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<string>("postponement_status")
|
||||
.HasMaxLength(5);
|
||||
|
||||
b.Property<int?>("postponement_status_by")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime?>("postponement_status_date");
|
||||
|
||||
b.Property<string>("postponement_status_note")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("quota_final_status")
|
||||
.HasMaxLength(5);
|
||||
|
||||
b.Property<int?>("quota_final_status_by")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime?>("quota_final_status_date");
|
||||
|
||||
b.Property<string>("quota_final_status_note")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("quota_status")
|
||||
.HasMaxLength(5);
|
||||
|
||||
b.Property<int?>("quota_status_by")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime?>("quota_status_date");
|
||||
|
||||
b.Property<string>("quota_status_note")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int?>("quota_status_submit_to");
|
||||
|
||||
b.Property<string>("report_type")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
|
||||
@@ -58,5 +58,33 @@ namespace TodoAPI2.Models
|
||||
public string report_type { get; set; }
|
||||
|
||||
public DateTime? imported_date { get; set; }
|
||||
|
||||
[MaxLength(5)]
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
[MaxLength(255)]
|
||||
public int? postponement_status_by { get; set; }
|
||||
[MaxLength(1000)]
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
[MaxLength(5)]
|
||||
public string quota_status { get; set; }
|
||||
|
||||
public DateTime? quota_status_date { get; set; }
|
||||
[MaxLength(255)]
|
||||
public int? quota_status_by { get; set; }
|
||||
[MaxLength(1000)]
|
||||
public string quota_status_note { get; set; }
|
||||
public int? quota_status_submit_to { get; set; }
|
||||
|
||||
[MaxLength(5)]
|
||||
public string quota_final_status { get; set; }
|
||||
|
||||
public DateTime? quota_final_status_date { get; set; }
|
||||
[MaxLength(255)]
|
||||
public int? quota_final_status_by { get; set; }
|
||||
[MaxLength(1000)]
|
||||
public string quota_final_status_note { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace TodoAPI2.Models
|
||||
rep_eva_savemessageReportRequestModel setModelFor_rep_eva_savemessageReport(rep_eva_savemessageReportRequestModel model);
|
||||
DataContext GetContext();
|
||||
|
||||
void updateAllpostponement(int id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,39 @@ namespace TodoAPI2.Models
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
private string isStringNull(string a, string b)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(a)) return a;
|
||||
else return b;
|
||||
}
|
||||
|
||||
private T isNull<T>(T a, T b)
|
||||
{
|
||||
if (a != null) return a;
|
||||
else return b;
|
||||
}
|
||||
|
||||
public void updateAllpostponement(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
var postponement = from x in _repository.Context.eva_adjust_postponement
|
||||
where x.fiscal_year == entity.fiscal_year
|
||||
&& x.theRound == entity.theRound
|
||||
&& x.id != entity.id
|
||||
select x;
|
||||
|
||||
foreach(var i in postponement)
|
||||
{
|
||||
//i.postponement_status = entity.postponement_status;
|
||||
i.quota_status = entity.quota_status;
|
||||
i.quota_final_status = entity.quota_final_status;
|
||||
}
|
||||
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_quotaWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
@@ -84,6 +117,19 @@ namespace TodoAPI2.Models
|
||||
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
|
||||
var postponement = from x in _repository.Context.eva_adjust_postponement
|
||||
join e in emp.GetAllEmployee() on isNull(x.managed_by, x.postponement_status_by) equals e.id
|
||||
join v in ext.GetAgreeDisagree4() on isStringNull(x.postponement_status, "W") equals v.external_code
|
||||
join c in _repository.Context.eva_create_evaluation on x.create_evaluation_id equals c.id
|
||||
join d in _repository.Context.eva_evaluation_group on c.evaluation_group_id equals d.id
|
||||
where x.fiscal_year == entity.fiscal_year
|
||||
&& x.theRound == entity.theRound
|
||||
&& x.id != entity.id
|
||||
select d.thegroup + " โดย " + e.fullname + " " + v.external_name;
|
||||
|
||||
|
||||
i.approve_status = postponement.ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem()
|
||||
@@ -142,6 +188,8 @@ namespace TodoAPI2.Models
|
||||
managed_by = m_eva_adjust_postponement_quota.managed_by,
|
||||
limit = m_eva_adjust_postponement_quota.limit,
|
||||
|
||||
quota_status_submit_to = m_eva_adjust_postponement_quota.quota_status_submit_to,
|
||||
|
||||
managed_by_external_linkage_external_name = fk_external_linkageResult7.fullname,
|
||||
|
||||
isActive = m_eva_adjust_postponement_quota.isActive,
|
||||
|
||||
@@ -34,5 +34,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string managed_by_external_linkage_external_name { get; set; }
|
||||
|
||||
public int? quota_status_submit_to { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,7 @@ namespace TodoAPI2.Models
|
||||
public List<external_employeeViewModel> item_managed_by { get; set; }
|
||||
public List<external_linkageViewModel> item_fiscal_year_search { get; set; }
|
||||
public List<external_linkageViewModel> item_theRound_search { get; set; }
|
||||
public List<string> approve_status { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
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_update_statusService
|
||||
{
|
||||
|
||||
new eva_adjust_postponement_update_statusViewModel Update(int id, eva_adjust_postponement_update_statusInputModel model, bool is_force_save, int? updateby);
|
||||
List<eva_adjust_postponement_update_statusViewModel> GetListBypostponement_status_note(string postponement_status_note);
|
||||
List<eva_adjust_postponement_update_statusViewModel> GetListBySearch(eva_adjust_postponement_update_statusSearchModel model);
|
||||
|
||||
|
||||
eva_adjust_postponement_update_statusWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_update_statusWithSelectionViewModel GetBlankItem();
|
||||
|
||||
eva_adjust_postponementEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
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_update_statusInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
|
||||
public int? postponement_status_by { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_update_statusReportRequestModel : eva_adjust_postponement_update_statusSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_update_statusSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
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_update_statusService : Ieva_adjust_postponement_update_statusService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private Ieva_adjust_postponement_quotaService quotaStatus;
|
||||
public eva_adjust_postponement_update_statusService(
|
||||
IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb,
|
||||
Iexternal_linkageService inext,
|
||||
Iexternal_employeeService inemp,
|
||||
Ieva_adjust_postponement_quotaService inquotaStatus
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
quotaStatus = inquotaStatus;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponementEntity GetEntity(eva_adjust_postponement_update_statusInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponementEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponementEntity> GetEntityList(List<eva_adjust_postponement_update_statusInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementEntity>>(models);
|
||||
}
|
||||
private eva_adjust_postponement_update_statusViewModel GetDto(eva_adjust_postponementEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponement_update_statusViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_postponement_update_statusViewModel> GetDtoList(List<eva_adjust_postponementEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_update_statusViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
if (!entity.postponement_status_date.HasValue) entity.postponement_status_date = DateTime.Now;
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponementEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
if (!entity.postponement_status_date.HasValue) entity.postponement_status_date = DateTime.Now;
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_update_statusWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_postponement_update_statusWithSelectionViewModel>(entity);
|
||||
i.item_postponement_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_postponement_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.postponement_status_date = DateTime.Now;
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_update_statusWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_postponement_update_statusWithSelectionViewModel();
|
||||
i.item_postponement_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_postponement_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.postponement_status_date = DateTime.Now;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_update_statusViewModel> GetListBypostponement_status_note(string postponement_status_note)
|
||||
{
|
||||
var model = new eva_adjust_postponement_update_statusSearchModel();
|
||||
model.postponement_status_note = postponement_status_note;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_update_statusViewModel> GetListBySearch(eva_adjust_postponement_update_statusSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_postponement_update_status in _repository.Context.eva_adjust_postponement
|
||||
|
||||
join fk_external_linkage1 in ext.GetAgreeDisagree4() on m_eva_adjust_postponement_update_status.postponement_status equals fk_external_linkage1.external_code
|
||||
into external_linkageResult1
|
||||
from fk_external_linkageResult1 in external_linkageResult1.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage3 in emp.GetAllEmployee() on m_eva_adjust_postponement_update_status.postponement_status_by equals fk_external_linkage3.id
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (string.IsNullOrEmpty(model.postponement_status_note) || m_eva_adjust_postponement_update_status.postponement_status_note.Contains(model.postponement_status_note))
|
||||
|
||||
|
||||
orderby m_eva_adjust_postponement_update_status.created descending
|
||||
select new eva_adjust_postponement_update_statusViewModel()
|
||||
{
|
||||
id = m_eva_adjust_postponement_update_status.id,
|
||||
postponement_status = m_eva_adjust_postponement_update_status.postponement_status,
|
||||
postponement_status_date = m_eva_adjust_postponement_update_status.postponement_status_date,
|
||||
postponement_status_by = m_eva_adjust_postponement_update_status.postponement_status_by,
|
||||
postponement_status_note = m_eva_adjust_postponement_update_status.postponement_status_note,
|
||||
|
||||
postponement_status_external_linkage_external_name = fk_external_linkageResult1.external_name,
|
||||
postponement_status_by_external_linkage_external_name = fk_external_linkageResult3.fullname,
|
||||
|
||||
isActive = m_eva_adjust_postponement_update_status.isActive,
|
||||
Created = m_eva_adjust_postponement_update_status.created,
|
||||
Updated = m_eva_adjust_postponement_update_status.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel Update(int id, eva_adjust_postponement_update_statusInputModel model, bool is_force_save, int? updateby)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.postponement_status = model.postponement_status;
|
||||
existingEntity.postponement_status_date = DateTime.Now;
|
||||
existingEntity.postponement_status_by = updateby;
|
||||
existingEntity.postponement_status_note = model.postponement_status_note;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
|
||||
//quotaStatus.updateAllpostponement(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_postponement_update_statusViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Dictionary<string,string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("postponement_status", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("postponement_status_external_linkage_external_name", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("postponement_status_date", "วันที่");
|
||||
i.Add("txt_postponement_status_date", "วันที่");
|
||||
i.Add("postponement_status_by", "ปรับสถานะโดย");
|
||||
i.Add("postponement_status_by_external_linkage_external_name", "ปรับสถานะโดย");
|
||||
i.Add("postponement_status_note", "หมายเหตุ");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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_update_statusViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
|
||||
public string txt_postponement_status_date { get { return MyHelper.GetDateStringForReport(this.postponement_status_date); } }
|
||||
|
||||
public int? postponement_status_by { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
public string postponement_status_external_linkage_external_name { get; set; }
|
||||
public string postponement_status_by_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_update_statusWithSelectionViewModel: eva_adjust_postponement_update_statusViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_postponement_status { get; set; }
|
||||
public List<external_employeeViewModel> item_postponement_status_by { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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_quota_update_final_statusService
|
||||
{
|
||||
new eva_adjust_quota_update_final_statusViewModel Update(int id, eva_adjust_quota_update_final_statusInputModel model, bool is_force_save, int? updateby);
|
||||
List<eva_adjust_quota_update_final_statusViewModel> GetListByquota_final_status_note(string quota_final_status_note);
|
||||
List<eva_adjust_quota_update_final_statusViewModel> GetListBySearch(eva_adjust_quota_update_final_statusSearchModel model);
|
||||
|
||||
eva_adjust_quota_update_final_statusWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_quota_update_final_statusWithSelectionViewModel GetBlankItem();
|
||||
eva_adjust_postponementEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
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_quota_update_final_statusInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public string quota_final_status { get; set; }
|
||||
|
||||
public DateTime? quota_final_status_date { get; set; }
|
||||
|
||||
public int? quota_final_status_by { get; set; }
|
||||
|
||||
public string quota_final_status_note { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_quota_update_final_statusReportRequestModel : eva_adjust_quota_update_final_statusSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_quota_update_final_statusSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public string quota_final_status_note { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
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_quota_update_final_statusService : Ieva_adjust_quota_update_final_statusService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private Ieva_adjust_postponement_quotaService quotaStatus;
|
||||
|
||||
public eva_adjust_quota_update_final_statusService(IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb, Iexternal_linkageService inext,
|
||||
Iexternal_employeeService inemp,
|
||||
Ieva_adjust_postponement_quotaService inquotaStatus)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
quotaStatus = inquotaStatus;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponementEntity GetEntity(eva_adjust_quota_update_final_statusInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponementEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponementEntity> GetEntityList(List<eva_adjust_quota_update_final_statusInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementEntity>>(models);
|
||||
}
|
||||
private eva_adjust_quota_update_final_statusViewModel GetDto(eva_adjust_postponementEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_quota_update_final_statusViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_quota_update_final_statusViewModel> GetDtoList(List<eva_adjust_postponementEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_quota_update_final_statusViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_quota_update_final_statusViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponementEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_quota_update_final_statusWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_quota_update_final_statusWithSelectionViewModel>(entity);
|
||||
i.item_quota_final_status = (from x in ext.GetAgreeDisagree5() select x).ToList();
|
||||
i.item_quota_final_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_quota_update_final_statusWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_quota_update_final_statusWithSelectionViewModel();
|
||||
i.item_quota_final_status = (from x in ext.GetAgreeDisagree5() select x).ToList();
|
||||
i.item_quota_final_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_quota_update_final_statusViewModel> GetListByquota_final_status_note(string quota_final_status_note)
|
||||
{
|
||||
var model = new eva_adjust_quota_update_final_statusSearchModel();
|
||||
model.quota_final_status_note = quota_final_status_note;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_quota_update_final_statusViewModel> GetListBySearch(eva_adjust_quota_update_final_statusSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_quota_update_final_status in _repository.Context.eva_adjust_postponement
|
||||
|
||||
join fk_external_linkage1 in ext.GetAgreeDisagree5() on m_eva_adjust_quota_update_final_status.quota_final_status equals fk_external_linkage1.external_code
|
||||
into external_linkageResult1
|
||||
from fk_external_linkageResult1 in external_linkageResult1.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage3 in emp.GetAllEmployee() on m_eva_adjust_quota_update_final_status.quota_final_status_by equals fk_external_linkage3.id
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (string.IsNullOrEmpty(model.quota_final_status_note) || m_eva_adjust_quota_update_final_status.quota_final_status_note.Contains(model.quota_final_status_note))
|
||||
|
||||
|
||||
orderby m_eva_adjust_quota_update_final_status.created descending
|
||||
select new eva_adjust_quota_update_final_statusViewModel()
|
||||
{
|
||||
id = m_eva_adjust_quota_update_final_status.id,
|
||||
quota_final_status = m_eva_adjust_quota_update_final_status.quota_final_status,
|
||||
quota_final_status_date = m_eva_adjust_quota_update_final_status.quota_final_status_date,
|
||||
quota_final_status_by = m_eva_adjust_quota_update_final_status.quota_final_status_by,
|
||||
quota_final_status_note = m_eva_adjust_quota_update_final_status.quota_final_status_note,
|
||||
|
||||
quota_final_status_external_linkage_external_name = fk_external_linkageResult1.external_name,
|
||||
quota_final_status_by_external_linkage_external_name = fk_external_linkageResult3.fullname,
|
||||
|
||||
isActive = m_eva_adjust_quota_update_final_status.isActive,
|
||||
Created = m_eva_adjust_quota_update_final_status.created,
|
||||
Updated = m_eva_adjust_quota_update_final_status.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
public eva_adjust_quota_update_final_statusViewModel Update(int id,
|
||||
eva_adjust_quota_update_final_statusInputModel model, bool is_force_save, int? updateby)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
|
||||
if (existingEntity != null)
|
||||
{
|
||||
if(model.quota_final_status == "Y" && existingEntity.quota_status != "Y")
|
||||
{
|
||||
throw new Exception("ผู้อนุมัติวงเงินที่กันไว้ คนแรก, ยังไม่ได้อนุมัติ วงเงินที่กันไว้");
|
||||
}
|
||||
|
||||
existingEntity.quota_final_status = model.quota_final_status;
|
||||
existingEntity.quota_final_status_date = DateTime.Now;
|
||||
existingEntity.quota_final_status_by = updateby;
|
||||
existingEntity.quota_final_status_note = model.quota_final_status_note;
|
||||
|
||||
if (model.quota_final_status == "N")
|
||||
{
|
||||
existingEntity.quota_status = "W";
|
||||
existingEntity.quota_status_note = existingEntity.quota_final_status_note;
|
||||
}
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
|
||||
quotaStatus.updateAllpostponement(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
|
||||
public eva_adjust_quota_update_final_statusViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_quota_update_final_statusViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
private Dictionary<string,string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("quota_final_status", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("quota_final_status_external_linkage_external_name", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("quota_final_status_date", "วันที่");
|
||||
i.Add("txt_quota_final_status_date", "วันที่");
|
||||
i.Add("quota_final_status_by", "ปรับสถานะโดย");
|
||||
i.Add("quota_final_status_by_external_linkage_external_name", "ปรับสถานะโดย");
|
||||
i.Add("quota_final_status_note", "หมายเหตุ");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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_quota_update_final_statusViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public string quota_final_status { get; set; }
|
||||
|
||||
public DateTime? quota_final_status_date { get; set; }
|
||||
|
||||
public string txt_quota_final_status_date { get { return MyHelper.GetDateStringForReport(this.quota_final_status_date); } }
|
||||
|
||||
public int? quota_final_status_by { get; set; }
|
||||
|
||||
public string quota_final_status_note { get; set; }
|
||||
|
||||
public string quota_final_status_external_linkage_external_name { get; set; }
|
||||
public string quota_final_status_by_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_quota_update_final_statusWithSelectionViewModel: eva_adjust_quota_update_final_statusViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_quota_final_status { get; set; }
|
||||
public List<external_employeeViewModel> item_quota_final_status_by { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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_quota_update_statusService
|
||||
{
|
||||
new eva_adjust_quota_update_statusViewModel Update(int id, eva_adjust_quota_update_statusInputModel model, bool is_force_save, int? updateby);
|
||||
List<eva_adjust_quota_update_statusViewModel> GetListByquota_status_note(string quota_status_note);
|
||||
List<eva_adjust_quota_update_statusViewModel> GetListBySearch(eva_adjust_quota_update_statusSearchModel model);
|
||||
eva_adjust_quota_update_statusWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_quota_update_statusWithSelectionViewModel GetBlankItem();
|
||||
|
||||
eva_adjust_postponementEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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_quota_update_statusInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public string quota_status { get; set; }
|
||||
|
||||
public DateTime? quota_status_date { get; set; }
|
||||
|
||||
public int? quota_status_by { get; set; }
|
||||
|
||||
public string quota_status_note { get; set; }
|
||||
|
||||
public int? quota_status_submit_to { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_quota_update_statusReportRequestModel : eva_adjust_quota_update_statusSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_quota_update_statusSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public string quota_status_note { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
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_quota_update_statusService : Ieva_adjust_quota_update_statusService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private Ieva_adjust_postponement_quotaService quotaStatus;
|
||||
|
||||
public eva_adjust_quota_update_statusService(IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb,
|
||||
Iexternal_linkageService inext,
|
||||
Iexternal_employeeService inemp,
|
||||
Ieva_adjust_postponement_quotaService inquotaStatus)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
quotaStatus = inquotaStatus;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponementEntity GetEntity(eva_adjust_quota_update_statusInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponementEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponementEntity> GetEntityList(List<eva_adjust_quota_update_statusInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementEntity>>(models);
|
||||
}
|
||||
private eva_adjust_quota_update_statusViewModel GetDto(eva_adjust_postponementEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_quota_update_statusViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_quota_update_statusViewModel> GetDtoList(List<eva_adjust_postponementEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_quota_update_statusViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_quota_update_statusViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponementEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_quota_update_statusWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_quota_update_statusWithSelectionViewModel>(entity);
|
||||
i.item_quota_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_quota_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.item_quota_status_submit_to = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_quota_update_statusWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_quota_update_statusWithSelectionViewModel();
|
||||
i.item_quota_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_quota_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.item_quota_status_submit_to = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_quota_update_statusViewModel> GetListByquota_status_note(string quota_status_note)
|
||||
{
|
||||
var model = new eva_adjust_quota_update_statusSearchModel();
|
||||
model.quota_status_note = quota_status_note;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_quota_update_statusViewModel> GetListBySearch(eva_adjust_quota_update_statusSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_quota_update_status in _repository.Context.eva_adjust_postponement
|
||||
|
||||
join fk_external_linkage1 in ext.GetAgreeDisagree4() on m_eva_adjust_quota_update_status.quota_status equals fk_external_linkage1.external_code
|
||||
into external_linkageResult1
|
||||
from fk_external_linkageResult1 in external_linkageResult1.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage3 in emp.GetAllEmployee() on m_eva_adjust_quota_update_status.quota_status_by equals fk_external_linkage3.id
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (string.IsNullOrEmpty(model.quota_status_note) || m_eva_adjust_quota_update_status.quota_status_note.Contains(model.quota_status_note))
|
||||
|
||||
|
||||
orderby m_eva_adjust_quota_update_status.created descending
|
||||
select new eva_adjust_quota_update_statusViewModel()
|
||||
{
|
||||
id = m_eva_adjust_quota_update_status.id,
|
||||
quota_status = m_eva_adjust_quota_update_status.quota_status,
|
||||
quota_status_date = m_eva_adjust_quota_update_status.quota_status_date,
|
||||
quota_status_by = m_eva_adjust_quota_update_status.quota_status_by,
|
||||
quota_status_note = m_eva_adjust_quota_update_status.quota_status_note,
|
||||
|
||||
quota_status_external_linkage_external_name = fk_external_linkageResult1.external_name,
|
||||
quota_status_by_external_linkage_external_name = fk_external_linkageResult3.fullname,
|
||||
|
||||
isActive = m_eva_adjust_quota_update_status.isActive,
|
||||
Created = m_eva_adjust_quota_update_status.created,
|
||||
Updated = m_eva_adjust_quota_update_status.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
public eva_adjust_quota_update_statusViewModel Update(int id, eva_adjust_quota_update_statusInputModel model, bool is_force_save, int? updateby)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
|
||||
if (existingEntity != null)
|
||||
{
|
||||
if (model.quota_status == "Y")
|
||||
{
|
||||
var postponement = from x in _repository.Context.eva_adjust_postponement
|
||||
where x.fiscal_year == existingEntity.fiscal_year
|
||||
&& x.theRound == existingEntity.theRound
|
||||
&& x.id != existingEntity.id
|
||||
&& x.postponement_status != "Y"
|
||||
select x;
|
||||
if (postponement.Count() > 0)
|
||||
{
|
||||
throw new Exception("ยังมีบางหน่วยงาน ยังไม่ได้อนุมัติ ปรับเลื่อนค่าตอบแทน");
|
||||
}
|
||||
}
|
||||
|
||||
existingEntity.quota_status = model.quota_status;
|
||||
existingEntity.quota_status_date = DateTime.Now;
|
||||
existingEntity.quota_status_by = updateby;
|
||||
existingEntity.quota_status_note = model.quota_status_note;
|
||||
existingEntity.quota_status_submit_to = model.quota_status_submit_to;
|
||||
|
||||
if (model.quota_status == "Y")
|
||||
{
|
||||
existingEntity.quota_final_status = "W";
|
||||
existingEntity.quota_final_status_note = existingEntity.quota_status_note;
|
||||
}
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
|
||||
quotaStatus.updateAllpostponement(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
public eva_adjust_quota_update_statusViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_quota_update_statusViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
private Dictionary<string,string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("quota_status", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("quota_status_external_linkage_external_name", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("quota_status_date", "วันที่");
|
||||
i.Add("txt_quota_status_date", "วันที่");
|
||||
i.Add("quota_status_by", "ปรับสถานะโดย");
|
||||
i.Add("quota_status_by_external_linkage_external_name", "ปรับสถานะโดย");
|
||||
i.Add("quota_status_note", "หมายเหตุ");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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_quota_update_statusViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public string quota_status { get; set; }
|
||||
|
||||
public DateTime? quota_status_date { get; set; }
|
||||
|
||||
public string txt_quota_status_date { get { return MyHelper.GetDateStringForReport(this.quota_status_date); } }
|
||||
|
||||
public int? quota_status_by { get; set; }
|
||||
|
||||
public string quota_status_note { get; set; }
|
||||
|
||||
public int? quota_status_submit_to { get; set; }
|
||||
|
||||
public string quota_status_external_linkage_external_name { get; set; }
|
||||
public string quota_status_by_external_linkage_external_name { get; set; }
|
||||
|
||||
public string quota_status_submit_to_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_quota_update_statusWithSelectionViewModel: eva_adjust_quota_update_statusViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_quota_status { get; set; }
|
||||
public List<external_employeeViewModel> item_quota_status_by { get; set; }
|
||||
public List<external_employeeViewModel> item_quota_status_submit_to { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_create_evaluationWithSelectionViewModel>(entity);
|
||||
i.item_performance_plan_id = (from x in _repository.Context.eva_performance_plan select x).ToList();
|
||||
i.item_performance_plan_id = (from x in _repository.Context.eva_performance_plan orderby x.fiscal_year descending, x.theTime descending select x).ToList();
|
||||
i.item_employee_id = all_emp;
|
||||
i.item_evaluation_group_id = (from x in _repository.Context.eva_evaluation_group select x).ToList();
|
||||
i.item_supervisor1_id = all_emp;
|
||||
@@ -85,7 +85,7 @@ namespace TodoAPI2.Models
|
||||
var all_emp = emp.GetAllEmployee();
|
||||
|
||||
var i = new eva_create_evaluationWithSelectionViewModel();
|
||||
i.item_performance_plan_id = (from x in _repository.Context.eva_performance_plan select x).ToList();
|
||||
i.item_performance_plan_id = (from x in _repository.Context.eva_performance_plan orderby x.fiscal_year descending, x.theTime descending select x).ToList();
|
||||
i.item_employee_id = all_emp;
|
||||
i.item_evaluation_group_id = (from x in _repository.Context.eva_evaluation_group select x).ToList();
|
||||
i.item_supervisor1_id = all_emp;
|
||||
@@ -138,7 +138,7 @@ namespace TodoAPI2.Models
|
||||
&& (m_eva_create_evaluation.evaluation_group_id == model.evaluation_group_id || !model.evaluation_group_id.HasValue)
|
||||
|
||||
|
||||
orderby fk_eva_performance_planResult1.fiscal_year, fk_eva_performance_planResult1.theTime, fk_eva_evaluation_groupResult5.code
|
||||
orderby fk_eva_performance_planResult1.fiscal_year descending, fk_eva_performance_planResult1.theTime descending, fk_eva_evaluation_groupResult5.code ascending
|
||||
select new eva_create_evaluationViewModel()
|
||||
{
|
||||
id = m_eva_create_evaluation.id,
|
||||
|
||||
@@ -164,6 +164,7 @@ namespace TodoAPI2.Models
|
||||
employee_id = m_eva_create_evaluation_detail_process.employee_id,
|
||||
chief_fullname = fk_external_chief.fullname,
|
||||
chief_position = fk_external_chief.position_name,
|
||||
supervisor1_remark = m_eva_create_evaluation_detail_process.supervisor1_remark,
|
||||
create_evaluation_id = m_eva_create_evaluation_detail_process.create_evaluation_id,
|
||||
org_id = fk_external_employee.department_id,
|
||||
search_employee_code = fk_external_employee.employee_no,
|
||||
@@ -454,6 +455,9 @@ namespace TodoAPI2.Models
|
||||
|| ((m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id).HasValue && emp_id == (m_eva_create_evaluation_detail_process.supervisor1_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor1_id : fk_eva_create_evaluationResult10.supervisor1_id))
|
||||
|| ((m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id).HasValue && emp_id == (m_eva_create_evaluation_detail_process.supervisor2_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor2_id : fk_eva_create_evaluationResult10.supervisor2_id))
|
||||
|| ((int?[])special_person).Contains(emp_id)
|
||||
|
||||
|| ((m_eva_create_evaluation_detail_process.supervisor3_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor3_id : fk_eva_create_evaluationResult10.supervisor3_id).HasValue && emp_id == (m_eva_create_evaluation_detail_process.supervisor3_id.HasValue ? m_eva_create_evaluation_detail_process.supervisor3_id : fk_eva_create_evaluationResult10.supervisor3_id))
|
||||
|
||||
)
|
||||
&& (!model.employee_id.HasValue || m_eva_create_evaluation_detail_process.employee_id == model.employee_id)
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string chief_position { get; set; }
|
||||
|
||||
public string supervisor1_remark { get; set; }
|
||||
|
||||
public string supervisor2_fullname { get; set; }
|
||||
|
||||
public string supervisor2_position { get; set; }
|
||||
|
||||
@@ -275,6 +275,11 @@ namespace TodoAPI2.Models
|
||||
existingEntity.score4 = i.score2;
|
||||
existingEntity.sumary4 = i.sumary2;
|
||||
}
|
||||
else if (i.who_update == "5")
|
||||
{
|
||||
existingEntity.score4 = i.score2;
|
||||
existingEntity.sumary4 = i.sumary2;
|
||||
}
|
||||
|
||||
//existingEntity.target_score1 = i.target_score1;
|
||||
//existingEntity.target_score2 = i.target_score2;
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace TodoAPI2.Models
|
||||
string GetMainDept(int? dep_id);
|
||||
|
||||
List<external_linkageViewModel> GetSalaryReportType();
|
||||
List<external_linkageViewModel> GetAgreeDisagree4();
|
||||
List<external_linkageViewModel> GetAgreeDisagree5();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -308,6 +308,56 @@ namespace TodoAPI2.Models
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetAgreeDisagree4()
|
||||
{
|
||||
var result = new List<external_linkageViewModel>();
|
||||
|
||||
var k = new external_linkageViewModel();
|
||||
k.external_id = 1;
|
||||
k.external_code = "W";
|
||||
k.external_name = "ระหว่างพิจารณา";
|
||||
result.Add(k);
|
||||
|
||||
var i = new external_linkageViewModel();
|
||||
i.external_id = 2;
|
||||
i.external_code = "Y";
|
||||
i.external_name = "อนุมัติและส่งเงินเดือน";
|
||||
result.Add(i);
|
||||
|
||||
//var j = new external_linkageViewModel();
|
||||
//j.external_id = 3;
|
||||
//j.external_code = "N";
|
||||
//j.external_name = "ตีกลับ";
|
||||
//result.Add(j);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetAgreeDisagree5()
|
||||
{
|
||||
var result = new List<external_linkageViewModel>();
|
||||
|
||||
var k = new external_linkageViewModel();
|
||||
k.external_id = 1;
|
||||
k.external_code = "W";
|
||||
k.external_name = "ระหว่างพิจารณา";
|
||||
result.Add(k);
|
||||
|
||||
var i = new external_linkageViewModel();
|
||||
i.external_id = 2;
|
||||
i.external_code = "Y";
|
||||
i.external_name = "อนุมัติและแสดงแก่พนักงาน";
|
||||
result.Add(i);
|
||||
|
||||
var j = new external_linkageViewModel();
|
||||
j.external_id = 3;
|
||||
j.external_code = "N";
|
||||
j.external_name = "ตีกลับ";
|
||||
result.Add(j);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetDepartmentData()
|
||||
{
|
||||
var sql_parent = string.Format("select" +
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace TodoAPI2.Models
|
||||
public string x2 { get; set; }
|
||||
|
||||
public string thedesc { get; set; }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace TodoAPI2.Models
|
||||
public string image_url { get; set; }
|
||||
public string chief_fullname { get; set; }
|
||||
public string chief_position { get; set; }
|
||||
public string supervisor1_remark { get; set; }
|
||||
public string supervisor2_fullname { get; set; }
|
||||
public string supervisor2_position { get; set; }
|
||||
public string supervisor1A_fullname { get; set; }
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace TodoAPI2.Models
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
|
||||
public string print_dt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
Startup.cs
18
Startup.cs
@@ -345,6 +345,12 @@ namespace Test01
|
||||
services.AddScoped<IBaseRepository2<eva_level_score_detailEntity, Guid>, BaseRepository2<eva_level_score_detailEntity, Guid>>();
|
||||
services.AddScoped<Ieva_level_score_detailService, eva_level_score_detailService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_postponement_update_statusService, eva_adjust_postponement_update_statusService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_quota_update_statusService, eva_adjust_quota_update_statusService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_quota_update_final_statusService, eva_adjust_quota_update_final_statusService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -655,6 +661,18 @@ namespace Test01
|
||||
cfg.CreateMap<eva_level_score_detailInputModel, eva_level_score_detailEntity>();
|
||||
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailViewModel>();
|
||||
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_postponement_update_statusInputModel, eva_adjust_postponementEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_quota_update_statusInputModel, eva_adjust_postponementEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_statusViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_statusWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_quota_update_final_statusInputModel, eva_adjust_postponementEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_final_statusViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_quota_update_final_statusWithSelectionViewModel>();
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -39,8 +39,21 @@ namespace TodoAPI2.Controllers
|
||||
{
|
||||
MyHelper.get_login(HttpContext, emp, Response);
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
return View("eva_self_review_close");
|
||||
//return View();
|
||||
|
||||
//if(HttpContext.Request.Cookies["emp_id"] == "152" // ผอ กลาง
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "180" // ประยูร สีสด
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "107" // ประเดิมสวัสดิ์
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "70" // อังคณา
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "69" // สาริกา
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "64" // ขวัญพิชา
|
||||
// || HttpContext.Request.Cookies["emp_id"] == "161" // อุบลวรรณ
|
||||
// )
|
||||
//{
|
||||
// return View();
|
||||
//}
|
||||
|
||||
//return View("eva_self_review_close");
|
||||
return View();
|
||||
}
|
||||
|
||||
// public IActionResult eva_self_review_d()
|
||||
|
||||
@@ -5,7 +5,55 @@
|
||||
Layout = "_LayoutDirect";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_update_statusModelLabel" 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_update_statusModelLabel">บันทึกข้อมูล การอนุมัติและส่งต่อ</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_update_status_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status" for="eva_adjust_postponement_update_status_postponement_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_date" for="eva_adjust_postponement_update_status_postponement_status_date">วันที่</label>
|
||||
<input disabled class="form-control" type="text" id="eva_adjust_postponement_update_status_postponement_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="false" iGroup="eva_adjust_postponement_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_by" for="eva_adjust_postponement_update_status_postponement_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status_by" iLabel="ปรับสถานะโดย" iRequire="false" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_note" for="eva_adjust_postponement_update_status_postponement_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_postponement_update_status"></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_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
@@ -93,7 +141,7 @@
|
||||
|
||||
<td>
|
||||
|
||||
<button type="button" onclick="javascript:eva_adjust_postponement_normal_PutUpdate()"><i class="fa fa-save"></i>บันทึก</button>
|
||||
<button id="savebtn" type="button" onclick="javascript:eva_adjust_postponement_normal_PutUpdate()"><i class="fa fa-save"></i>บันทึก</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -104,6 +152,11 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button style="display:none;" class="btn btn-info" type="button" onclick="javascript:Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(true)">คำนวณค่าครองชีพใหม่ ตามเกณฑ์เงินเดือน 13,285</button>
|
||||
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_SetEditForm(getUrlParameter('id'), true);">อนุมัติและส่งต่อ ปรับเลื่อนค่าตอบแทน</button>
|
||||
|
||||
<span id="statusapprove"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,16 +222,22 @@
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_postponement_update_status/eva_adjust_postponement_update_status.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var id = getUrlParameter("id");
|
||||
if (id) {
|
||||
eva_adjust_postponement_normal_SetEditForm(id);
|
||||
eva_adjust_postponement_detail_normal_02_InitialForm(id);
|
||||
//eva_adjust_postponement_update_status_InitialForm();
|
||||
|
||||
eva_adjust_postponement_update_status_SetEditForm(getUrlParameter('id'), false);
|
||||
|
||||
} else {
|
||||
eva_adjust_postponement_normal_SetCreateForm();
|
||||
}
|
||||
SetupValidationRemark("eva_adjust_postponement_normal");
|
||||
SetupValidationRemark("eva_adjust_postponement_update_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -5,11 +5,116 @@
|
||||
Layout = "_LayoutDirect";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_quota_update_final_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_quota_update_final_statusModelLabel" 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_quota_update_final_statusModelLabel">บันทึกข้อมูล การอนุมัติและแสดงแก่พนักงาน</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_quota_update_final_status_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status" for="eva_adjust_quota_update_final_status_quota_final_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_final_status_quota_final_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_quota_update_final_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_date" for="eva_adjust_quota_update_final_status_quota_final_status_date">วันที่</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_quota_update_final_status_quota_final_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="false" iGroup="eva_adjust_quota_update_final_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_by" for="eva_adjust_quota_update_final_status_quota_final_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_final_status_quota_final_status_by" iLabel="ปรับสถานะโดย" iRequire="false" iGroup="eva_adjust_quota_update_final_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_note" for="eva_adjust_quota_update_final_status_quota_final_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_quota_update_final_status_quota_final_status_note" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_quota_update_final_status"></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_quota_update_final_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="eva_adjust_quota_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_quota_update_statusModelLabel" 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_quota_update_statusModelLabel">บันทึกข้อมูล การอนุมัติและส่ง</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input class="form-control" type="hidden" id="eva_adjust_quota_update_status_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status" for="eva_adjust_quota_update_status_quota_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_submit_to" for="eva_adjust_quota_update_status_quota_status_submit_to">ส่งต่อไปให้</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status_submit_to" iLabel="ส่งต่อไปให้" iRequire="false" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='row' style="display:none;">
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_date" for="eva_adjust_quota_update_status_quota_status_date">วันที่</label>
|
||||
<input disabled class="form-control" type="text" id="eva_adjust_quota_update_status_quota_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="false" iGroup="eva_adjust_quota_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_by" for="eva_adjust_quota_update_status_quota_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status_by" iLabel="ปรับสถานะโดย" iRequire="false" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_note" for="eva_adjust_quota_update_status_quota_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_quota_update_status_quota_status_note" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_quota_update_status"></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_quota_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="report_xModelLabel">พิมพ์ บันทึกข้อความ</h5>
|
||||
<h5 class="modal-title" id="report_xModelLabel">พิมพ์ วงเงินที่กันไว้</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
@@ -28,7 +133,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@@ -70,7 +174,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_adjust_postponement_quota_theRound" for="eva_adjust_postponement_quota_theRound">ครั้งที่เลื่อน</label>
|
||||
|
||||
<select class="form-control" id="eva_adjust_postponement_quota_theRound" iLabel="ครั้งที่เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_quota">
|
||||
<select class="form-control" id="eva_adjust_postponement_quota_theRound" iLabel="ครั้งที่เลื่อน" iRequire="true" iGroup="eva_adjust_postponement_quota">
|
||||
<option value="">กรุณาเลือก</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
@@ -98,12 +202,12 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<br />
|
||||
|
||||
<br/>
|
||||
<br />
|
||||
|
||||
<table style="position:fixed; bottom:0px; left:0px; background-color:black; width:100%; z-index:100;">
|
||||
<tr>
|
||||
@@ -114,7 +218,7 @@
|
||||
<td><input disabled placeholder="0.00" class="form-control money mask_plugin" type="text" id="eva_adjust_postponement_quota_limit_quota" iLabel="จำนวนเงินที่สามารถบริหารวงเงินที่กันไว้" iRequire="true" iGroup="eva_adjust_postponement_quota" /></td>
|
||||
<td><label style="color:white;" for="remain_quota">จำนวนเงินโควต้าพิเศษคงเหลือ</label></td>
|
||||
<td><input disabled placeholder="0.00" class="form-control money mask_plugin" type="text" id="remain_quota" iLabel="จำนวนเงินโควต้าพิเศษคงเหลือ" iRequire="false" iGroup="eva_adjust_postponement_quota" /></td>
|
||||
<td><button type="button" onclick="javascript:eva_adjust_postponement_quota_PutUpdate()">บันทึก</button></td>
|
||||
<td><button id="saveBtn" type="button" onclick="javascript:eva_adjust_postponement_quota_PutUpdate()">บันทึก</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -124,8 +228,21 @@
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button style="display:none;" class="btn btn-info" type="button" onclick="javascript:CalculateRemainQuota(true)">คำนวณค่าครองชีพใหม่ ตามเกณฑ์เงินเดือน 13,285</button>
|
||||
<button type="button" class="btn btn-submit" onclick="javascript:rep_eva_savemessage_DoSearch('pdf')">พิมพ์ บันทึกข้อความ</button>
|
||||
<p>สถานะ ปรับเลื่อนค่าตอบแทน</p>
|
||||
<span id="previousstatus"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button style="display:none;" class="btn btn-info" type="button" onclick="javascript:CalculateRemainQuota(true)">คำนวณค่าครองชีพใหม่ ตามเกณฑ์เงินเดือน 13,285</button>
|
||||
<button type="button" class="btn btn-submit" onclick="javascript:rep_eva_savemessage_DoSearch('pdf')">พิมพ์ วงเงินที่กันไว้</button>
|
||||
<button class="btn btn-info thesubmit" onclick="javascript:makeApprove();">อนุมัติและส่งเงินเดือน</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:makeWaiting();">รอพิจารณาเงินเดือน</button>
|
||||
<span id="statusapprove" class="thesubmit"></span>
|
||||
<!--
|
||||
<button class="btn btn-info thesubmit2" onclick="javascript:eva_adjust_quota_update_final_status_GoEdit(getUrlParameter('id'), true);">อนุมัติและแสดงแก่พนักงาน</button>
|
||||
<span id="statusfinalapprove" class="thesubmit2"></span>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,19 +286,32 @@
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_quota_update_status/eva_adjust_quota_update_status.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_quota_update_final_status/eva_adjust_quota_update_final_status.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var id = getUrlParameter("id");
|
||||
if (id) {
|
||||
eva_adjust_postponement_quota_SetEditForm(id);
|
||||
setTimeout(function(){ eva_adjust_postponement_detail_quota_02_InitialForm(getUrlParameter("id")) }, 800);
|
||||
$(document).ready(function () {
|
||||
var id = getUrlParameter("id");
|
||||
if (id) {
|
||||
eva_adjust_postponement_quota_SetEditForm(id);
|
||||
setTimeout(function () { eva_adjust_postponement_detail_quota_02_InitialForm(getUrlParameter("id")) }, 800);
|
||||
|
||||
} else {
|
||||
eva_adjust_postponement_quota_SetCreateForm();
|
||||
}
|
||||
SetupValidationRemark("eva_adjust_postponement_quota");
|
||||
SetupValidationRemark("eva_adjust_postponement_detail_quota");
|
||||
});
|
||||
reloadQuotaStatus();
|
||||
|
||||
//eva_adjust_quota_update_status_GoEdit(getUrlParameter('id'), false);
|
||||
//eva_adjust_quota_update_final_status_GoEdit(getUrlParameter('id'), false);
|
||||
} else {
|
||||
eva_adjust_postponement_quota_SetCreateForm();
|
||||
}
|
||||
|
||||
$("#eva_adjust_quota_update_status_quota_status_submit_to").select2({
|
||||
dropdownParent: $('#eva_adjust_quota_update_statusModel')
|
||||
});
|
||||
|
||||
SetupValidationRemark("eva_adjust_postponement_quota");
|
||||
SetupValidationRemark("eva_adjust_postponement_detail_quota");
|
||||
SetupValidationRemark("eva_adjust_quota_update_status");
|
||||
SetupValidationRemark("eva_adjust_quota_update_final_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_postponement_update_status";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_update_statusModelLabel" 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_update_statusModelLabel">บันทึกข้อมูล eva_adjust_postponement_update_status</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_update_status_id" />
|
||||
|
||||
<div class='row'></div>
|
||||
<div class='row'></div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status" for="eva_adjust_postponement_update_status_postponement_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_date" for="eva_adjust_postponement_update_status_postponement_status_date">วันที่</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_update_status_postponement_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="true" iGroup="eva_adjust_postponement_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_by" for="eva_adjust_postponement_update_status_postponement_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status_by" iLabel="ปรับสถานะโดย" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_note" for="eva_adjust_postponement_update_status_postponement_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_postponement_update_status"></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_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">eva_adjust_postponement_update_status</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>ค้นหา eva_adjust_postponement_update_status</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_update_status_postponement_status_note' for='s_eva_adjust_postponement_update_status_postponement_status_note'>หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="s_eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="s_eva_adjust_postponement_update_status" title='หมายเหตุ' placeholder='หมายเหตุ'></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_postponement_update_statusTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_id'>รหัสอ้างอิง</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status'>สถานะการปรับเลื่อนเงินเดือน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_date'>วันที่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_by'>ปรับสถานะโดย</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_note'>หมายเหตุ</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_update_status/eva_adjust_postponement_update_status.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_postponement_update_status_InitiateDataTable();
|
||||
eva_adjust_postponement_update_status_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_postponement_update_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_quota_update_final_status";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_quota_update_final_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_quota_update_final_statusModelLabel" 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_quota_update_final_statusModelLabel">บันทึกข้อมูล eva_adjust_quota_update_final_status</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_quota_update_final_status_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status" for="eva_adjust_quota_update_final_status_quota_final_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_final_status_quota_final_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_quota_update_final_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_date" for="eva_adjust_quota_update_final_status_quota_final_status_date">วันที่</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_quota_update_final_status_quota_final_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="false" iGroup="eva_adjust_quota_update_final_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_by" for="eva_adjust_quota_update_final_status_quota_final_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_final_status_quota_final_status_by" iLabel="ปรับสถานะโดย" iRequire="false" iGroup="eva_adjust_quota_update_final_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_quota_update_final_status_quota_final_status_note" for="eva_adjust_quota_update_final_status_quota_final_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_quota_update_final_status_quota_final_status_note" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_quota_update_final_status"></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_quota_update_final_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">eva_adjust_quota_update_final_status</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>ค้นหา eva_adjust_quota_update_final_status</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_quota_update_final_status_quota_final_status_note' for='s_eva_adjust_quota_update_final_status_quota_final_status_note'>หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="s_eva_adjust_quota_update_final_status_quota_final_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="s_eva_adjust_quota_update_final_status" title='หมายเหตุ' placeholder='หมายเหตุ'></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_quota_update_final_status_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_quota_update_final_status_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_quota_update_final_status_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_quota_update_final_statusTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_quota_update_final_status_id'>รหัสอ้างอิง</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_final_status_quota_final_status'>สถานะการปรับเลื่อนเงินเดือน</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_final_status_quota_final_status_date'>วันที่</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_final_status_quota_final_status_by'>ปรับสถานะโดย</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_final_status_quota_final_status_note'>หมายเหตุ</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_quota_update_final_status/eva_adjust_quota_update_final_status.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_quota_update_final_status_InitiateDataTable();
|
||||
eva_adjust_quota_update_final_status_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_quota_update_final_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_quota_update_status";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_quota_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_quota_update_statusModelLabel" 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_quota_update_statusModelLabel">บันทึกข้อมูล eva_adjust_quota_update_status</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_quota_update_status_id" />
|
||||
|
||||
<div class='row'></div>
|
||||
<div class='row'></div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status" for="eva_adjust_quota_update_status_quota_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_date" for="eva_adjust_quota_update_status_quota_status_date">วันที่</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_quota_update_status_quota_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="true" iGroup="eva_adjust_quota_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_by" for="eva_adjust_quota_update_status_quota_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status_by" iLabel="ปรับสถานะโดย" iRequire="true" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_note" for="eva_adjust_quota_update_status_quota_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_quota_update_status_quota_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_quota_update_status"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_quota_update_status_quota_status_submit_to" for="eva_adjust_quota_update_status_quota_status_submit_to">ส่งต่อไปให้</label>
|
||||
<select class="form-control" id="eva_adjust_quota_update_status_quota_status_submit_to" iLabel="ส่งต่อไปให้" iRequire="true" iGroup="eva_adjust_quota_update_status"></select>
|
||||
</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_quota_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">eva_adjust_quota_update_status</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>ค้นหา eva_adjust_quota_update_status</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_quota_update_status_quota_status_note' for='s_eva_adjust_quota_update_status_quota_status_note'>หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="s_eva_adjust_quota_update_status_quota_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="s_eva_adjust_quota_update_status" title='หมายเหตุ' placeholder='หมายเหตุ'></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_quota_update_status_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_quota_update_status_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_quota_update_status_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_quota_update_statusTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_id'>รหัสอ้างอิง</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_quota_status'>สถานะการปรับเลื่อนเงินเดือน</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_quota_status_date'>วันที่</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_quota_status_by'>ปรับสถานะโดย</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_quota_status_note'>หมายเหตุ</label></th>
|
||||
<th><label id='h_eva_adjust_quota_update_status_quota_status_submit_to'>ส่งต่อไปให้</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_quota_update_status/eva_adjust_quota_update_status.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_quota_update_status_InitiateDataTable();
|
||||
eva_adjust_quota_update_status_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_quota_update_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -735,6 +735,7 @@
|
||||
}
|
||||
|
||||
function Oneva_create_evaluation_detail_review05_supervisor3A_resultChanged(a) {
|
||||
console.log("Oneva_create_evaluation_detail_review05_supervisor3A_resultChanged = " + $(a).val());
|
||||
if ($(a).val() == "Y") {
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_remark").attr("iRequire", "false");
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_remark").css('border-color', '');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"connectionStrings": {
|
||||
"mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2_eva2;User ID=postgres;Password=ZdPr0jects;",
|
||||
"externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2_eva2;User ID=postgres;Password=ZdPr0jects;"
|
||||
"mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;",
|
||||
"externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;"
|
||||
//"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;",
|
||||
//"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;"
|
||||
},
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
<None Remove="Files\**" />
|
||||
<None Remove="Uploads\**" />
|
||||
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
|
||||
<None Include="Views\eva_adjust_postponement_update_statusView\eva_adjust_postponement_update_status.cshtml" />
|
||||
<None Include="Views\eva_adjust_quota_update_final_statusView\eva_adjust_quota_update_final_status.cshtml" />
|
||||
<None Include="Views\eva_adjust_quota_update_statusView\eva_adjust_quota_update_status.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc_d.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_historyView\eva_create_evaluation_detail_history.cshtml" />
|
||||
@@ -86,6 +89,9 @@
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration_d.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_update_status\eva_adjust_postponement_update_status.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_quota_update_final_status\eva_adjust_quota_update_final_status.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_quota_update_status\eva_adjust_quota_update_status.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc_d.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_history\eva_create_evaluation_detail_history.js" />
|
||||
|
||||
195
tb320eva.xml
195
tb320eva.xml
@@ -896,6 +896,201 @@
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_update_statusController},TodoAPI2.Models.Ieva_adjust_postponement_update_statusService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<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_update_statusController.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_update_statusController.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_update_statusController.GetList(System.String)">
|
||||
<summary>
|
||||
Get list items by postponement_status_note
|
||||
</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_update_statusController.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_update_statusSearchModel)">
|
||||
<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_update_statusController.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_update_statusInputModel)">
|
||||
<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_quota_update_final_statusController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_quota_update_final_statusController},TodoAPI2.Models.Ieva_adjust_quota_update_final_statusService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="inemp"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_quota_update_final_statusController.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_quota_update_final_statusController.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_quota_update_final_statusController.GetList(System.String)">
|
||||
<summary>
|
||||
Get list items by quota_final_status_note
|
||||
</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_quota_update_final_statusController.GetListBySearch(TodoAPI2.Models.eva_adjust_quota_update_final_statusSearchModel)">
|
||||
<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_quota_update_final_statusController.eva_adjust_quota_update_final_status_report(TodoAPI2.Models.eva_adjust_quota_update_final_statusReportRequestModel)">
|
||||
<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_quota_update_final_statusController.Update(System.Int32,TodoAPI2.Models.eva_adjust_quota_update_final_statusInputModel)">
|
||||
<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_quota_update_statusController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_quota_update_statusController},TodoAPI2.Models.Ieva_adjust_quota_update_statusService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
<param name="inemp"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_quota_update_statusController.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_quota_update_statusController.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_quota_update_statusController.GetList(System.String)">
|
||||
<summary>
|
||||
Get list items by quota_status_note
|
||||
</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_quota_update_statusController.GetListBySearch(TodoAPI2.Models.eva_adjust_quota_update_statusSearchModel)">
|
||||
<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_quota_update_statusController.Update(System.Int32,TodoAPI2.Models.eva_adjust_quota_update_statusInputModel)">
|
||||
<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_create_evaluationController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluationController},TodoAPI2.Models.Ieva_create_evaluationService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
@@ -163,7 +163,7 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_reward_old_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input class="form-control" onchange="Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(true)" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input class="form-control edittext" onchange="Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(true)" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input disabled class="form-control" 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>';
|
||||
@@ -225,6 +225,7 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
|
||||
});
|
||||
//eva_adjust_postponement_detail_normal_02_Summary();
|
||||
Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(true);
|
||||
checkEnableForm();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
|
||||
@@ -148,7 +148,7 @@ function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
|
||||
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) + '" /><p style="display:none;" id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1) + '" /></td>';
|
||||
|
||||
tag += '<td><input onchange="CalculateRemainQuota(false);" class="form-control" type="number" id="eva_adjust_postponement_detail_quota_02_receive_quota_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><input onchange="CalculateRemainQuota(false);" class="form-control editQuota" 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" disabled type="number" id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1) + '" /></td>';
|
||||
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_reward_new2_' + (i + 1) + '" /></td>';
|
||||
@@ -209,12 +209,14 @@ function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
|
||||
});
|
||||
|
||||
$("#eva_adjust_postponement_quota_limit").val(sum_current_salary);
|
||||
console.log(sum_current_salary);
|
||||
//console.log(sum_current_salary);
|
||||
|
||||
$("#sum_current_salary").maskMoney('mask', sum_current_salary);
|
||||
|
||||
Oneva_adjust_postponement_quota_limit_frame_quotaChange();
|
||||
|
||||
showHideForm();
|
||||
|
||||
//CalculateRemainQuota(false);
|
||||
endLoad();
|
||||
};
|
||||
|
||||
@@ -3,6 +3,9 @@ var eva_adjust_postponement_quota_API = "/api/eva_adjust_postponement_quota/";
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
var quota_status_submit_to = -1;
|
||||
var managed_by = -1;
|
||||
|
||||
function eva_adjust_postponement_quota_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_quota_id").val(data.id);
|
||||
$("#eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
|
||||
@@ -17,6 +20,22 @@ function eva_adjust_postponement_quota_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_quota_limit").val(data.limit);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_quota_managed_by"), data, "id", "fullname", "item_managed_by", getCookie("emp_id"));
|
||||
//console.log($("#eva_adjust_postponement_quota_limit").val());
|
||||
|
||||
//console.log(data);
|
||||
|
||||
var previousstatus = "";
|
||||
|
||||
$.each(data.approve_status, function (index, value) {
|
||||
//console.log(index + ": " + value);
|
||||
previousstatus += "<li>" + value + "</li>"
|
||||
});
|
||||
|
||||
$("#previousstatus").html("<ol>"+previousstatus+"</ol>");
|
||||
|
||||
quota_status_submit_to = data.quota_status_submit_to;
|
||||
managed_by = data.managed_by;
|
||||
|
||||
//console.log(getCookie("emp_id"));
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_quota_GetFromForm() {
|
||||
@@ -181,7 +200,7 @@ function CalculateRemainQuota(m) {
|
||||
var new_sarary_with_quota = new_sarary + receive_quota;
|
||||
|
||||
|
||||
console.log(new_sarary);
|
||||
//console.log(new_sarary);
|
||||
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(formatNumber(new_sarary_with_quota));
|
||||
|
||||
//if (m) {
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
var eva_adjust_postponement_update_status_editMode = "CREATE";
|
||||
var eva_adjust_postponement_update_status_API = "/api/eva_adjust_postponement_update_status/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_update_status_GetSearchParameter() {
|
||||
var eva_adjust_postponement_update_statusSearchObject = new Object();
|
||||
eva_adjust_postponement_update_statusSearchObject.postponement_status_note = $("#s_eva_adjust_postponement_update_status_postponement_status_note").val();
|
||||
|
||||
return eva_adjust_postponement_update_statusSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_postponement_update_status_postponement_status_note").val(data.postponement_status_note);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function checkEnableForm() {
|
||||
if ($("#eva_adjust_postponement_update_status_postponement_status").val() === "Y") {
|
||||
$(".edittext").attr("disabled", true);
|
||||
$("#savebtn").hide();
|
||||
} else {
|
||||
$(".edittext").attr("disabled", false);
|
||||
$("#savebtn").show();
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_update_status_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_update_status_postponement_status"), data, "external_code", "external_name", "item_postponement_status", data.postponement_status);
|
||||
$("#eva_adjust_postponement_update_status_postponement_status_date").val(formatDate(data.postponement_status_date));
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_update_status_postponement_status_by"), data, "id", "fullname", "item_postponement_status_by", data.postponement_status_by);
|
||||
$("#eva_adjust_postponement_update_status_postponement_status_note").val(data.postponement_status_note);
|
||||
|
||||
var statusText = $("#eva_adjust_postponement_update_status_postponement_status option:selected").text();
|
||||
if ($("#eva_adjust_postponement_update_status_postponement_status_by option:selected").text() !== "")
|
||||
statusText += " โดย " + $("#eva_adjust_postponement_update_status_postponement_status_by option:selected").text();
|
||||
$("#statusapprove").text(statusText);
|
||||
|
||||
//console.log(data);
|
||||
|
||||
checkEnableForm();
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GetFromForm() {
|
||||
var eva_adjust_postponement_update_statusObject = new Object();
|
||||
eva_adjust_postponement_update_statusObject.id = $("#eva_adjust_postponement_update_status_id").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status = $("#eva_adjust_postponement_update_status_postponement_status").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_date = getDate($("#eva_adjust_postponement_update_status_postponement_status_date").val());
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_by = $("#eva_adjust_postponement_update_status_postponement_status_by").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_note = $("#eva_adjust_postponement_update_status_postponement_status_note").val();
|
||||
|
||||
|
||||
return eva_adjust_postponement_update_statusObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_update_status_FeedDataToForm(result);
|
||||
eva_adjust_postponement_update_status_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_update_status_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_postponement_update_status_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_update_statusView/eva_adjust_postponement_update_status_d");
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GoEdit(a, b) {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_SetEditForm(a, b);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_update_statusView/eva_adjust_postponement_update_status_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_SetEditForm(a, b) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_update_status_editMode = "UPDATE";
|
||||
eva_adjust_postponement_update_status_FeedDataToForm(result);
|
||||
if(b) $("#eva_adjust_postponement_update_statusModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_update_status_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_SetCreateForm(s) {
|
||||
eva_adjust_postponement_update_status_editMode = "CREATE";
|
||||
eva_adjust_postponement_update_status_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_postponement_update_status_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_adjust_postponement_update_status_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_update_status_PutUpdate() {
|
||||
|
||||
if (!confirm("คุณยืนยันการบันทึกสถานะการอนุมัติ ใช่หรือไม่?")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateForm('eva_adjust_postponement_update_status', eva_adjust_postponement_update_status_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_postponement_update_status_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_postponement_update_status_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_postponement_update_status_RefreshTable();
|
||||
|
||||
eva_adjust_postponement_update_status_SetEditForm(getUrlParameter('id'), false);
|
||||
window.location.reload();
|
||||
console.log("window.location.reload()");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_postponement_update_status_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_postponement_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_postponement_update_status_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_postponement_update_status_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_postponement_update_statusTableV;
|
||||
|
||||
var eva_adjust_postponement_update_status_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_postponement_update_statusTableV = $('#eva_adjust_postponement_update_statusTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "id" },
|
||||
{ "data": "postponement_status_external_linkage_external_name" },
|
||||
{ "data": "txt_postponement_status_date" },
|
||||
{ "data": "postponement_status_by_external_linkage_external_name" },
|
||||
{ "data": "postponement_status_note" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_update_status_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_update_status_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_update_status_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_postponement_update_status_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_update_status/GetListBySearch?" + p, eva_adjust_postponement_update_status_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_DoSearch() {
|
||||
var p = $.param(eva_adjust_postponement_update_status_GetSearchParameter());
|
||||
var eva_adjust_postponement_update_status_reload = function (result) {
|
||||
eva_adjust_postponement_update_statusTableV.destroy();
|
||||
eva_adjust_postponement_update_status_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_update_status/GetListBySearch?" + p, eva_adjust_postponement_update_status_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GetSelect(f) {
|
||||
var eva_adjust_postponement_update_status_selectitem = [];
|
||||
$.each(eva_adjust_postponement_update_statusTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_postponement_update_status_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_postponement_update_status_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
var eva_adjust_quota_update_final_status_editMode = "CREATE";
|
||||
var eva_adjust_quota_update_final_status_API = "/api/eva_adjust_quota_update_final_status/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_quota_update_final_status_GetSearchParameter() {
|
||||
var eva_adjust_quota_update_final_statusSearchObject = new Object();
|
||||
eva_adjust_quota_update_final_statusSearchObject.quota_final_status_note = $("#s_eva_adjust_quota_update_final_status_quota_final_status_note").val();
|
||||
|
||||
return eva_adjust_quota_update_final_statusSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_quota_update_final_status_quota_final_status_note").val(data.quota_final_status_note);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_quota_update_final_status_FeedDataToForm(data) {
|
||||
//console.log(data);
|
||||
$("#eva_adjust_quota_update_final_status_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_quota_update_final_status_quota_final_status"), data, "external_code", "external_name", "item_quota_final_status", data.quota_final_status);
|
||||
$("#eva_adjust_quota_update_final_status_quota_final_status_date").val(formatDate(data.quota_final_status_date));
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_quota_update_final_status_quota_final_status_by"), data, "id", "fullname", "item_quota_final_status_by", data.quota_final_status_by);
|
||||
$("#eva_adjust_quota_update_final_status_quota_final_status_note").val(data.quota_final_status_note);
|
||||
|
||||
var statusfinalText = $("#eva_adjust_quota_update_final_status_quota_final_status option:selected").text();
|
||||
if ($("#eva_adjust_quota_update_final_status_quota_final_status_by option:selected").text() !== "")
|
||||
statusfinalText += " โดย " + $("#eva_adjust_quota_update_final_status_quota_final_status_by option:selected").text();
|
||||
|
||||
if (statusfinalText !== "กรุณาเลือก โดย กรุณาเลือก") $("#statusfinalapprove").text(statusfinalText);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_GetFromForm() {
|
||||
var eva_adjust_quota_update_final_statusObject = new Object();
|
||||
eva_adjust_quota_update_final_statusObject.id = $("#eva_adjust_quota_update_final_status_id").val();
|
||||
eva_adjust_quota_update_final_statusObject.quota_final_status = $("#eva_adjust_quota_update_final_status_quota_final_status").val();
|
||||
eva_adjust_quota_update_final_statusObject.quota_final_status_date = getDate($("#eva_adjust_quota_update_final_status_quota_final_status_date").val());
|
||||
eva_adjust_quota_update_final_statusObject.quota_final_status_by = $("#eva_adjust_quota_update_final_status_quota_final_status_by").val();
|
||||
eva_adjust_quota_update_final_statusObject.quota_final_status_note = $("#eva_adjust_quota_update_final_status_quota_final_status_note").val();
|
||||
|
||||
|
||||
return eva_adjust_quota_update_final_statusObject;
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_quota_update_final_status_FeedDataToForm(result);
|
||||
eva_adjust_quota_update_final_status_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_quota_update_final_statusModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_quota_update_final_status_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_quota_update_final_status_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_final_status_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_quota_update_final_statusView/eva_adjust_quota_update_final_status_d");
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_GoEdit(a, b) {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_final_status_SetEditForm(a, b);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_quota_update_final_statusView/eva_adjust_quota_update_final_status_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_SetEditForm(a, b) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_quota_update_final_status_editMode = "UPDATE";
|
||||
eva_adjust_quota_update_final_status_FeedDataToForm(result);
|
||||
if (b) $("#eva_adjust_quota_update_final_statusModel").modal("show");
|
||||
|
||||
showHideForm();
|
||||
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_quota_update_final_status_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_SetCreateForm(s) {
|
||||
eva_adjust_quota_update_final_status_editMode = "CREATE";
|
||||
eva_adjust_quota_update_final_status_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_final_status_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_quota_update_final_status_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
function showHideForm() {
|
||||
|
||||
//console.log($("#eva_adjust_quota_update_status_quota_status").val());
|
||||
//console.log($("#eva_adjust_quota_update_final_status_quota_final_status").val());
|
||||
|
||||
if ($("#eva_adjust_quota_update_status_quota_status").val() === "Y" &&
|
||||
$("#eva_adjust_quota_update_final_status_quota_final_status").val() !== "Y") {
|
||||
//console.log("CON 1");
|
||||
}
|
||||
else if ($("#eva_adjust_quota_update_status_quota_status").val() === "Y" &&
|
||||
$("#eva_adjust_quota_update_final_status_quota_final_status").val() === "Y") {
|
||||
|
||||
$(".editQuota").prop('disabled', true);
|
||||
$("#saveBtn").hide();
|
||||
|
||||
//console.log("CON 2");
|
||||
}
|
||||
|
||||
//$(".thesubmit").hide();
|
||||
$(".thesubmit2").hide();
|
||||
|
||||
if (parseInt(getCookie("emp_id")) === quota_status_submit_to) $(".thesubmit2").show();
|
||||
//if (parseInt(getCookie("emp_id")) === managed_by) $(".thesubmit").show();
|
||||
|
||||
//console.log(managed_by);
|
||||
//console.log(getCookie("emp_id"));
|
||||
|
||||
if ($("#eva_adjust_quota_update_status_quota_status").val() !== "Y")
|
||||
{
|
||||
$(".thesubmit2").hide();
|
||||
}
|
||||
}
|
||||
|
||||
var eva_adjust_quota_update_final_status_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_quota_update_final_status_PutUpdate() {
|
||||
if (!ValidateForm('eva_adjust_quota_update_final_status', eva_adjust_quota_update_final_status_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_quota_update_final_status_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_quota_update_final_status_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_quota_update_final_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_quota_update_final_status_RefreshTable();
|
||||
|
||||
reloadQuotaStatus();
|
||||
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_quota_update_final_status_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_quota_update_final_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_quota_update_final_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_quota_update_final_status_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_quota_update_final_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_quota_update_final_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_quota_update_final_status_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_quota_update_final_statusTableV;
|
||||
|
||||
var eva_adjust_quota_update_final_status_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_quota_update_final_statusTableV = $('#eva_adjust_quota_update_final_statusTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "id" },
|
||||
{ "data": "quota_final_status_external_linkage_external_name" },
|
||||
{ "data": "txt_quota_final_status_date" },
|
||||
{ "data": "quota_final_status_by_external_linkage_external_name" },
|
||||
{ "data": "quota_final_status_note" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_quota_update_final_status_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_quota_update_final_status_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_adjust_quota_update_final_status_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_quota_update_final_status_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_quota_update_final_status/GetListBySearch?" + p, eva_adjust_quota_update_final_status_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_DoSearch() {
|
||||
var p = $.param(eva_adjust_quota_update_final_status_GetSearchParameter());
|
||||
var eva_adjust_quota_update_final_status_reload = function (result) {
|
||||
eva_adjust_quota_update_final_statusTableV.destroy();
|
||||
eva_adjust_quota_update_final_status_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_quota_update_final_status/GetListBySearch?" + p, eva_adjust_quota_update_final_status_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_final_status_GetSelect(f) {
|
||||
var eva_adjust_quota_update_final_status_selectitem = [];
|
||||
$.each(eva_adjust_quota_update_final_statusTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_quota_update_final_status_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_quota_update_final_status_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
var eva_adjust_quota_update_status_editMode = "CREATE";
|
||||
var eva_adjust_quota_update_status_API = "/api/eva_adjust_quota_update_status/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_quota_update_status_GetSearchParameter() {
|
||||
var eva_adjust_quota_update_statusSearchObject = new Object();
|
||||
eva_adjust_quota_update_statusSearchObject.quota_status_note = $("#s_eva_adjust_quota_update_status_quota_status_note").val();
|
||||
|
||||
return eva_adjust_quota_update_statusSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_quota_update_status_quota_status_note").val(data.quota_status_note);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_quota_update_status_FeedDataToForm(data) {
|
||||
$("#eva_adjust_quota_update_status_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_quota_update_status_quota_status"), data, "external_code", "external_name", "item_quota_status", data.quota_status);
|
||||
$("#eva_adjust_quota_update_status_quota_status_date").val(formatDate(data.quota_status_date));
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_quota_update_status_quota_status_by"), data, "id", "fullname", "item_quota_status_by", data.quota_status_by);
|
||||
$("#eva_adjust_quota_update_status_quota_status_note").val(data.quota_status_note);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_quota_update_status_quota_status_submit_to"), data, "id", "fullname", "item_quota_status_submit_to", data.quota_status_submit_to);
|
||||
|
||||
var statusText = $("#eva_adjust_quota_update_status_quota_status option:selected").text();
|
||||
if ($("#eva_adjust_quota_update_status_quota_status_by option:selected").text() !== "")
|
||||
statusText += " โดย " + $("#eva_adjust_quota_update_status_quota_status_by option:selected").text();
|
||||
|
||||
if (statusText != "กรุณาเลือก โดย กรุณาเลือก") $("#statusapprove").text(statusText);
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_GetFromForm() {
|
||||
var eva_adjust_quota_update_statusObject = new Object();
|
||||
eva_adjust_quota_update_statusObject.id = $("#eva_adjust_quota_update_status_id").val();
|
||||
eva_adjust_quota_update_statusObject.quota_status = $("#eva_adjust_quota_update_status_quota_status").val();
|
||||
eva_adjust_quota_update_statusObject.quota_status_date = getDate($("#eva_adjust_quota_update_status_quota_status_date").val());
|
||||
eva_adjust_quota_update_statusObject.quota_status_by = $("#eva_adjust_quota_update_status_quota_status_by").val();
|
||||
eva_adjust_quota_update_statusObject.quota_status_note = $("#eva_adjust_quota_update_status_quota_status_note").val();
|
||||
eva_adjust_quota_update_statusObject.quota_status_submit_to = $("#eva_adjust_quota_update_status_quota_status_submit_to").val();
|
||||
|
||||
return eva_adjust_quota_update_statusObject;
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_quota_update_status_FeedDataToForm(result);
|
||||
eva_adjust_quota_update_status_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_quota_update_statusModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_quota_update_status_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function makeApprove() {
|
||||
if (confirm("ท่านต้องการอนุมัติวงเงินที่กันไว้ และแสดงแก่เจ้าหน้าที่แห่งเนติบัณฑิตยสภา ใช่หรือไม่?")) {
|
||||
$("#eva_adjust_quota_update_status_quota_status").val("Y");
|
||||
eva_adjust_quota_update_status_PutUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
function makeWaiting() {
|
||||
$("#eva_adjust_quota_update_status_quota_status").val("W");
|
||||
eva_adjust_quota_update_status_PutUpdate();
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_status_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_quota_update_statusView/eva_adjust_quota_update_status_d");
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_GoEdit(a, b) {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_status_SetEditForm(a,b);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_quota_update_statusView/eva_adjust_quota_update_status_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_SetEditForm(a,b) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_quota_update_status_editMode = "UPDATE";
|
||||
eva_adjust_quota_update_status_FeedDataToForm(result);
|
||||
if (b) $("#eva_adjust_quota_update_statusModel").modal("show");
|
||||
|
||||
eva_adjust_quota_update_final_status_GoEdit(getUrlParameter('id'), false);
|
||||
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_quota_update_status_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_SetCreateForm(s) {
|
||||
eva_adjust_quota_update_status_editMode = "CREATE";
|
||||
eva_adjust_quota_update_status_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_quota_update_status_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_quota_update_status_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
function reloadQuotaStatus() {
|
||||
eva_adjust_quota_update_status_GoEdit(getUrlParameter('id'), false);
|
||||
}
|
||||
|
||||
var eva_adjust_quota_update_status_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_quota_update_status_PutUpdate() {
|
||||
|
||||
//if (!confirm("คุณยืนยันการบันทึกสถานะการอนุมัติ ใช่หรือไม่?")) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (!ValidateForm('eva_adjust_quota_update_status', eva_adjust_quota_update_status_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_quota_update_status_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_quota_update_status_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_quota_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_quota_update_status_RefreshTable();
|
||||
|
||||
|
||||
reloadQuotaStatus();
|
||||
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_quota_update_status_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_quota_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_quota_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_quota_update_status_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_quota_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_quota_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_quota_update_status_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_quota_update_statusTableV;
|
||||
|
||||
var eva_adjust_quota_update_status_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_quota_update_statusTableV = $('#eva_adjust_quota_update_statusTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "id" },
|
||||
{ "data": "quota_status_external_linkage_external_name" },
|
||||
{ "data": "txt_quota_status_date" },
|
||||
{ "data": "quota_status_by_external_linkage_external_name" },
|
||||
{ "data": "quota_status_note" },
|
||||
{ "data": "quota_status_submit_to_external_linkage_external_name" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_quota_update_status_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_quota_update_status_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_adjust_quota_update_status_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_quota_update_status_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_quota_update_status/GetListBySearch?" + p, eva_adjust_quota_update_status_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_DoSearch() {
|
||||
var p = $.param(eva_adjust_quota_update_status_GetSearchParameter());
|
||||
var eva_adjust_quota_update_status_reload = function (result) {
|
||||
eva_adjust_quota_update_statusTableV.destroy();
|
||||
eva_adjust_quota_update_status_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_quota_update_status/GetListBySearch?" + p, eva_adjust_quota_update_status_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_quota_update_status_GetSelect(f) {
|
||||
var eva_adjust_quota_update_status_selectitem = [];
|
||||
$.each(eva_adjust_quota_update_statusTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_quota_update_status_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_quota_update_status_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
@@ -168,8 +168,9 @@ var eva_create_evaluation_detail_history_setupTable = function (result) {
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
"paging": false,
|
||||
"searching": false,
|
||||
"ordering": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
@@ -4,23 +4,23 @@ var eva_create_evaluation_detail_review05_API = "/api/eva_create_evaluation_deta
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_review05_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_review05_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_review05_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A").val(data.supervisor3A);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review05_supervisor3A_result"), data, "id", "external_name", "item_supervisor3A_result", data.supervisor3A_result);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_remark").val(data.supervisor3A_remark);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_date").val(formatDate(data.supervisor3A_date));
|
||||
$("#eva_create_evaluation_detail_review05_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_review05_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A").val(data.supervisor3A);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review05_supervisor3A_result"), data, "external_code", "external_name", "item_supervisor3A_result", data.supervisor3A_result);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_remark").val(data.supervisor3A_remark);
|
||||
$("#eva_create_evaluation_detail_review05_supervisor3A_date").val(formatDate(data.supervisor3A_date));
|
||||
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_review05_GetFromForm() {
|
||||
var eva_create_evaluation_detail_review05Object = new Object();
|
||||
eva_create_evaluation_detail_review05Object.id = $("#eva_create_evaluation_detail_review05_id").val();
|
||||
eva_create_evaluation_detail_review05Object.create_evaluation_id = $("#eva_create_evaluation_detail_review05_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A = $("#eva_create_evaluation_detail_review05_supervisor3A").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_result = $("#eva_create_evaluation_detail_review05_supervisor3A_result").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_remark = $("#eva_create_evaluation_detail_review05_supervisor3A_remark").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_date = getDate($("#eva_create_evaluation_detail_review05_supervisor3A_date").val());
|
||||
eva_create_evaluation_detail_review05Object.id = $("#eva_create_evaluation_detail_review05_id").val();
|
||||
eva_create_evaluation_detail_review05Object.create_evaluation_id = $("#eva_create_evaluation_detail_review05_create_evaluation_id").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A = $("#eva_create_evaluation_detail_review05_supervisor3A").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_result = $("#eva_create_evaluation_detail_review05_supervisor3A_result").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_remark = $("#eva_create_evaluation_detail_review05_supervisor3A_remark").val();
|
||||
eva_create_evaluation_detail_review05Object.supervisor3A_date = getDate($("#eva_create_evaluation_detail_review05_supervisor3A_date").val());
|
||||
|
||||
|
||||
return eva_create_evaluation_detail_review05Object;
|
||||
@@ -29,9 +29,9 @@ eva_create_evaluation_detail_review05Object.supervisor3A_date = getDate($("#eva_
|
||||
function eva_create_evaluation_detail_review05_InitialForm() {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_review05_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_review05_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -41,15 +41,15 @@ function eva_create_evaluation_detail_review05_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_review05_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_review05_FeedDataToForm(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_review05_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_review05_SetCreateForm() {
|
||||
eva_create_evaluation_detail_review05_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_review05_InitialForm();
|
||||
eva_create_evaluation_detail_review05_InitialForm();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
@@ -59,8 +59,7 @@ var eva_create_evaluation_detail_review05_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_review05_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail_review05', eva_create_evaluation_detail_review05_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation_detail_review05', eva_create_evaluation_detail_review05_customValidation)) {
|
||||
return;
|
||||
}
|
||||
var data = eva_create_evaluation_detail_review05_GetFromForm();
|
||||
@@ -68,19 +67,19 @@ function eva_create_evaluation_detail_review05_PutUpdate() {
|
||||
//Update Mode
|
||||
if (eva_create_evaluation_detail_review05_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
endLoad();
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_review05_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
endLoad();
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_review05_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -88,11 +87,11 @@ function eva_create_evaluation_detail_review05_PutUpdate() {
|
||||
function eva_create_evaluation_detail_review05_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
AlertSuccess(result.code+" "+result.message);
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_create_evaluation_detail_review05_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_review05_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ function eva_create_evaluation_detail_summary2_FeedDataToForm(data, role_code) {
|
||||
$("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor1A);
|
||||
$("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor1A);
|
||||
}
|
||||
else if(role_code === "4"){
|
||||
else if (role_code === "4" || role_code === "5"){
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor2A);
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor2A);
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor2A);
|
||||
|
||||
@@ -34,8 +34,8 @@ function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem,
|
||||
data.score4 = Number(data.score4).toFixed(3);
|
||||
data.sumary4 = Number(data.sumary4).toFixed(3);
|
||||
|
||||
//console.log(role_code);
|
||||
//console.log(data);
|
||||
console.log(role_code);
|
||||
console.log(data);
|
||||
|
||||
if (role_code === "2") {
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text(data.score);
|
||||
@@ -55,7 +55,7 @@ function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem,
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3);
|
||||
}
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3);
|
||||
} else if (role_code === "4") {
|
||||
} else if (role_code === "4" || role_code === "5") {
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text(data.score3);
|
||||
$("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3);
|
||||
if (data.score4 === "0.000") {
|
||||
@@ -64,16 +64,17 @@ function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem,
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4);
|
||||
}
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4);
|
||||
} else if (role_code === "5") {
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text(data.score4);
|
||||
$("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary4);
|
||||
if (data.score5 === "0.000") {
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4);
|
||||
} else {
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score5);
|
||||
}
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary5);
|
||||
}
|
||||
//else if (role_code === "5") {
|
||||
// $("#eva_evaluation_achievement_process2_score_" + i).text(data.score4);
|
||||
// $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary4);
|
||||
// if (data.score5 === "0.000") {
|
||||
// $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4);
|
||||
// } else {
|
||||
// $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score5);
|
||||
// }
|
||||
// $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary5);
|
||||
//}
|
||||
|
||||
//$("#eva_evaluation_achievement_process2_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_achievement_process2_target_score2_" + i).val(data.target_score2);
|
||||
|
||||
@@ -52,7 +52,7 @@ function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, rol
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3);
|
||||
}
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3);
|
||||
} else if (role_code === "4") {
|
||||
} else if (role_code === "4" || role_code === "5") {
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score3);
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3);
|
||||
if (data.score4 === "0.000") {
|
||||
@@ -61,17 +61,19 @@ function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, rol
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4);
|
||||
}
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4);
|
||||
} else if (role_code === "5") {
|
||||
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score4);
|
||||
$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary4);
|
||||
if (data.score5 === "0.000") {
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4);
|
||||
} else {
|
||||
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score5);
|
||||
}
|
||||
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary5);
|
||||
}
|
||||
|
||||
//else if (role_code === "5") {
|
||||
// $("#eva_evaluation_behavior_process2_score_" + i).text(data.score4);
|
||||
// $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary4);
|
||||
// if (data.score5 === "0.000") {
|
||||
// $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4);
|
||||
// } else {
|
||||
// $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score5);
|
||||
// }
|
||||
// $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary5);
|
||||
//}
|
||||
|
||||
//$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1);
|
||||
//$("#eva_evaluation_behavior_process2_target_score2_" + i).val(data.target_score2);
|
||||
//$("#eva_evaluation_behavior_process2_target_score3_" + i).val(data.target_score3);
|
||||
|
||||
Reference in New Issue
Block a user