Compare commits
84 Commits
pond_20210
...
94bf0709d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94bf0709d1 | ||
|
|
71f1906d79 | ||
|
|
f5ebda01bf | ||
|
|
ba57633ab8 | ||
|
|
9774fb0a9c | ||
|
|
c6d107e179 | ||
|
|
61f067f150 | ||
|
|
f6afc23b45 | ||
|
|
67a4c35f8e | ||
|
|
aae66b1d97 | ||
|
|
b6e27e9f12 | ||
|
|
afc4429e63 | ||
|
|
4b98790d2e | ||
|
|
6d0a2ace7d | ||
|
|
260c542b10 | ||
|
|
0d0e309589 | ||
|
|
7baab53365 | ||
|
|
8e8596116f | ||
|
|
4d7f6186d5 | ||
|
|
40d91d2ad2 | ||
|
|
26f416ec46 | ||
|
|
544d1224de | ||
|
|
f6b58c8406 | ||
|
|
77c8e31dcd | ||
|
|
ee76b39491 | ||
|
|
3b8d643eca | ||
|
|
8a02127499 | ||
|
|
3db2768ed5 | ||
|
|
887c4d05dc | ||
|
|
df7d36b06b | ||
|
|
ac0e022966 | ||
|
|
686f22eddb | ||
|
|
32db80e4aa | ||
|
|
07d70e4a66 | ||
|
|
40de9ca053 | ||
|
|
be227895a5 | ||
|
|
e5cb49c75e | ||
|
|
d6d125cea0 | ||
|
|
64f6c4b1af | ||
|
|
c520fb9a99 | ||
|
|
a71c8bb11e | ||
|
|
fe365008c2 | ||
|
|
0aac403a33 | ||
|
|
14c7df9d17 | ||
|
|
dacfe151cf | ||
|
|
3016221910 | ||
|
|
e201075167 | ||
|
|
7fdf9f7b01 | ||
|
|
d4212da199 | ||
|
|
646bf3e249 | ||
|
|
656d991f07 | ||
|
|
fdb09a2427 | ||
|
|
98dd8b0860 | ||
|
|
edc9bf053e | ||
|
|
a898de8ab2 | ||
|
|
ccacb814a3 | ||
|
|
c86841c480 | ||
|
|
65d454ca74 | ||
|
|
23c3142058 | ||
|
|
ef178b8120 | ||
|
|
095d8b1a60 | ||
|
|
f1dad78f66 | ||
|
|
91b4e67522 | ||
|
|
e64f675036 | ||
|
|
d0d9b50238 | ||
|
|
440454b7dd | ||
|
|
b44c25e2d7 | ||
|
|
e91666e9db | ||
|
|
8735c12bd7 | ||
|
|
910ef472ec | ||
|
|
a108bbbc4a | ||
|
|
1c01a326b2 | ||
|
|
a5664503f0 | ||
|
|
5747602eb5 | ||
|
|
38a2e1fe88 | ||
|
|
dce57d2ca1 | ||
|
|
99389df14d | ||
|
|
93ce18f352 | ||
|
|
3de7c45968 | ||
|
|
18303d092f | ||
|
|
622fb46323 | ||
|
|
6f06b1e544 | ||
|
|
9aa338ff18 | ||
|
|
c7745f6ab4 |
@@ -15,6 +15,7 @@ using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
@@ -315,6 +316,47 @@ namespace TodoAPI2.Controllers
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("rep_eva_savemessage")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult rep_eva_savemessage(rep_eva_savemessageReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
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");
|
||||
|
||||
_repository.setModelFor_rep_eva_savemessageReport(model);
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva_savemessage.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"Exception while GetReport. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,9 @@ namespace TodoAPI2.Controllers
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
var result = _repository.GetBlankItemWithEmp(e.id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,10 @@ namespace TodoAPI2.Controllers
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
var result = _repository.GetBlankItemWithEmp(e.id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
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_create_evaluation_detail_review05")]
|
||||
public class eva_create_evaluation_detail_review05Controller : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_create_evaluation_detail_review05Controller> _logger;
|
||||
private Ieva_create_evaluation_detail_review05Service _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_create_evaluation_detail_review05Controller(ILogger<eva_create_evaluation_detail_review05Controller> logger, Ieva_create_evaluation_detail_review05Service repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_create_evaluation_detail_review05WithSelectionViewModel), 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_create_evaluation_detail_review05WithSelectionViewModel), 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 create_evaluation_id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("")]
|
||||
[ProducesResponseType(typeof(List<eva_create_evaluation_detail_review05ViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(int? create_evaluation_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBycreate_evaluation_id(create_evaluation_id));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_create_evaluation_detail_review05ViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_create_evaluation_detail_review05SearchModel 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>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_create_evaluation_detail_review05InputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(int id, [FromBody] eva_create_evaluation_detail_review05InputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(int id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_create_evaluation_detail_review05InputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
403
ApiControllers/eva_level_score_detailControllers.cs
Normal file
403
ApiControllers/eva_level_score_detailControllers.cs
Normal file
@@ -0,0 +1,403 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_level_score_detail")]
|
||||
public class eva_level_score_detailController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_level_score_detailController> _logger;
|
||||
private Ieva_level_score_detailService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_level_score_detailController(ILogger<eva_level_score_detailController> logger, Ieva_level_score_detailService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_level_score_detailWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(Guid 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_level_score_detailWithSelectionViewModel), 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 level_score_id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("")]
|
||||
[ProducesResponseType(typeof(List<eva_level_score_detailViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(Guid level_score_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBylevel_score_id(level_score_id));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_level_score_detailViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_level_score_detailSearchModel 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_level_score_detail_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_level_score_detail_report(eva_level_score_detailReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_level_score_detailInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(Guid id, [FromBody] eva_level_score_detailInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(Guid id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_level_score_detailInputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
403
ApiControllers/eva_setup_permissionControllers.cs
Normal file
403
ApiControllers/eva_setup_permissionControllers.cs
Normal file
@@ -0,0 +1,403 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_setup_permission")]
|
||||
public class eva_setup_permissionController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_setup_permissionController> _logger;
|
||||
private Ieva_setup_permissionService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_setup_permissionController(ILogger<eva_setup_permissionController> logger, Ieva_setup_permissionService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_setup_permissionWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(Guid 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_setup_permissionWithSelectionViewModel), 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 remark
|
||||
/// </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_setup_permissionViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string remark)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListByremark(remark));
|
||||
}
|
||||
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_setup_permissionViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_setup_permissionSearchModel 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_setup_permission_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult eva_setup_permission_report(eva_setup_permissionReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create new item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Insert([FromBody] eva_setup_permissionInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Insert(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"เพิ่มข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while insert.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(Guid id, [FromBody] eva_setup_permissionInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.Update(id, model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"แก้ไขข้อมูล เรียบร้อย";
|
||||
message.data = result;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpDelete("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Delete(Guid id)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.Delete(id);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ลบข้อมูล เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
|
||||
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update multiple item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("UpdateMultiple")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult UpdateMultiple([FromBody] List<eva_setup_permissionInputModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
string rowCount = _repository.UpdateMultiple(model, true);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh AutoField of all items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("RefreshAutoField")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RefreshAutoField()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
_repository.RefreshAutoFieldOfAllData();
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
|
||||
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,9 @@ namespace TodoAPI2.Controllers
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
_repository.SetEvaDate(model);
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
|
||||
@@ -271,10 +271,65 @@ namespace TodoAPI2.Controllers
|
||||
|
||||
var rep_type = new int[] { 1, 2, 3, 4, 5 };
|
||||
|
||||
var loginPositionName = (from i in emp.GetAllEmployee()
|
||||
where i.id.ToString() == Request.Cookies["emp_id"]
|
||||
select i.position_name).FirstOrDefault();
|
||||
|
||||
foreach (var k in rep_type)
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(loginPositionName))
|
||||
//{
|
||||
// if (!(loginPositionName == "นักทรัพยากรบุคคล" || loginPositionName.Contains("ผู้อำนวยการ"))
|
||||
// && (k == 2 || k == 3 || k == 4 || k == 5)
|
||||
// )
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//}
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva_x{k}.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
|
||||
if(k == 3)
|
||||
{
|
||||
if (p1.chief_fullname == p1.supervisor2_fullname)
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}A.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
if (!string.IsNullOrEmpty(p1.supervisor3A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}AC.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(p1.supervisor2A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}A2.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(p1.supervisor2A_fullname) && string.IsNullOrEmpty(p1.supervisor1A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}B.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
else if (string.IsNullOrEmpty(p1.supervisor2A_fullname) && string.IsNullOrEmpty(p1.supervisor1A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}B2.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
else if (string.IsNullOrEmpty(p1.supervisor3A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}C.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (p1.supervisor1A_fullname == p1.supervisor2A_fullname || string.IsNullOrEmpty(p1.supervisor2A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}C2.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p1.employee_position_type == "อำนวยการ" && k == 1)
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}a.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
|
||||
PdfReader reader = new PdfReader(data);
|
||||
@@ -296,6 +351,18 @@ namespace TodoAPI2.Controllers
|
||||
return data2;
|
||||
}
|
||||
|
||||
private string checkLevel(int? position_type_id, string position_level_text, string name)
|
||||
{
|
||||
if (position_type_id.HasValue)
|
||||
{
|
||||
if(position_type_id == 3 || position_type_id == 4 || position_type_id == 5)
|
||||
{
|
||||
return " " + position_level_text;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private rep_eva_xInputModel2 GetParameter(int detail_id)
|
||||
{
|
||||
var i = new rep_eva_xInputModel2();
|
||||
@@ -312,6 +379,8 @@ namespace TodoAPI2.Controllers
|
||||
if (i.employee_org != null) i.employee_org = i.employee_org.Replace("แผนก", "");
|
||||
|
||||
i.employee_position = p.employee_position;
|
||||
i.employee_position_full = p.employee_position + checkLevel(p.employee_position_type_id, p.employee_position_level_text, p.employee_fullname);
|
||||
|
||||
if (!string.IsNullOrEmpty(p.employee_profile_picture))
|
||||
{
|
||||
i.image_url = MyHelper.GetConfig(Configuration, "SiteInformation:hr_svc") + "/api/image/" + p.employee_profile_picture;
|
||||
@@ -330,19 +399,23 @@ namespace TodoAPI2.Controllers
|
||||
}
|
||||
|
||||
i.chief_fullname = p.chief_fullname;
|
||||
i.chief_position = p.chief_position;
|
||||
i.chief_position = p.chief_position + checkLevel(p.chief_position_type_id, p.chief_position_level_text, p.chief_fullname);
|
||||
i.supervisor2_fullname = p.supervisor2_fullname;
|
||||
i.supervisor2_position = p.supervisor2_position;
|
||||
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;
|
||||
i.supervisor1A_position = p.supervisor1A_position;
|
||||
i.supervisor1A_position = p.supervisor1A_position + checkLevel(p.supervisor1A_position_type_id, p.supervisor1A_position_level_text, p.supervisor1A_fullname);
|
||||
i.supervisor2A_fullname = p.supervisor2A_fullname;
|
||||
i.supervisor2A_position = p.supervisor2A_position;
|
||||
i.supervisor2A_position = p.supervisor2A_position + checkLevel(p.supervisor2A_position_type_id, p.supervisor2A_position_level_text, p.supervisor2A_fullname);
|
||||
i.supervisor3A_fullname = p.supervisor3A_fullname;
|
||||
i.supervisor3A_position = p.supervisor3A_position + checkLevel(p.supervisor3A_position_type_id, p.supervisor3A_position_level_text, p.supervisor3A_fullname);
|
||||
i.main_dept = p.employee_main_dept;
|
||||
|
||||
if (i.main_dept != null) i.main_dept = i.main_dept.Replace("กอง","");
|
||||
|
||||
i.leave_period = MyHelper.GetDateStringForReport(p.start_date) + " ถึง " + MyHelper.GetDateStringForReport(p.end_date);
|
||||
i.leave_period = MyHelper.GetDateStringForReport(p.leave_start_date) + " ถึง " + MyHelper.GetDateStringForReport(p.leave_end_date);
|
||||
i.selected_round = p.selected_round;
|
||||
i.plan_remark = p.plan_remark;
|
||||
i.eva_detail_remark = p.eva_detail_remark;
|
||||
|
||||
var context = _process.GetDataContext();
|
||||
var all_eva = (from x in context.eva_performance_plan
|
||||
@@ -355,8 +428,8 @@ namespace TodoAPI2.Controllers
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.start_date).Min();
|
||||
var end = (from n in context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.end_date).Min();
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.end_date).Max();
|
||||
var text = MyHelper.GetDateStringForReport(start) + " ถึง " + MyHelper.GetDateStringForReport(end);
|
||||
if(x2.theTime == 1)
|
||||
{
|
||||
@@ -368,6 +441,11 @@ namespace TodoAPI2.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(i.round2_text))
|
||||
{
|
||||
i.round2_text = $"1 เมษายน {p.fiscal_year} ถึง 30 กันยายน {p.fiscal_year}";
|
||||
}
|
||||
|
||||
var detail = (from x in context.eva_create_evaluation_detail
|
||||
where x.id == detail_id
|
||||
select x).FirstOrDefault();
|
||||
@@ -388,9 +466,9 @@ namespace TodoAPI2.Controllers
|
||||
i.w1 = p.create_evaluation_score1;
|
||||
i.w2 = p.create_evaluation_score2;
|
||||
|
||||
if(p.start_date.HasValue && p.end_date.HasValue)
|
||||
if(p.leave_start_date.HasValue && p.leave_end_date.HasValue)
|
||||
{
|
||||
var q = emp.GetLeaveOfEmployee(p.employee_id.Value, p.start_date, p.end_date);
|
||||
var q = emp.GetLeaveOfEmployee(p.employee_id.Value, p.leave_start_date, p.leave_end_date);
|
||||
i.sum_day_sick_leave = q.sum_day_sick_leave;
|
||||
i.count_sick_leave = q.count_sick_leave;
|
||||
i.sum_day_personal_leave = q.sum_day_personal_leave;
|
||||
@@ -408,12 +486,39 @@ namespace TodoAPI2.Controllers
|
||||
i.txt_status_chief_a_click_date = MyHelper.GetDateStringForReport(p.status_chief_a_click_date);
|
||||
if (i.txt_status_chief_a_click_date == "") i.txt_status_chief_a_click_date = "..................................";
|
||||
|
||||
i.txt_status_self_click_date = MyHelper.GetDateStringForReport(p.status_self_click_date);
|
||||
if (i.txt_status_self_click_date == "") i.txt_status_self_click_date = "..................................";
|
||||
i.txt_status_chief_click_date = MyHelper.GetDateStringForReport(p.status_chief_click_date);
|
||||
if (i.txt_status_chief_click_date == "") i.txt_status_chief_click_date = "..................................";
|
||||
|
||||
i.txt_status_supervisor_click_date = MyHelper.GetDateStringForReport(p.status_supervisor_click_date);
|
||||
if (i.txt_status_supervisor_click_date == "") i.txt_status_supervisor_click_date = "..................................";
|
||||
i.txt_status_supervisor1A_click_date = MyHelper.GetDateStringForReport(p.status_supervisor1A_click_date);
|
||||
if (i.txt_status_supervisor1A_click_date == "") i.txt_status_supervisor1A_click_date = "..................................";
|
||||
i.txt_status_supervisor2A_click_date = MyHelper.GetDateStringForReport(p.status_supervisor2A_click_date);
|
||||
if (i.txt_status_supervisor2A_click_date == "") i.txt_status_supervisor2A_click_date = "..................................";
|
||||
i.txt_status_supervisor3A_click_date = MyHelper.GetDateStringForReport(p.status_supervisor3A_click_date);
|
||||
if (i.txt_status_supervisor3A_click_date == "") i.txt_status_supervisor3A_click_date = "..................................";
|
||||
|
||||
i.print_dt = MyHelper.GetDateStringForReport(DateTime.Now) + " " + MyHelper.GetTimeStringFromDate(DateTime.Now);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
private void checkValue(eva_create_evaluation_detailEntity detail, ref rep_eva_xInputModel2 i)
|
||||
{
|
||||
if (detail.status_supervisor2A == "Y")
|
||||
if (detail.status_supervisor3A == "Y")
|
||||
{
|
||||
i.total_summary_supervisor2a = detail.total_summary_supervisor3A;
|
||||
i.final_summary_supervisor2a = detail.Final_summary_supervisor3A;
|
||||
i.total_summary_competency_supervisor2a = detail.total_summary_competency_supervisor3A;
|
||||
i.final_summary_competency_supervisor2a = detail.Final_summary_competency_supervisor3A;
|
||||
i.achievement_supervisor2a = detail.achievement_supervisor3A;
|
||||
i.competency_supervisor2a = detail.competency_supervisor3A;
|
||||
i.score_supervisor2a = detail.score_supervisor3A;
|
||||
i.level_score_supervisor2a = detail.level_score_supervisor3A;
|
||||
}
|
||||
else if (detail.status_supervisor2A == "Y")
|
||||
{
|
||||
i.total_summary_supervisor2a = detail.total_summary_supervisor2A;
|
||||
i.final_summary_supervisor2a = detail.Final_summary_supervisor2A;
|
||||
@@ -435,7 +540,7 @@ namespace TodoAPI2.Controllers
|
||||
i.score_supervisor2a = detail.score_supervisor1A;
|
||||
i.level_score_supervisor2a = detail.level_score_supervisor1A;
|
||||
}
|
||||
else if (detail.status_supervisor == "Y")
|
||||
else if (detail.status_supervisor == "Y" || detail.supervisor2_result == "Y")
|
||||
{
|
||||
i.total_summary_supervisor2a = detail.total_summary_supervisor;
|
||||
i.final_summary_supervisor2a = detail.Final_summary_supervisor;
|
||||
|
||||
125
ApiControllers/rep_summary_a01Controllers.cs
Normal file
125
ApiControllers/rep_summary_a01Controllers.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/rep_summary_a01")]
|
||||
public class rep_summary_a01Controller : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<rep_summary_a01Controller> _logger;
|
||||
private Irep_summary_a01Service _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public rep_summary_a01Controller(ILogger<rep_summary_a01Controller> logger, Irep_summary_a01Service repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(rep_summary_a01WithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("rep_summary_a01_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult rep_summary_a01_report(rep_summary_a01ReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
model.round_text = _repository.GetDisplayText(model.round_id);
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_summary_a01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
if (model.filetype == "xlsx")
|
||||
{
|
||||
url += "&ignorePagination=true";
|
||||
}
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ namespace TTSW.EF {
|
||||
public DbSet<eva_create_evaluation_detailEntity> eva_create_evaluation_detail { get; set; }
|
||||
//public DbSet<eva_create_evaluation_detail_agreementEntity> eva_create_evaluation_detail_agreement { get; set; }
|
||||
public DbSet<eva_evaluation_achievementEntity> eva_evaluation_achievement { get; set; }
|
||||
|
||||
public DbSet<eva_evaluation_achievement_detailEntity> eva_evaluation_achievement_detail { get; set; }
|
||||
public DbSet<eva_evaluation_behaviorEntity> eva_evaluation_behavior { get; set; }
|
||||
public DbSet<eva_evaluation_groupEntity> eva_evaluation_group { get; set; }
|
||||
public DbSet<eva_evaluation_group_detailEntity> eva_evaluation_group_detail { get; set; }
|
||||
@@ -43,11 +45,10 @@ namespace TTSW.EF {
|
||||
public DbSet<eva_limit_frame_planEntity> eva_limit_frame_plan { get; set; }
|
||||
public DbSet<eva_idp_planEntity> eva_idp_plan { get; set; }
|
||||
public DbSet<eva_create_evaluation_detail_historyEntity> eva_create_evaluation_detail_history { get; set; }
|
||||
|
||||
public DbSet<eva_evaluation_achievement_attachEntity> eva_evaluation_achievement_attach { get; set; }
|
||||
|
||||
public DbSet<activity_log_evaEntity> activity_log_eva { get; set; }
|
||||
|
||||
public DbSet<eva_setup_permissionEntity> eva_setup_permission { get; set; }
|
||||
public DbSet<eva_level_score_detailEntity> eva_level_score_detail { get; set; }
|
||||
protected override void OnModelCreating (ModelBuilder modelBuilder) {
|
||||
|
||||
base.OnModelCreating (modelBuilder);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
EXCEL/eva_level_score@rep_summary_a01.xlsx
Normal file
BIN
EXCEL/eva_level_score@rep_summary_a01.xlsx
Normal file
Binary file not shown.
BIN
EXCEL/eva_level_score_detail.xlsx
Normal file
BIN
EXCEL/eva_level_score_detail.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
EXCEL/eva_setup_permission.xlsx
Normal file
BIN
EXCEL/eva_setup_permission.xlsx
Normal file
Binary file not shown.
1077
Migrations/20210824033819_UpdateCylindar.Designer.cs
generated
Normal file
1077
Migrations/20210824033819_UpdateCylindar.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Migrations/20210824033819_UpdateCylindar.cs
Normal file
22
Migrations/20210824033819_UpdateCylindar.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class UpdateCylindar : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "salary_max",
|
||||
table: "eva_salary_cylinder",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "salary_max",
|
||||
table: "eva_salary_cylinder");
|
||||
}
|
||||
}
|
||||
}
|
||||
1081
Migrations/20210827031202_EnhancePlan.Designer.cs
generated
Normal file
1081
Migrations/20210827031202_EnhancePlan.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
Migrations/20210827031202_EnhancePlan.cs
Normal file
32
Migrations/20210827031202_EnhancePlan.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class EnhancePlan : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "end_leave",
|
||||
table: "eva_performance_plan",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "start_leave",
|
||||
table: "eva_performance_plan",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "end_leave",
|
||||
table: "eva_performance_plan");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "start_leave",
|
||||
table: "eva_performance_plan");
|
||||
}
|
||||
}
|
||||
}
|
||||
1084
Migrations/20210910071115_AddRemark2.Designer.cs
generated
Normal file
1084
Migrations/20210910071115_AddRemark2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
Migrations/20210910071115_AddRemark2.cs
Normal file
23
Migrations/20210910071115_AddRemark2.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddRemark2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "remark2",
|
||||
table: "eva_limit_frame_group",
|
||||
maxLength: 4000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "remark2",
|
||||
table: "eva_limit_frame_group");
|
||||
}
|
||||
}
|
||||
}
|
||||
1086
Migrations/20210911074335_AddHistoryField.Designer.cs
generated
Normal file
1086
Migrations/20210911074335_AddHistoryField.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Migrations/20210911074335_AddHistoryField.cs
Normal file
22
Migrations/20210911074335_AddHistoryField.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddHistoryField : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "history_group",
|
||||
table: "eva_create_evaluation_detail_history",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "history_group",
|
||||
table: "eva_create_evaluation_detail_history");
|
||||
}
|
||||
}
|
||||
}
|
||||
1089
Migrations/20210914074108_UpdateRemarkToPlan.Designer.cs
generated
Normal file
1089
Migrations/20210914074108_UpdateRemarkToPlan.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
Migrations/20210914074108_UpdateRemarkToPlan.cs
Normal file
23
Migrations/20210914074108_UpdateRemarkToPlan.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class UpdateRemarkToPlan : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "remark",
|
||||
table: "eva_performance_plan",
|
||||
maxLength: 500,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "remark",
|
||||
table: "eva_performance_plan");
|
||||
}
|
||||
}
|
||||
}
|
||||
1092
Migrations/20210914083030_UpdateRemarkToEvaDetail.Designer.cs
generated
Normal file
1092
Migrations/20210914083030_UpdateRemarkToEvaDetail.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
Migrations/20210914083030_UpdateRemarkToEvaDetail.cs
Normal file
23
Migrations/20210914083030_UpdateRemarkToEvaDetail.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class UpdateRemarkToEvaDetail : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "remark",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "remark",
|
||||
table: "eva_create_evaluation_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1096
Migrations/20211005133544_AddRewardSalary.Designer.cs
generated
Normal file
1096
Migrations/20211005133544_AddRewardSalary.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
Migrations/20211005133544_AddRewardSalary.cs
Normal file
31
Migrations/20211005133544_AddRewardSalary.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddRewardSalary : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "reward_new",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "reward_old",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "reward_new",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "reward_old",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1098
Migrations/20211005143227_AddRewardSalary2.Designer.cs
generated
Normal file
1098
Migrations/20211005143227_AddRewardSalary2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Migrations/20211005143227_AddRewardSalary2.cs
Normal file
22
Migrations/20211005143227_AddRewardSalary2.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddRewardSalary2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "reward_new2",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "reward_new2",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1118
Migrations/20211016124831_AddEvaPermission.Designer.cs
generated
Normal file
1118
Migrations/20211016124831_AddEvaPermission.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
33
Migrations/20211016124831_AddEvaPermission.cs
Normal file
33
Migrations/20211016124831_AddEvaPermission.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddEvaPermission : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "eva_setup_permission",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(nullable: false),
|
||||
created = table.Column<DateTime>(nullable: false),
|
||||
updated = table.Column<DateTime>(nullable: false),
|
||||
isActive = table.Column<bool>(nullable: false),
|
||||
employee_id = table.Column<int>(nullable: true),
|
||||
remark = table.Column<string>(maxLength: 4000, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_eva_setup_permission", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "eva_setup_permission");
|
||||
}
|
||||
}
|
||||
}
|
||||
1123
Migrations/20211016161223_AddFlowAgreement.Designer.cs
generated
Normal file
1123
Migrations/20211016161223_AddFlowAgreement.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
33
Migrations/20211016161223_AddFlowAgreement.cs
Normal file
33
Migrations/20211016161223_AddFlowAgreement.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddFlowAgreement : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "status_supervisor_a",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 1,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "status_supervisor_a_click_date",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "status_supervisor_a",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "status_supervisor_a_click_date",
|
||||
table: "eva_create_evaluation_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1158
Migrations/20211028033728_UpdateFieldLength.Designer.cs
generated
Normal file
1158
Migrations/20211028033728_UpdateFieldLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
Migrations/20211028033728_UpdateFieldLength.cs
Normal file
49
Migrations/20211028033728_UpdateFieldLength.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class UpdateFieldLength : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "behavior",
|
||||
table: "eva_evaluation_behavior",
|
||||
maxLength: 16000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 1000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "achievement",
|
||||
table: "eva_evaluation_achievement",
|
||||
maxLength: 16000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 8000,
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "behavior",
|
||||
table: "eva_evaluation_behavior",
|
||||
maxLength: 1000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 16000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "achievement",
|
||||
table: "eva_evaluation_achievement",
|
||||
maxLength: 8000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 16000,
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
1158
Migrations/20211028034057_UpdateFieldLength2.Designer.cs
generated
Normal file
1158
Migrations/20211028034057_UpdateFieldLength2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
Migrations/20211028034057_UpdateFieldLength2.cs
Normal file
49
Migrations/20211028034057_UpdateFieldLength2.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class UpdateFieldLength2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "properties",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 32000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 8000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "description",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 32000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 4000,
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "properties",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 8000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 32000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "description",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 4000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 32000,
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
1165
Migrations/20211030034925_AddLevelScoreForGroup2.Designer.cs
generated
Normal file
1165
Migrations/20211030034925_AddLevelScoreForGroup2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
153
Migrations/20211030034925_AddLevelScoreForGroup2.cs
Normal file
153
Migrations/20211030034925_AddLevelScoreForGroup2.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddLevelScoreForGroup2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
||||
table: "eva_level_score_detail");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "level_score_id",
|
||||
table: "eva_level_score_detail",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid));
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "group_guid",
|
||||
table: "eva_level_score_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "behavior",
|
||||
table: "eva_evaluation_behavior",
|
||||
maxLength: 16000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 1000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "achievement",
|
||||
table: "eva_evaluation_achievement",
|
||||
maxLength: 16000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 8000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "properties",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 32000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 8000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "description",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 32000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 4000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_level_score_detail_group_guid",
|
||||
table: "eva_level_score_detail",
|
||||
column: "group_guid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
|
||||
table: "eva_level_score_detail",
|
||||
column: "group_guid",
|
||||
principalTable: "eva_evaluation_group",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
||||
table: "eva_level_score_detail",
|
||||
column: "level_score_id",
|
||||
principalTable: "eva_level_score",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
|
||||
table: "eva_level_score_detail");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
||||
table: "eva_level_score_detail");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_eva_level_score_detail_group_guid",
|
||||
table: "eva_level_score_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "group_guid",
|
||||
table: "eva_level_score_detail");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "level_score_id",
|
||||
table: "eva_level_score_detail",
|
||||
nullable: false,
|
||||
oldClrType: typeof(Guid),
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "behavior",
|
||||
table: "eva_evaluation_behavior",
|
||||
maxLength: 1000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 16000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "achievement",
|
||||
table: "eva_evaluation_achievement",
|
||||
maxLength: 8000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 16000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "properties",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 8000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 32000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "description",
|
||||
table: "activity_log_eva",
|
||||
maxLength: 4000,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldMaxLength: 32000,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
||||
table: "eva_level_score_detail",
|
||||
column: "level_score_id",
|
||||
principalTable: "eva_level_score",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
1198
Migrations/20211031122756_Addachievement_detail.Designer.cs
generated
Normal file
1198
Migrations/20211031122756_Addachievement_detail.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
46
Migrations/20211031122756_Addachievement_detail.cs
Normal file
46
Migrations/20211031122756_Addachievement_detail.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class Addachievement_detail : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "eva_evaluation_achievement_detail",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(nullable: false),
|
||||
created = table.Column<DateTime>(nullable: false),
|
||||
updated = table.Column<DateTime>(nullable: false),
|
||||
isActive = table.Column<bool>(nullable: false),
|
||||
create_evaluation_detail_id = table.Column<int>(nullable: true),
|
||||
achievement_id = table.Column<int>(nullable: true),
|
||||
achievement_detail = table.Column<string>(maxLength: 16000, nullable: true),
|
||||
achievement_order = table.Column<int>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_eva_evaluation_achievement_detail", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_detail_eva_create_evaluation_det~",
|
||||
column: x => x.create_evaluation_detail_id,
|
||||
principalTable: "eva_create_evaluation_detail",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_evaluation_achievement_detail_create_evaluation_detail_~",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
column: "create_evaluation_detail_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "eva_evaluation_achievement_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1199
Migrations/20211031134555_ManageAchievement.Designer.cs
generated
Normal file
1199
Migrations/20211031134555_ManageAchievement.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
74
Migrations/20211031134555_ManageAchievement.cs
Normal file
74
Migrations/20211031134555_ManageAchievement.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class ManageAchievement : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_detail_eva_create_evaluation_det~",
|
||||
table: "eva_evaluation_achievement_detail");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_eva_evaluation_achievement_detail_create_evaluation_detail_~",
|
||||
table: "eva_evaluation_achievement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "create_evaluation_detail_id",
|
||||
table: "eva_evaluation_achievement_detail");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "achievement_line1",
|
||||
table: "eva_evaluation_achievement",
|
||||
maxLength: 16000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_evaluation_achievement_detail_achievement_id",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
column: "achievement_id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_detail_eva_evaluation_achievemen~",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
column: "achievement_id",
|
||||
principalTable: "eva_evaluation_achievement",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_detail_eva_evaluation_achievemen~",
|
||||
table: "eva_evaluation_achievement_detail");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_eva_evaluation_achievement_detail_achievement_id",
|
||||
table: "eva_evaluation_achievement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "achievement_line1",
|
||||
table: "eva_evaluation_achievement");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "create_evaluation_detail_id",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_evaluation_achievement_detail_create_evaluation_detail_~",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
column: "create_evaluation_detail_id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_eva_evaluation_achievement_detail_eva_create_evaluation_det~",
|
||||
table: "eva_evaluation_achievement_detail",
|
||||
column: "create_evaluation_detail_id",
|
||||
principalTable: "eva_create_evaluation_detail",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
1201
Migrations/20211108074744_AddSupervisor3.Designer.cs
generated
Normal file
1201
Migrations/20211108074744_AddSupervisor3.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Migrations/20211108074744_AddSupervisor3.cs
Normal file
22
Migrations/20211108074744_AddSupervisor3.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddSupervisor3 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "supervisor3_id",
|
||||
table: "eva_create_evaluation",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3_id",
|
||||
table: "eva_create_evaluation");
|
||||
}
|
||||
}
|
||||
}
|
||||
1218
Migrations/20211108081106_AddX111.Designer.cs
generated
Normal file
1218
Migrations/20211108081106_AddX111.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
80
Migrations/20211108081106_AddX111.cs
Normal file
80
Migrations/20211108081106_AddX111.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddX111 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "status_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 1,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "status_supervisor3A_click_date",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "supervisor3A_date",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "supervisor3A_remark",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "supervisor3A_result",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 1,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "supervisor3_id",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "status_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "status_supervisor3A_click_date",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3A_date",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3A_remark",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3A_result",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "supervisor3_id",
|
||||
table: "eva_create_evaluation_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1235
Migrations/20211118041126_AddEx01.Designer.cs
generated
Normal file
1235
Migrations/20211118041126_AddEx01.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
86
Migrations/20211118041126_AddEx01.cs
Normal file
86
Migrations/20211118041126_AddEx01.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddEx01 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "Final_summary_competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "Final_summary_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "achievement_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "level_score_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "score_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "total_summary_competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "total_summary_supervisor3A",
|
||||
table: "eva_create_evaluation_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Final_summary_competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Final_summary_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "achievement_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "level_score_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "score_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "total_summary_competency_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "total_summary_supervisor3A",
|
||||
table: "eva_create_evaluation_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1239
Migrations/20220319035041_AddSpecialCompensation.Designer.cs
generated
Normal file
1239
Migrations/20220319035041_AddSpecialCompensation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
Migrations/20220319035041_AddSpecialCompensation.cs
Normal file
31
Migrations/20220319035041_AddSpecialCompensation.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddSpecialCompensation : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "new_special_compensation",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "special_compensation",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "new_special_compensation",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "special_compensation",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
1235
Migrations/20220319042956_RemoveSpecialCom.Designer.cs
generated
Normal file
1235
Migrations/20220319042956_RemoveSpecialCom.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
Migrations/20220319042956_RemoveSpecialCom.cs
Normal file
31
Migrations/20220319042956_RemoveSpecialCom.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class RemoveSpecialCom : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "new_special_compensation",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "special_compensation",
|
||||
table: "eva_adjust_postponement_detail");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "new_special_compensation",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "special_compensation",
|
||||
table: "eva_adjust_postponement_detail",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
1158
Migrations/25641019135022_AddLevelScore.Designer.cs
generated
Normal file
1158
Migrations/25641019135022_AddLevelScore.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
47
Migrations/25641019135022_AddLevelScore.cs
Normal file
47
Migrations/25641019135022_AddLevelScore.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddLevelScore : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "eva_level_score_detail",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(nullable: false),
|
||||
created = table.Column<DateTime>(nullable: false),
|
||||
updated = table.Column<DateTime>(nullable: false),
|
||||
isActive = table.Column<bool>(nullable: false),
|
||||
level_score_id = table.Column<Guid>(nullable: false),
|
||||
min_value = table.Column<decimal>(nullable: true),
|
||||
max_value = table.Column<decimal>(nullable: true),
|
||||
min_percentage = table.Column<decimal>(nullable: true),
|
||||
max_percentage = table.Column<decimal>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_eva_level_score_detail", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
||||
column: x => x.level_score_id,
|
||||
principalTable: "eva_level_score",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_eva_level_score_detail_level_score_id",
|
||||
table: "eva_level_score_detail",
|
||||
column: "level_score_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "eva_level_score_detail");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace tb320eva.Migrations
|
||||
b.Property<DateTime?>("created_at");
|
||||
|
||||
b.Property<string>("description")
|
||||
.HasMaxLength(4000);
|
||||
.HasMaxLength(32000);
|
||||
|
||||
b.Property<string>("ip_address")
|
||||
.HasMaxLength(191);
|
||||
@@ -44,7 +44,7 @@ namespace tb320eva.Migrations
|
||||
.HasMaxLength(191);
|
||||
|
||||
b.Property<string>("properties")
|
||||
.HasMaxLength(8000);
|
||||
.HasMaxLength(32000);
|
||||
|
||||
b.Property<int?>("subject_id");
|
||||
|
||||
@@ -171,6 +171,12 @@ namespace tb320eva.Migrations
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("reward_new");
|
||||
|
||||
b.Property<decimal?>("reward_new2");
|
||||
|
||||
b.Property<decimal?>("reward_old");
|
||||
|
||||
b.Property<decimal?>("sarary");
|
||||
|
||||
b.Property<decimal?>("score_final");
|
||||
@@ -210,6 +216,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<int?>("supervisor2_id");
|
||||
|
||||
b.Property<int?>("supervisor3_id");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
@@ -235,12 +243,16 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_competency_supervisor3A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("Final_summary_supervisor3A");
|
||||
|
||||
b.Property<decimal?>("achievement_chief");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor");
|
||||
@@ -249,6 +261,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("achievement_supervisor3A");
|
||||
|
||||
b.Property<int?>("chief");
|
||||
|
||||
b.Property<int?>("chief_a");
|
||||
@@ -272,6 +286,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("competency_supervisor3A");
|
||||
|
||||
b.Property<int?>("create_evaluation_id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
@@ -296,8 +312,14 @@ namespace tb320eva.Migrations
|
||||
b.Property<string>("level_score_supervisor2A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<string>("level_score_supervisor3A")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<int?>("order_of_data");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<decimal?>("score_chief");
|
||||
|
||||
b.Property<decimal?>("score_supervisor");
|
||||
@@ -306,6 +328,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("score_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("score_supervisor3A");
|
||||
|
||||
b.Property<string>("status_chief")
|
||||
.HasMaxLength(1);
|
||||
|
||||
@@ -339,6 +363,16 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<DateTime?>("status_supervisor2A_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor3A")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor3A_click_date");
|
||||
|
||||
b.Property<string>("status_supervisor_a")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<DateTime?>("status_supervisor_a_click_date");
|
||||
|
||||
b.Property<DateTime?>("status_supervisor_click_date");
|
||||
|
||||
b.Property<int?>("supervisor1");
|
||||
@@ -385,6 +419,18 @@ namespace tb320eva.Migrations
|
||||
b.Property<string>("supervisor2_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor3A");
|
||||
|
||||
b.Property<DateTime?>("supervisor3A_date");
|
||||
|
||||
b.Property<string>("supervisor3A_remark")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("supervisor3A_result")
|
||||
.HasMaxLength(1);
|
||||
|
||||
b.Property<int?>("supervisor3_id");
|
||||
|
||||
b.Property<decimal?>("total_summary_chief");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_chief");
|
||||
@@ -395,12 +441,16 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("total_summary_competency_supervisor3A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor1A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor2A");
|
||||
|
||||
b.Property<decimal?>("total_summary_supervisor3A");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.Property<decimal?>("work_period");
|
||||
@@ -427,6 +477,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<int?>("evaluation_detail_id");
|
||||
|
||||
b.Property<int?>("history_group");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
@@ -443,7 +495,10 @@ namespace tb320eva.Migrations
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("achievement")
|
||||
.HasMaxLength(8000);
|
||||
.HasMaxLength(16000);
|
||||
|
||||
b.Property<string>("achievement_line1")
|
||||
.HasMaxLength(16000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
@@ -518,12 +573,36 @@ namespace tb320eva.Migrations
|
||||
b.ToTable("eva_evaluation_achievement_attach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<string>("achievement_detail")
|
||||
.HasMaxLength(16000);
|
||||
|
||||
b.Property<int?>("achievement_id");
|
||||
|
||||
b.Property<int?>("achievement_order");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("achievement_id");
|
||||
|
||||
b.ToTable("eva_evaluation_achievement_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.Property<int>("id");
|
||||
|
||||
b.Property<string>("behavior")
|
||||
.HasMaxLength(1000);
|
||||
.HasMaxLength(16000);
|
||||
|
||||
b.Property<int?>("create_evaluation_detail_id");
|
||||
|
||||
@@ -707,6 +786,37 @@ namespace tb320eva.Migrations
|
||||
b.ToTable("eva_level_score");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_level_score_detailEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<Guid?>("group_guid");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<Guid?>("level_score_id");
|
||||
|
||||
b.Property<decimal?>("max_percentage");
|
||||
|
||||
b.Property<decimal?>("max_value");
|
||||
|
||||
b.Property<decimal?>("min_percentage");
|
||||
|
||||
b.Property<decimal?>("min_value");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("group_guid");
|
||||
|
||||
b.HasIndex("level_score_id");
|
||||
|
||||
b.ToTable("eva_level_score_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
@@ -767,6 +877,9 @@ namespace tb320eva.Migrations
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<string>("remark2")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<decimal?>("total_salary");
|
||||
|
||||
b.Property<decimal?>("total_salary_limit");
|
||||
@@ -838,12 +951,19 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("end_leave");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("percent");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(500);
|
||||
|
||||
b.Property<DateTime?>("start_leave");
|
||||
|
||||
b.Property<int?>("theTime");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
@@ -937,6 +1057,8 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<int?>("position_type");
|
||||
|
||||
b.Property<decimal?>("salary_max");
|
||||
|
||||
b.Property<decimal?>("temporary_min");
|
||||
|
||||
b.Property<decimal?>("themax");
|
||||
@@ -950,6 +1072,26 @@ namespace tb320eva.Migrations
|
||||
b.ToTable("eva_salary_cylinder");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_setup_permissionEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("id");
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<int?>("employee_id");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<string>("remark")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("eva_setup_permission");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
|
||||
@@ -1008,6 +1150,13 @@ namespace tb320eva.Migrations
|
||||
.HasForeignKey("achievement_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement")
|
||||
.WithMany()
|
||||
.HasForeignKey("achievement_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
|
||||
@@ -1029,6 +1178,17 @@ namespace tb320eva.Migrations
|
||||
.HasForeignKey("create_evaluation_detail_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_level_score_detailEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid")
|
||||
.WithMany()
|
||||
.HasForeignKey("group_guid");
|
||||
|
||||
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score_level_score_id")
|
||||
.WithMany()
|
||||
.HasForeignKey("level_score_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid")
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TodoAPI2.Models
|
||||
[MaxLength(191)]
|
||||
public string log_name { get; set; }
|
||||
|
||||
[MaxLength(4000)]
|
||||
[MaxLength(32000)]
|
||||
public string description { get; set; }
|
||||
|
||||
public int? subject_id { get; set; }
|
||||
@@ -33,7 +33,7 @@ namespace TodoAPI2.Models
|
||||
[MaxLength(191)]
|
||||
public string causer_type { get; set; }
|
||||
|
||||
[MaxLength(8000)]
|
||||
[MaxLength(32000)]
|
||||
public string properties { get; set; }
|
||||
|
||||
[MaxLength(191)]
|
||||
|
||||
@@ -81,6 +81,12 @@ namespace TodoAPI2.Models
|
||||
public string employee_no_at_this_time { get; set; }
|
||||
|
||||
public bool? is_for_postponement { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new { get; set; }
|
||||
|
||||
public decimal? reward_new2 { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string eva_result { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,9 +141,15 @@ namespace TodoAPI2.Models
|
||||
adjust_postponement_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
|
||||
employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname,
|
||||
|
||||
reward_old = m_eva_adjust_postponement_detail_normal.reward_old,
|
||||
reward_new = m_eva_adjust_postponement_detail_normal.reward_new,
|
||||
|
||||
isActive = m_eva_adjust_postponement_detail_normal.isActive,
|
||||
Created = m_eva_adjust_postponement_detail_normal.created,
|
||||
Updated = m_eva_adjust_postponement_detail_normal.updated
|
||||
Updated = m_eva_adjust_postponement_detail_normal.updated,
|
||||
|
||||
salary_max = fk_external_linkageResult2.salary_max,
|
||||
themax = fk_external_linkageResult2.themax
|
||||
}
|
||||
).ToList();
|
||||
|
||||
@@ -203,6 +209,8 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.emp_level = model.emp_level;
|
||||
//existingEntity.total_score = model.total_score;
|
||||
//existingEntity.eva_result = model.eva_result;
|
||||
existingEntity.reward_old = model.reward_old;
|
||||
existingEntity.reward_new = model.reward_new;
|
||||
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
@@ -252,11 +260,6 @@ namespace TodoAPI2.Models
|
||||
|
||||
if (theemp == null) continue;
|
||||
|
||||
if (theemp.fullname.Contains("อุบลวรรณ"))
|
||||
{
|
||||
string zz = "1";
|
||||
}
|
||||
|
||||
var n = new eva_adjust_postponement_detailEntity();
|
||||
n.id = newkey;
|
||||
newkey++;
|
||||
@@ -467,6 +470,8 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.emp_level = i.emp_level;
|
||||
//existingEntity.total_score = i.total_score;
|
||||
//existingEntity.eva_result = i.eva_result;
|
||||
existingEntity.reward_old = i.reward_old;
|
||||
existingEntity.reward_new = i.reward_new;
|
||||
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
|
||||
@@ -50,8 +50,14 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string eva_result { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new { get; set; }
|
||||
|
||||
public int? adjust_postponement_id_eva_adjust_postponement_fiscal_year { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
public decimal? salary_max { get; set; }
|
||||
|
||||
public decimal? themax { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string eva_result { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -78,8 +78,59 @@ namespace TodoAPI2.Models
|
||||
return i;
|
||||
}
|
||||
|
||||
private (decimal?, string) getData(eva_create_evaluation_detailEntity detail)
|
||||
{
|
||||
if (detail.status_supervisor2A == "Y")
|
||||
{
|
||||
return (detail.score_supervisor2A, detail.level_score_supervisor2A);
|
||||
}
|
||||
else if (detail.status_supervisor1A == "Y")
|
||||
{
|
||||
return (detail.score_supervisor1A, detail.level_score_supervisor1A);
|
||||
}
|
||||
else if (detail.status_supervisor == "Y")
|
||||
{
|
||||
return (detail.score_supervisor, detail.level_score_supervisor);
|
||||
}
|
||||
else if (detail.status_chief == "Y")
|
||||
{
|
||||
return (detail.score_chief, detail.level_score_chief);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (detail.score_chief, detail.level_score_chief);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReloadPostponement(int? adjust_postponement_id)
|
||||
{
|
||||
var rawData = from i in _repository.Context.eva_adjust_postponement_detail
|
||||
where i.adjust_postponement_id == adjust_postponement_id
|
||||
select i;
|
||||
|
||||
var baseScore = from i in _repository.Context.eva_adjust_postponement_detail
|
||||
join j in _repository.Context.eva_adjust_postponement on i.adjust_postponement_id equals j.id
|
||||
join k in _repository.Context.eva_create_evaluation on j.create_evaluation_id equals k.id
|
||||
join m in _repository.Context.eva_create_evaluation_detail on k.id equals m.create_evaluation_id
|
||||
where i.adjust_postponement_id == adjust_postponement_id
|
||||
&& m.employee_id == i.employee_id
|
||||
select m;
|
||||
|
||||
foreach (var x in rawData)
|
||||
{
|
||||
var y = (from i in baseScore
|
||||
where i.employee_id == x.employee_id
|
||||
select getData(i)).FirstOrDefault();
|
||||
x.level_score_final = y.Item2;
|
||||
x.score_final = y.Item1;
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListByadjust_postponement_id(int? adjust_postponement_id)
|
||||
{
|
||||
ReloadPostponement(adjust_postponement_id);
|
||||
|
||||
var model = new eva_adjust_postponement_detail_normal_02SearchModel();
|
||||
model.adjust_postponement_id = adjust_postponement_id;
|
||||
return GetListBySearch(model);
|
||||
@@ -98,8 +149,29 @@ namespace TodoAPI2.Models
|
||||
return "";
|
||||
}
|
||||
|
||||
private (decimal?, decimal?) GetRangePercentage(List<eva_level_score_detailEntity> level_detail, decimal? score)
|
||||
{
|
||||
/*var item = (from i in level_detail
|
||||
where i.min_value <= score && i.max_value >= score
|
||||
select i).FirstOrDefault();
|
||||
if (item != null)
|
||||
{
|
||||
return (item.min_percentage, item.max_percentage);
|
||||
}*/
|
||||
return (-100, 100);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel model)
|
||||
{
|
||||
var theGroup = (from i in _repository.Context.eva_adjust_postponement
|
||||
join j in _repository.Context.eva_create_evaluation on i.create_evaluation_id equals j.id
|
||||
where i.id == model.adjust_postponement_id
|
||||
select j.evaluation_group_id).FirstOrDefault();
|
||||
|
||||
var level_detail = (from i in _repository.Context.eva_level_score_detail
|
||||
where i.group_guid == theGroup
|
||||
select i).ToList();
|
||||
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
var endDate = (from m_eva_adjust_postponement_detail_normal_02 in _repository.Context.eva_adjust_postponement_detail
|
||||
@@ -108,10 +180,10 @@ namespace TodoAPI2.Models
|
||||
into eva_adjust_postponementResult1
|
||||
from fk_eva_adjust_postponementResult1 in eva_adjust_postponementResult1.DefaultIfEmpty()
|
||||
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
// on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
// into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
// on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
// into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
|
||||
join create_data in _repository.Context.eva_create_evaluation
|
||||
on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_data.id
|
||||
@@ -154,7 +226,8 @@ namespace TodoAPI2.Models
|
||||
&& (m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id == model.adjust_postponement_id || !model.adjust_postponement_id.HasValue)
|
||||
//&& fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id
|
||||
//&& (m_eva_adjust_postponement_detail_normal_02.is_for_postponement == null?true: m_eva_adjust_postponement_detail_normal_02.is_for_postponement.Value)
|
||||
&& fk_external_linkageResult2.workingstatus == "สถานะปฏิบัติงาน"
|
||||
|
||||
&& fk_external_linkageResult2.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา"
|
||||
|
||||
orderby
|
||||
fk_sort_depResult2.external_code,
|
||||
@@ -200,6 +273,12 @@ namespace TodoAPI2.Models
|
||||
startDate = fk_external_linkageResult2.packing_date,
|
||||
endDate = endDate,
|
||||
|
||||
salary_max = fk_external_linkageResult2.salary_max,
|
||||
themax = fk_external_linkageResult2.themax,
|
||||
|
||||
min_percentage = GetRangePercentage(level_detail, m_eva_adjust_postponement_detail_normal_02.migration_total_score.HasValue ? m_eva_adjust_postponement_detail_normal_02.migration_total_score : m_eva_adjust_postponement_detail_normal_02.score_final).Item1,
|
||||
max_percentage = GetRangePercentage(level_detail, m_eva_adjust_postponement_detail_normal_02.migration_total_score.HasValue ? m_eva_adjust_postponement_detail_normal_02.migration_total_score : m_eva_adjust_postponement_detail_normal_02.score_final).Item2,
|
||||
|
||||
isActive = m_eva_adjust_postponement_detail_normal_02.isActive,
|
||||
Created = m_eva_adjust_postponement_detail_normal_02.created,
|
||||
Updated = m_eva_adjust_postponement_detail_normal_02.updated
|
||||
@@ -262,7 +341,8 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.emp_level = model.emp_level;
|
||||
//existingEntity.total_score = model.total_score;
|
||||
//existingEntity.eva_result = model.eva_result;
|
||||
|
||||
existingEntity.reward_old = model.reward_old;
|
||||
existingEntity.reward_new = model.reward_new;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
@@ -296,7 +376,8 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.emp_level = i.emp_level;
|
||||
//existingEntity.total_score = i.total_score;
|
||||
//existingEntity.eva_result = i.eva_result;
|
||||
|
||||
existingEntity.reward_old = i.reward_old;
|
||||
existingEntity.reward_new = i.reward_new;
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
|
||||
@@ -60,5 +60,16 @@ namespace TodoAPI2.Models
|
||||
|
||||
public DateTime? startDate { get; set; }
|
||||
public DateTime? endDate { get; set; }
|
||||
|
||||
public decimal? salary_max { get; set; }
|
||||
public decimal? themax { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new { get; set; }
|
||||
|
||||
public decimal? min_percentage { get; set; }
|
||||
|
||||
public decimal? max_percentage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string eva_result { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new2 { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,16 +20,16 @@ namespace TodoAPI2.Models
|
||||
public class eva_adjust_postponement_detail_quota_02Service : Ieva_adjust_postponement_detail_quota_02Service
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponement_detailEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
|
||||
public eva_adjust_postponement_detail_quota_02Service(IBaseRepository2<eva_adjust_postponement_detailEntity, int> repository,
|
||||
public eva_adjust_postponement_detail_quota_02Service(IBaseRepository2<eva_adjust_postponement_detailEntity, int> repository,
|
||||
IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_detail_quota_02ViewModel>>(entities);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
@@ -78,15 +78,66 @@ namespace TodoAPI2.Models
|
||||
return i;
|
||||
}
|
||||
|
||||
private (decimal?, string) getData(eva_create_evaluation_detailEntity detail)
|
||||
{
|
||||
if (detail.status_supervisor2A == "Y")
|
||||
{
|
||||
return (detail.score_supervisor2A, detail.level_score_supervisor2A);
|
||||
}
|
||||
else if (detail.status_supervisor1A == "Y")
|
||||
{
|
||||
return (detail.score_supervisor1A, detail.level_score_supervisor1A);
|
||||
}
|
||||
else if (detail.status_supervisor == "Y")
|
||||
{
|
||||
return (detail.score_supervisor, detail.level_score_supervisor);
|
||||
}
|
||||
else if (detail.status_chief == "Y")
|
||||
{
|
||||
return (detail.score_chief, detail.level_score_chief);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (detail.score_chief, detail.level_score_chief);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReloadPostponement(int? adjust_postponement_quota_id)
|
||||
{
|
||||
var rawData = from i in _repository.Context.eva_adjust_postponement_detail
|
||||
where i.adjust_postponement_quota_id == adjust_postponement_quota_id
|
||||
select i;
|
||||
|
||||
var baseScore = from i in _repository.Context.eva_adjust_postponement_detail
|
||||
join j in _repository.Context.eva_adjust_postponement on i.adjust_postponement_id equals j.id
|
||||
join k in _repository.Context.eva_create_evaluation on j.create_evaluation_id equals k.id
|
||||
join m in _repository.Context.eva_create_evaluation_detail on k.id equals m.create_evaluation_id
|
||||
where i.adjust_postponement_quota_id == adjust_postponement_quota_id
|
||||
&& m.employee_id == i.employee_id
|
||||
select m;
|
||||
|
||||
foreach (var x in rawData)
|
||||
{
|
||||
var y = (from i in baseScore
|
||||
where i.employee_id == x.employee_id
|
||||
select getData(i)).FirstOrDefault();
|
||||
x.level_score_final = y.Item2;
|
||||
x.score_final = y.Item1;
|
||||
}
|
||||
_repository.Context.SaveChanges();
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_quota_02ViewModel> GetListByadjust_postponement_quota_id(int? adjust_postponement_quota_id)
|
||||
{
|
||||
var model = new eva_adjust_postponement_detail_quota_02SearchModel();
|
||||
ReloadPostponement(adjust_postponement_quota_id);
|
||||
|
||||
var model = new eva_adjust_postponement_detail_quota_02SearchModel();
|
||||
model.adjust_postponement_quota_id = adjust_postponement_quota_id;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public string GetWorkTimeText(DateTime? startDate, DateTime? endDate)
|
||||
{
|
||||
{
|
||||
if (!endDate.HasValue || !startDate.HasValue)
|
||||
return "";
|
||||
|
||||
@@ -98,7 +149,7 @@ namespace TodoAPI2.Models
|
||||
return "";
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_detail_quota_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_quota_02SearchModel model)
|
||||
public List<eva_adjust_postponement_detail_quota_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_quota_02SearchModel model)
|
||||
{
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
@@ -112,10 +163,10 @@ namespace TodoAPI2.Models
|
||||
into eva_adjust_postponementResult1A
|
||||
from fk_eva_adjust_postponementResult1A in eva_adjust_postponementResult1A.DefaultIfEmpty()
|
||||
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
// on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
// into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
// on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
// into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
|
||||
join create_data in _repository.Context.eva_create_evaluation
|
||||
on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_data.id
|
||||
@@ -142,12 +193,12 @@ namespace TodoAPI2.Models
|
||||
|
||||
join fk_external_linkage2 in all_emp on m_eva_adjust_postponement_detail_quota_02.employee_id equals fk_external_linkage2.id
|
||||
into external_linkageResult2
|
||||
from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty()
|
||||
from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty()
|
||||
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
//on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
//into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
//join create_detail in _repository.Context.eva_create_evaluation_detail
|
||||
//on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_detail.create_evaluation_id
|
||||
//into create_detailResult
|
||||
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
|
||||
|
||||
join sort_dep in ext.GetSortingDep() on m_eva_adjust_postponement_detail_quota_02.org_at_this_time.HasValue ? m_eva_adjust_postponement_detail_quota_02.org_at_this_time : fk_external_linkageResult2.department_id equals sort_dep.id
|
||||
into sort_depResult2
|
||||
@@ -162,13 +213,14 @@ namespace TodoAPI2.Models
|
||||
into external_linkageResult11
|
||||
from fk_external_linkageResult11 in sort_depResult2.DefaultIfEmpty()
|
||||
|
||||
where 1==1
|
||||
where 1 == 1
|
||||
//&& (m_eva_adjust_postponement_detail_quota_02.id == model.id || !model.id.HasValue)
|
||||
&& (m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id == model.adjust_postponement_quota_id || !model.adjust_postponement_quota_id.HasValue)
|
||||
//&& (fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_quota_02.employee_id || fk_create_detailResult == null)
|
||||
|
||||
//&& (m_eva_adjust_postponement_detail_quota_02.is_for_postponement == null ? true : m_eva_adjust_postponement_detail_quota_02.is_for_postponement.Value)
|
||||
&& fk_external_linkageResult2.workingstatus == "สถานะปฏิบัติงาน"
|
||||
|
||||
&& fk_external_linkageResult2.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา"
|
||||
|
||||
orderby
|
||||
fk_sort_depResult2.external_code,
|
||||
@@ -203,7 +255,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
emp_department_name = !string.IsNullOrEmpty(fk_external_linkageResult11.external_name) ? fk_external_linkageResult11.external_name : fk_sort_depResult2.external_name,
|
||||
|
||||
total_score = m_eva_adjust_postponement_detail_quota_02.migration_total_score.HasValue? m_eva_adjust_postponement_detail_quota_02.migration_total_score : m_eva_adjust_postponement_detail_quota_02.score_final,
|
||||
total_score = m_eva_adjust_postponement_detail_quota_02.migration_total_score.HasValue ? m_eva_adjust_postponement_detail_quota_02.migration_total_score : m_eva_adjust_postponement_detail_quota_02.score_final,
|
||||
eva_result = !string.IsNullOrEmpty(m_eva_adjust_postponement_detail_quota_02.migration_eva_result) ? m_eva_adjust_postponement_detail_quota_02.migration_eva_result : m_eva_adjust_postponement_detail_quota_02.level_score_final,
|
||||
|
||||
adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult1.fiscal_year,
|
||||
@@ -213,9 +265,16 @@ namespace TodoAPI2.Models
|
||||
startDate = fk_external_linkageResult2.packing_date,
|
||||
endDate = endDate,
|
||||
|
||||
reward_old = m_eva_adjust_postponement_detail_quota_02.reward_old,
|
||||
reward_new2 = m_eva_adjust_postponement_detail_quota_02.reward_new2,
|
||||
|
||||
salary_max = fk_external_linkageResult2.salary_max,
|
||||
themax = fk_external_linkageResult2.themax,
|
||||
|
||||
isActive = m_eva_adjust_postponement_detail_quota_02.isActive,
|
||||
Created = m_eva_adjust_postponement_detail_quota_02.created,
|
||||
Updated = m_eva_adjust_postponement_detail_quota_02.updated
|
||||
|
||||
}
|
||||
).ToList();
|
||||
|
||||
@@ -231,10 +290,10 @@ namespace TodoAPI2.Models
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement_detail
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
if (x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
@@ -250,7 +309,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
|
||||
var inserted = _repository.Insert(entity);
|
||||
|
||||
|
||||
return Get(inserted.id);
|
||||
}
|
||||
|
||||
@@ -277,44 +336,46 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.emp_level = model.emp_level;
|
||||
//existingEntity.total_score = model.total_score;
|
||||
//existingEntity.eva_result = model.eva_result;
|
||||
|
||||
existingEntity.reward_old = model.reward_old;
|
||||
existingEntity.reward_new2 = model.reward_new2;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
|
||||
public string UpdateMultiple(List<eva_adjust_postponement_detail_quota_02InputModel> model)
|
||||
public string UpdateMultiple(List<eva_adjust_postponement_detail_quota_02InputModel> model)
|
||||
{
|
||||
foreach(var i in model)
|
||||
foreach (var i in model)
|
||||
{
|
||||
if (i.active_mode == "1" && i.id.HasValue) // update
|
||||
{
|
||||
{
|
||||
var existingEntity = _repository.Get(i.id.Value);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
//existingEntity.adjust_postponement_quota_id = i.adjust_postponement_quota_id;
|
||||
//existingEntity.employee_id = i.employee_id;
|
||||
//existingEntity.sarary = i.sarary;
|
||||
//existingEntity.cost_living = i.cost_living;
|
||||
//existingEntity.middle = i.middle;
|
||||
//existingEntity.promoted_percentage = i.promoted_percentage;
|
||||
//existingEntity.total_promote = i.total_promote;
|
||||
//existingEntity.new_sarary = i.new_sarary;
|
||||
//existingEntity.new_cost_living = i.new_cost_living;
|
||||
existingEntity.remark = i.remark;
|
||||
existingEntity.receive_quota = i.receive_quota;
|
||||
existingEntity.new_sarary_with_quota = i.new_sarary_with_quota;
|
||||
//existingEntity.emp_code = i.emp_code;
|
||||
//existingEntity.emp_fullname = i.emp_fullname;
|
||||
//existingEntity.emp_position = i.emp_position;
|
||||
//existingEntity.emp_level = i.emp_level;
|
||||
//existingEntity.total_score = i.total_score;
|
||||
//existingEntity.eva_result = i.eva_result;
|
||||
|
||||
//existingEntity.adjust_postponement_quota_id = i.adjust_postponement_quota_id;
|
||||
//existingEntity.employee_id = i.employee_id;
|
||||
//existingEntity.sarary = i.sarary;
|
||||
//existingEntity.cost_living = i.cost_living;
|
||||
//existingEntity.middle = i.middle;
|
||||
//existingEntity.promoted_percentage = i.promoted_percentage;
|
||||
//existingEntity.total_promote = i.total_promote;
|
||||
//existingEntity.new_sarary = i.new_sarary;
|
||||
//existingEntity.new_cost_living = i.new_cost_living;
|
||||
existingEntity.remark = i.remark;
|
||||
existingEntity.receive_quota = i.receive_quota;
|
||||
existingEntity.new_sarary_with_quota = i.new_sarary_with_quota;
|
||||
//existingEntity.emp_code = i.emp_code;
|
||||
//existingEntity.emp_fullname = i.emp_fullname;
|
||||
//existingEntity.emp_position = i.emp_position;
|
||||
//existingEntity.emp_level = i.emp_level;
|
||||
//existingEntity.total_score = i.total_score;
|
||||
//existingEntity.eva_result = i.eva_result;
|
||||
existingEntity.reward_old = i.reward_old;
|
||||
existingEntity.reward_new2 = i.reward_new2;
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
@@ -326,15 +387,15 @@ namespace TodoAPI2.Models
|
||||
_repository.InsertWithoutCommit(entity);
|
||||
}
|
||||
else if (i.active_mode == "0" && i.id.HasValue) // remove
|
||||
{
|
||||
{
|
||||
_repository.DeleteWithoutCommit(i.id.Value);
|
||||
}
|
||||
else if (i.active_mode == "0" && !i.id.HasValue)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
//_repository.Context.SaveChanges();
|
||||
//_repository.Context.SaveChanges();
|
||||
|
||||
return model.Count().ToString();
|
||||
}
|
||||
|
||||
@@ -60,5 +60,13 @@ namespace TodoAPI2.Models
|
||||
|
||||
public DateTime? startDate { get; set; }
|
||||
public DateTime? endDate { get; set; }
|
||||
|
||||
public decimal? reward_old { get; set; }
|
||||
|
||||
public decimal? reward_new2 { get; set; }
|
||||
|
||||
public decimal? salary_max { get; set; }
|
||||
|
||||
public decimal? themax { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ namespace TodoAPI2.Models
|
||||
string UpdateMultiple(List<eva_adjust_postponement_quotaInputModel> model);
|
||||
eva_adjust_postponement_quotaWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
rep_eva_savemessageReportRequestModel setModelFor_rep_eva_savemessageReport(rep_eva_savemessageReportRequestModel model);
|
||||
DataContext GetContext();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public decimal? limit { get; set; }
|
||||
|
||||
public int? fiscal_year_search { get; set; }
|
||||
|
||||
public int? theRound_search { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
|
||||
public List<eva_adjust_postponement_detail_quota_02InputModel> adjust_postponement_detail_quota_02_model;
|
||||
|
||||
@@ -20,6 +20,9 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? theRound { get; set; }
|
||||
|
||||
public int? fiscal_year_search { get; set; }
|
||||
|
||||
public int? theRound_search { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ namespace TodoAPI2.Models
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_quotaViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
@@ -72,6 +77,13 @@ namespace TodoAPI2.Models
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem()
|
||||
@@ -80,6 +92,13 @@ namespace TodoAPI2.Models
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
|
||||
i.item_fiscal_year_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.fiscal_year, external_name = x.fiscal_year.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
i.item_theRound_search = (from x in _repository.Context.eva_adjust_postponement
|
||||
select new external_linkageViewModel { external_id = x.theRound, external_name = x.theRound.ToString() }
|
||||
).Distinct().OrderByDescending(x => x.external_id).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -107,6 +126,9 @@ namespace TodoAPI2.Models
|
||||
&& (m_eva_adjust_postponement_quota.theRound == model.theRound || !model.theRound.HasValue)
|
||||
&& !m_eva_adjust_postponement_quota.create_evaluation_id.HasValue
|
||||
|
||||
&& (!model.fiscal_year_search.HasValue || m_eva_adjust_postponement_quota.fiscal_year == model.fiscal_year_search)
|
||||
&& (!model.theRound_search.HasValue || m_eva_adjust_postponement_quota.theRound == model.theRound_search)
|
||||
|
||||
orderby m_eva_adjust_postponement_quota.created descending
|
||||
select new eva_adjust_postponement_quotaViewModel()
|
||||
{
|
||||
@@ -174,7 +196,16 @@ namespace TodoAPI2.Models
|
||||
entity.limit_quota = 0;
|
||||
entity.limit_frame_quota = 0;
|
||||
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
var active_emp = (from i in _repository.Context.eva_adjust_postponement_detail
|
||||
join j in _repository.Context.eva_adjust_postponement on i.adjust_postponement_id equals j.id
|
||||
where j.fiscal_year == model.fiscal_year
|
||||
&& j.theRound == model.theRound
|
||||
select i.employee_id).ToList();
|
||||
|
||||
var all_emp = (from i in emp.GetListByemployee_type(null, null)
|
||||
where i.workingstatus != "คณะกรรมการเนติบัณฑิตยสภา"
|
||||
&& active_emp.Contains(i.id)
|
||||
select i).ToList();
|
||||
var all_emp_id_list = (from i in all_emp select i.id).ToList();
|
||||
entity.limit = AddMultipleDetail(entity.id, all_emp_id_list, entity.fiscal_year, entity.theRound, all_emp);
|
||||
|
||||
@@ -506,6 +537,54 @@ namespace TodoAPI2.Models
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public rep_eva_savemessageReportRequestModel setModelFor_rep_eva_savemessageReport(rep_eva_savemessageReportRequestModel model)
|
||||
{
|
||||
model.theDate = MyHelper.GetDateFromString(model.theDate_text);
|
||||
model.theDate_text = MyHelper.GetDateStringForReport(model.theDate);
|
||||
model.decimal_limit_quota = Convert.ToDecimal(model.limit_quota);
|
||||
|
||||
var postponement_data = (from postponement in _repository.Context.eva_adjust_postponement
|
||||
//join create_evaluation in _repository.Context.eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id
|
||||
where postponement.id == model.quota_id
|
||||
select new
|
||||
{
|
||||
//create_evaluation.performance_plan_id,
|
||||
postponement.fiscal_year,
|
||||
postponement.theDate,
|
||||
postponement.limit_frame,
|
||||
postponement.limit_frame_quota
|
||||
}).FirstOrDefault();
|
||||
|
||||
if(postponement_data != null)
|
||||
{
|
||||
var plan_id = (from plan_in_db in _repository.Context.eva_performance_plan
|
||||
where plan_in_db.fiscal_year == postponement_data.fiscal_year
|
||||
&& plan_in_db.theTime == plan_in_db.theTime
|
||||
select plan_in_db.id).FirstOrDefault();
|
||||
|
||||
var plan = (from eva_p_p in _repository.Context.eva_performance_plan
|
||||
where eva_p_p.id == plan_id
|
||||
select eva_p_p).FirstOrDefault();
|
||||
|
||||
if(plan != null)
|
||||
{
|
||||
var start_plan = (from s in _repository.Context.eva_performance_plan_detail
|
||||
where s.performance_plan_id == plan_id
|
||||
select s.start_date).Min();
|
||||
|
||||
var end_plan = (from s in _repository.Context.eva_performance_plan_detail
|
||||
where s.performance_plan_id == plan_id
|
||||
select s.end_date).Max();
|
||||
|
||||
model.theTime = plan.theTime;
|
||||
model.min_plan_start_date = MyHelper.GetDateStringForReport(start_plan);
|
||||
model.max_plan_end_date = MyHelper.GetDateStringForReport(end_plan);
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace TodoAPI2.Models
|
||||
public class eva_adjust_postponement_quotaWithSelectionViewModel: eva_adjust_postponement_quotaViewModel
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,6 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? supervisor2_id { get; set; }
|
||||
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? supervisor2_id { get; set; }
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace TodoAPI2.Models
|
||||
i.item_evaluation_group_id = (from x in _repository.Context.eva_evaluation_group select x).ToList();
|
||||
i.item_supervisor1_id = all_emp;
|
||||
i.item_supervisor2_id = all_emp;
|
||||
i.item_supervisor3_id = all_emp;
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -89,6 +90,7 @@ namespace TodoAPI2.Models
|
||||
i.item_evaluation_group_id = (from x in _repository.Context.eva_evaluation_group select x).ToList();
|
||||
i.item_supervisor1_id = all_emp;
|
||||
i.item_supervisor2_id = all_emp;
|
||||
i.item_supervisor3_id = all_emp;
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -127,6 +129,10 @@ namespace TodoAPI2.Models
|
||||
into external_linkageResult7
|
||||
from fk_external_linkageResult7 in external_linkageResult7.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage8 in all_emp on m_eva_create_evaluation.supervisor3_id equals fk_external_linkage8.id
|
||||
into external_linkageResult8
|
||||
from fk_external_linkageResult8 in external_linkageResult8.DefaultIfEmpty()
|
||||
|
||||
where 1==1
|
||||
&& (m_eva_create_evaluation.performance_plan_id == model.performance_plan_id || !model.performance_plan_id.HasValue)
|
||||
&& (m_eva_create_evaluation.evaluation_group_id == model.evaluation_group_id || !model.evaluation_group_id.HasValue)
|
||||
@@ -143,6 +149,7 @@ namespace TodoAPI2.Models
|
||||
evaluation_group_id = m_eva_create_evaluation.evaluation_group_id,
|
||||
supervisor1_id = m_eva_create_evaluation.supervisor1_id,
|
||||
supervisor2_id = m_eva_create_evaluation.supervisor2_id,
|
||||
supervisor3_id = m_eva_create_evaluation.supervisor3_id,
|
||||
|
||||
performance_plan_id_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.display_text,
|
||||
employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname,
|
||||
@@ -150,6 +157,7 @@ namespace TodoAPI2.Models
|
||||
evaluation_group_id_eva_evaluation_group_name = fk_eva_evaluation_groupResult5.thegroup,
|
||||
supervisor1_id_external_linkage_external_name = fk_external_linkageResult6.fullname,
|
||||
supervisor2_id_external_linkage_external_name = fk_external_linkageResult7.fullname,
|
||||
supervisor3_id_external_linkage_external_name = fk_external_linkageResult8.fullname,
|
||||
|
||||
isActive = m_eva_create_evaluation.isActive,
|
||||
Created = m_eva_create_evaluation.created,
|
||||
@@ -209,7 +217,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.evaluation_group_id = model.evaluation_group_id;
|
||||
existingEntity.supervisor1_id = model.supervisor1_id;
|
||||
existingEntity.supervisor2_id = model.supervisor2_id;
|
||||
|
||||
existingEntity.supervisor3_id = model.supervisor3_id;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
@@ -234,7 +242,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.evaluation_group_id = i.evaluation_group_id;
|
||||
existingEntity.supervisor1_id = i.supervisor1_id;
|
||||
existingEntity.supervisor2_id = i.supervisor2_id;
|
||||
|
||||
existingEntity.supervisor3_id = i.supervisor3_id;
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? supervisor2_id { get; set; }
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
|
||||
public string performance_plan_id_eva_performance_plan_fiscal_year { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
public string evaluation_group_id_eva_evaluation_group_code { get; set; }
|
||||
@@ -36,6 +38,8 @@ namespace TodoAPI2.Models
|
||||
public string supervisor1_id_external_linkage_external_name { get; set; }
|
||||
public string supervisor2_id_external_linkage_external_name { get; set; }
|
||||
|
||||
public string supervisor3_id_external_linkage_external_name { get; set; }
|
||||
|
||||
public string description
|
||||
{
|
||||
get
|
||||
|
||||
@@ -12,6 +12,6 @@ namespace TodoAPI2.Models
|
||||
public List<eva_evaluation_groupEntity> item_evaluation_group_id { get; set; }
|
||||
public List<external_employeeViewModel> item_supervisor1_id { get; set; }
|
||||
public List<external_employeeViewModel> item_supervisor2_id { get; set; }
|
||||
|
||||
public List<external_employeeViewModel> item_supervisor3_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,9 @@ namespace TodoAPI2.Models
|
||||
[MaxLength(1)]
|
||||
public string status_supervisor { get; set; }
|
||||
|
||||
[MaxLength(1)]
|
||||
public string status_supervisor_a { get; set; }
|
||||
|
||||
public int? supervisor1A { get; set; }
|
||||
|
||||
[MaxLength(1)]
|
||||
@@ -130,9 +133,12 @@ namespace TodoAPI2.Models
|
||||
public DateTime? status_chief_a_click_date { get; set; }
|
||||
public DateTime? status_chief_click_date { get; set; }
|
||||
public DateTime? status_supervisor_click_date { get; set; }
|
||||
public DateTime? status_supervisor_a_click_date { get; set; }
|
||||
public DateTime? status_supervisor1A_click_date { get; set; }
|
||||
public DateTime? status_supervisor2A_click_date { get; set; }
|
||||
|
||||
public DateTime? status_supervisor3A_click_date { get; set; }
|
||||
|
||||
public decimal? total_summary_supervisor1A { get; set; }
|
||||
|
||||
public decimal? Final_summary_supervisor1A { get; set; }
|
||||
@@ -191,6 +197,41 @@ namespace TodoAPI2.Models
|
||||
public int? order_of_data { get; set; }
|
||||
|
||||
public int? help_org_id { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string remark { get; set; }
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
|
||||
public int? supervisor3A { get; set; }
|
||||
|
||||
[MaxLength(1)]
|
||||
public string supervisor3A_result { get; set; }
|
||||
|
||||
[MaxLength(1000)]
|
||||
public string supervisor3A_remark { get; set; }
|
||||
|
||||
public DateTime? supervisor3A_date { get; set; }
|
||||
[MaxLength(1)]
|
||||
public string status_supervisor3A { get; set; }
|
||||
|
||||
|
||||
public decimal? total_summary_supervisor3A { get; set; }
|
||||
|
||||
public decimal? Final_summary_supervisor3A { get; set; }
|
||||
|
||||
public decimal? total_summary_competency_supervisor3A { get; set; }
|
||||
|
||||
public decimal? Final_summary_competency_supervisor3A { get; set; }
|
||||
|
||||
public decimal? achievement_supervisor3A { get; set; }
|
||||
|
||||
public decimal? competency_supervisor3A { get; set; }
|
||||
|
||||
public decimal? score_supervisor3A { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string level_score_supervisor3A { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? help_org_id { get; set; }
|
||||
|
||||
public string remark { get; set; }
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ namespace TodoAPI2.Models
|
||||
i.item_eva_employee_id = i.item_employee_id;
|
||||
i.item_supervisor1_id = i.item_employee_id;
|
||||
i.item_supervisor2_id = i.item_employee_id;
|
||||
i.item_supervisor3_id = i.item_employee_id;
|
||||
i.item_help_org_id = ext.GetDepartmentData();
|
||||
|
||||
return i;
|
||||
@@ -95,6 +96,7 @@ namespace TodoAPI2.Models
|
||||
i.item_eva_employee_id = i.item_employee_id;
|
||||
i.item_supervisor1_id = i.item_employee_id;
|
||||
i.item_supervisor2_id = i.item_employee_id;
|
||||
i.item_supervisor3_id = i.item_employee_id;
|
||||
i.item_help_org_id = ext.GetDepartmentData();
|
||||
|
||||
return i;
|
||||
@@ -139,6 +141,10 @@ namespace TodoAPI2.Models
|
||||
into external_linkageResult46
|
||||
from fk_external_linkageResult46 in external_linkageResult46.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage48 in allemp on m_eva_create_evaluation_detail.supervisor3_id equals fk_external_linkage48.id
|
||||
into external_linkageResult48
|
||||
from fk_external_linkageResult48 in external_linkageResult48.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage99 in ext.GetDepartmentData() on (m_eva_create_evaluation_detail.help_org_id.HasValue ? m_eva_create_evaluation_detail.help_org_id : fk_external_linkageResult2.department_id) equals fk_external_linkage99.id
|
||||
into external_linkageResult99
|
||||
from fk_external_linkageResult99 in external_linkageResult99.DefaultIfEmpty()
|
||||
@@ -197,6 +203,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
status_supervisor1A = m_eva_create_evaluation_detail.status_supervisor1A,
|
||||
status_supervisor2A = m_eva_create_evaluation_detail.status_supervisor2A,
|
||||
status_supervisor3A = m_eva_create_evaluation_detail.status_supervisor3A,
|
||||
|
||||
employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname,
|
||||
chief_external_linkage_external_name = fk_external_linkageResult3.fullname,
|
||||
@@ -209,13 +216,14 @@ namespace TodoAPI2.Models
|
||||
employee_no = fk_external_linkageResult2.employee_no,
|
||||
position_number = fk_external_linkageResult2.position_number,
|
||||
position_name = fk_external_linkageResult2.position_name,
|
||||
remark = null,
|
||||
remark = m_eva_create_evaluation_detail.remark,
|
||||
|
||||
status_self_click_date = m_eva_create_evaluation_detail.status_self_click_date,
|
||||
status_chief_click_date = m_eva_create_evaluation_detail.status_chief_click_date,
|
||||
status_supervisor_click_date = m_eva_create_evaluation_detail.status_supervisor_click_date,
|
||||
status_supervisor1A_click_date = m_eva_create_evaluation_detail.status_supervisor1A_click_date,
|
||||
status_supervisor2A_click_date = m_eva_create_evaluation_detail.status_supervisor2A_click_date,
|
||||
status_supervisor3A_click_date = m_eva_create_evaluation_detail.status_supervisor3A_click_date,
|
||||
|
||||
department_name = fk_external_linkageResult99.external_name,
|
||||
help_org_id_external_linkage_external_name = fk_external_linkageResult46.external_name,
|
||||
@@ -254,7 +262,10 @@ namespace TodoAPI2.Models
|
||||
var entity = GetEntity(model);
|
||||
entity.id = GetNewPrimaryKey();
|
||||
|
||||
|
||||
if (!entity.work_period.HasValue)
|
||||
{
|
||||
entity.work_period = 6;
|
||||
}
|
||||
|
||||
var inserted = _repository.Insert(entity);
|
||||
|
||||
@@ -275,6 +286,12 @@ namespace TodoAPI2.Models
|
||||
existingEntity.work_period = model.work_period;
|
||||
existingEntity.order_of_data = model.order_of_data;
|
||||
existingEntity.help_org_id = model.help_org_id;
|
||||
existingEntity.remark = model.remark;
|
||||
|
||||
if (!existingEntity.work_period.HasValue)
|
||||
{
|
||||
existingEntity.work_period = 6;
|
||||
}
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
@@ -301,6 +318,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.work_period = i.work_period;
|
||||
existingEntity.order_of_data = i.order_of_data;
|
||||
existingEntity.help_org_id = i.help_org_id;
|
||||
existingEntity.remark = i.remark;
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
|
||||
@@ -82,10 +82,13 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string status_supervisor2A { get; set; }
|
||||
|
||||
public string status_supervisor3A { get; set; }
|
||||
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
public string chief_external_linkage_external_name { get; set; }
|
||||
public string supervisor1_result_external_linkage_external_name { get; set; }
|
||||
public string supervisor2_result_external_linkage_external_name { get; set; }
|
||||
public string supervisor3_result_external_linkage_external_name { get; set; }
|
||||
|
||||
public string position_type_text { get; set; }
|
||||
public string position_level_text { get; set; }
|
||||
@@ -103,6 +106,7 @@ namespace TodoAPI2.Models
|
||||
public DateTime? status_supervisor_click_date { get; set; }
|
||||
public DateTime? status_supervisor1A_click_date { get; set; }
|
||||
public DateTime? status_supervisor2A_click_date { get; set; }
|
||||
public DateTime? status_supervisor3A_click_date { get; set; }
|
||||
|
||||
public int? eva_employee_id { get; set; }
|
||||
|
||||
@@ -110,6 +114,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? supervisor2_id { get; set; }
|
||||
|
||||
public int? supervisor3_id { get; set; }
|
||||
|
||||
public decimal? work_period { get; set; }
|
||||
public int? order_of_data { get; set; }
|
||||
|
||||
@@ -120,8 +126,10 @@ namespace TodoAPI2.Models
|
||||
public string txt_status_supervisor { get { return getStatusText(status_supervisor) + MyHelper.GetDateStringForReport(status_supervisor_click_date); } }
|
||||
public string txt_status_supervisor1A { get { return getStatusText(status_supervisor1A) + MyHelper.GetDateStringForReport(status_supervisor1A_click_date); } }
|
||||
public string txt_status_supervisor2A { get { return getStatusText(status_supervisor2A) + MyHelper.GetDateStringForReport(status_supervisor2A_click_date); } }
|
||||
public string txt_status_supervisor3A { get { return getStatusText(status_supervisor3A) + MyHelper.GetDateStringForReport(status_supervisor3A_click_date); } }
|
||||
|
||||
public string help_org_id_external_linkage_external_name { get; set; }
|
||||
|
||||
private string getStatusText(string s)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s))
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace TodoAPI2.Models
|
||||
public List<external_employeeViewModel> item_eva_employee_id { get; set; }
|
||||
public List<external_employeeViewModel> item_supervisor1_id { get; set; }
|
||||
public List<external_employeeViewModel> item_supervisor2_id { get; set; }
|
||||
public List<external_employeeViewModel> item_supervisor3_id { get; set; }
|
||||
public List<external_linkageViewModel> item_help_org_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string search_employee_fullname { get; set; }
|
||||
|
||||
public string evaluation_round_search { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string search_employee_fullname { get; set; }
|
||||
|
||||
public string evaluation_round_search { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user