From f8f46bb346f227c76a7bedefcf16c3d4f4be0fdf Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Sun, 1 Mar 2020 17:17:43 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B8=E0=B8=87=E0=B8=AA=E0=B8=B4=E0=B8=97=E0=B8=98?= =?UTF-8?q?=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A1=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B9=80=E0=B8=AB=E0=B9=87=E0=B8=99=E0=B8=95=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...te_evaluation_detail_processControllers.cs | 47 +++++++- ...create_evaluation_detail_processService.cs | 6 +- ...create_evaluation_detail_processService.cs | 78 ++++++++++-- ...eate_evaluation_detail_processViewModel.cs | 12 +- ...reate_evaluation_detail_review01Service.cs | 9 ++ ...reate_evaluation_detail_review02Service.cs | 13 +- .../eva_evaluation_achievementService.cs | 27 +++++ ...a_evaluation_achievement_processService.cs | 19 +++ ..._evaluation_achievement_process2Service.cs | 114 ++++++++++-------- .../eva_evaluation_behaviorService.cs | 71 +++++++---- .../eva_evaluation_behavior_processService.cs | 9 ++ ...eva_evaluation_behavior_process2Service.cs | 9 ++ ...ostponement_detail_normal_02_inline.cshtml | 83 ------------- ...postponement_detail_quota_02_inline.cshtml | 85 ------------- ...reate_evaluation_detail_agreement_d.cshtml | 20 +++ ...va_create_evaluation_detail_process.cshtml | 3 +- ..._create_evaluation_detail_process_d.cshtml | 14 +-- ...create_evaluation_detail_process_d2.cshtml | 18 +-- ...create_evaluation_detail_review01_d.cshtml | 94 --------------- ...create_evaluation_detail_review02_d.cshtml | 99 --------------- ...create_evaluation_detail_review03_d.cshtml | 99 --------------- ...create_evaluation_detail_review04_d.cshtml | 99 --------------- .../eva_level_score_d.cshtml | 4 +- tb320eva.xml | 3 +- .../eva_create_evaluation_detail_process.js | 40 +++--- .../eva_create_evaluation_detail_process_d.js | 19 ++- ...eva_create_evaluation_detail_process_d2.js | 41 ++++++- .../eva_create_evaluation_detail_status_d.js | 5 +- .../eva_promoted_percentage.js | 4 +- 29 files changed, 448 insertions(+), 696 deletions(-) delete mode 100644 Views/eva_adjust_postponement_detail_normal_02View/eva_adjust_postponement_detail_normal_02_inline.cshtml delete mode 100644 Views/eva_adjust_postponement_detail_quota_02View/eva_adjust_postponement_detail_quota_02_inline.cshtml delete mode 100644 Views/eva_create_evaluation_detail_review01View/eva_create_evaluation_detail_review01_d.cshtml delete mode 100644 Views/eva_create_evaluation_detail_review02View/eva_create_evaluation_detail_review02_d.cshtml delete mode 100644 Views/eva_create_evaluation_detail_review03View/eva_create_evaluation_detail_review03_d.cshtml delete mode 100644 Views/eva_create_evaluation_detail_review04View/eva_create_evaluation_detail_review04_d.cshtml diff --git a/ApiControllers/eva_create_evaluation_detail_processControllers.cs b/ApiControllers/eva_create_evaluation_detail_processControllers.cs index badc28b..8222b01 100644 --- a/ApiControllers/eva_create_evaluation_detail_processControllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_processControllers.cs @@ -27,6 +27,7 @@ namespace TodoAPI2.Controllers private ILogger _logger; private Ieva_create_evaluation_detail_processService _repository; private IConfiguration Configuration { get; set; } + private Iexternal_employeeService emp; #endregion #region Properties @@ -37,13 +38,17 @@ namespace TodoAPI2.Controllers /// Default constructure for dependency injection /// /// - /// + /// /// - public eva_create_evaluation_detail_processController(ILogger logger, Ieva_create_evaluation_detail_processService repository, IConfiguration configuration) + /// + public eva_create_evaluation_detail_processController(ILogger logger, + Iexternal_employeeService inemp, + Ieva_create_evaluation_detail_processService repository, IConfiguration configuration) { _logger = logger; _repository = repository; Configuration = configuration; + emp = inemp; } /// @@ -64,9 +69,19 @@ namespace TodoAPI2.Controllers try { if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); - var result = _repository.GetWithSelection(id); - return Ok(result); + if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"])) + { + var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]); + var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid)); + var result = _repository.GetWithSelection(id, e.id); + + return Ok(result); + } + else + { + return Unauthorized(); + } } catch (Exception ex) { @@ -122,7 +137,17 @@ namespace TodoAPI2.Controllers try { if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); - return Ok(_repository.GetListBycreate_evaluation_id(create_evaluation_id)); + + if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"])) + { + var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]); + var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid)); + return Ok(_repository.GetListBycreate_evaluation_id(create_evaluation_id, e.id)); + } + else + { + return Unauthorized(); + } } catch (Exception ex) { @@ -149,7 +174,17 @@ namespace TodoAPI2.Controllers try { if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); - return Ok(_repository.GetListBySearch(model)); + + if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"])) + { + var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]); + var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid)); + return Ok(_repository.GetListBySearch(model, e.id)); + } + else + { + return Unauthorized(); + } } catch (Exception ex) { diff --git a/Models/eva_create_evaluation_detail_process/Ieva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/Ieva_create_evaluation_detail_processService.cs index 779e287..8e6250a 100644 --- a/Models/eva_create_evaluation_detail_process/Ieva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/Ieva_create_evaluation_detail_processService.cs @@ -12,10 +12,10 @@ namespace TodoAPI2.Models { public interface Ieva_create_evaluation_detail_processService { - List GetListBycreate_evaluation_id(int? create_evaluation_id); - List GetListBySearch(eva_create_evaluation_detail_processSearchModel model); + List GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id); + List GetListBySearch(eva_create_evaluation_detail_processSearchModel model, int? emp_id); - eva_create_evaluation_detail_processWithSelectionViewModel GetWithSelection(int id); + eva_create_evaluation_detail_processWithSelectionViewModel GetWithSelection(int id, int? emp_id); eva_create_evaluation_detail_processWithSelectionViewModel GetBlankItem(); diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs index b5fb57e..880e1b1 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs @@ -56,7 +56,7 @@ namespace TodoAPI2.Models #region Public Functions #region Query Functions - public eva_create_evaluation_detail_processWithSelectionViewModel Get(int id) + public eva_create_evaluation_detail_processWithSelectionViewModel Get(int id, int? emp_id) { var allemp = emp.GetListByemployee_type(null, null); @@ -100,6 +100,22 @@ namespace TodoAPI2.Models create_evaluation_score1 = fk_eva_create_evaluationResult10.score1, create_evaluation_score2 = fk_eva_create_evaluationResult10.score2, + status_self = m_eva_create_evaluation_detail_process.status_self, + status_chief = m_eva_create_evaluation_detail_process.status_chief, + status_supervisor = m_eva_create_evaluation_detail_process.status_supervisor, + + role_code = getRoleCode(emp_id, m_eva_create_evaluation_detail_process.chief, + m_eva_create_evaluation_detail_process.chief, + fk_eva_create_evaluationResult10.employee_id, + fk_eva_create_evaluationResult10.supervisor1_id, + fk_eva_create_evaluationResult10.supervisor2_id), + + role_desc = getRoleName(emp_id, m_eva_create_evaluation_detail_process.chief, + m_eva_create_evaluation_detail_process.chief, + fk_eva_create_evaluationResult10.employee_id, + fk_eva_create_evaluationResult10.supervisor1_id, + fk_eva_create_evaluationResult10.supervisor2_id), + isActive = m_eva_create_evaluation_detail_process.isActive, Created = m_eva_create_evaluation_detail_process.created, Updated = m_eva_create_evaluation_detail_process.updated @@ -108,9 +124,9 @@ namespace TodoAPI2.Models return data[0]; } - public eva_create_evaluation_detail_processWithSelectionViewModel GetWithSelection(int id) + public eva_create_evaluation_detail_processWithSelectionViewModel GetWithSelection(int id, int? emp_id) { - var item = Get(id); + var item = Get(id, emp_id); item.item_org_id = ext.GetDepartmentData(); item.item_level_score = (from i in _repository.Context.eva_level_score orderby i.min_score @@ -122,21 +138,21 @@ namespace TodoAPI2.Models { var i = new eva_create_evaluation_detail_processWithSelectionViewModel(); i.item_org_id = ext.GetDepartmentData(); - i.item_level_score = (from j in _repository.Context.eva_level_score - orderby j.min_score - select Mapper.Map(i)).ToList(); + //i.item_level_score = (from j in _repository.Context.eva_level_score + // orderby j.min_score + // select Mapper.Map(i)).ToList(); return i; } - public List GetListBycreate_evaluation_id(int? create_evaluation_id) + public List GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id) { var model = new eva_create_evaluation_detail_processSearchModel(); model.create_evaluation_id = create_evaluation_id; - return GetListBySearch(model); + return GetListBySearch(model, emp_id); } - public List GetListBySearch(eva_create_evaluation_detail_processSearchModel model) + public List GetListBySearch(eva_create_evaluation_detail_processSearchModel model, int? emp_id) { var allemp = emp.GetListByemployee_type(null, null); @@ -160,7 +176,13 @@ namespace TodoAPI2.Models && (fk_external_employee.department_id == model.org_id || !model.org_id.HasValue) && (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code)) && (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname)) - + && emp_id.HasValue + && ( + (m_eva_create_evaluation_detail_process.chief.HasValue && emp_id == m_eva_create_evaluation_detail_process.chief) + || (fk_eva_create_evaluationResult10.employee_id.HasValue && emp_id == fk_eva_create_evaluationResult10.employee_id) + || (fk_eva_create_evaluationResult10.supervisor1_id.HasValue && emp_id == fk_eva_create_evaluationResult10.supervisor1_id) + || (fk_eva_create_evaluationResult10.supervisor2_id.HasValue && emp_id == fk_eva_create_evaluationResult10.supervisor2_id) + ) orderby m_eva_create_evaluation_detail_process.created descending select new eva_create_evaluation_detail_processViewModel() @@ -182,6 +204,22 @@ namespace TodoAPI2.Models org_id_external_linkage_external_name = fk_external_employee.department_name, + status_self = m_eva_create_evaluation_detail_process.status_self, + status_chief = m_eva_create_evaluation_detail_process.status_chief, + status_supervisor = m_eva_create_evaluation_detail_process.status_supervisor, + + role_code = getRoleCode(emp_id, m_eva_create_evaluation_detail_process.chief, + m_eva_create_evaluation_detail_process.chief, + fk_eva_create_evaluationResult10.employee_id, + fk_eva_create_evaluationResult10.supervisor1_id, + fk_eva_create_evaluationResult10.supervisor2_id), + + role_desc = getRoleName(emp_id, m_eva_create_evaluation_detail_process.chief, + m_eva_create_evaluation_detail_process.chief, + fk_eva_create_evaluationResult10.employee_id, + fk_eva_create_evaluationResult10.supervisor1_id, + fk_eva_create_evaluationResult10.supervisor2_id), + isActive = m_eva_create_evaluation_detail_process.isActive, Created = m_eva_create_evaluation_detail_process.created, Updated = m_eva_create_evaluation_detail_process.updated @@ -191,6 +229,26 @@ namespace TodoAPI2.Models return data; } + private string getRoleCode(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A) + { + if (emp_id == chief) return "1"; + else if (emp_id == supervisor1) return "1"; + else if (emp_id == supervisor2) return "2"; + else if (emp_id == supervisor1A) return "3"; + else if (emp_id == supervisor2A) return "4"; + return ""; + } + + private string getRoleName(int? emp_id, int? chief, int? supervisor1, int? supervisor2, int? supervisor1A, int? supervisor2A) + { + if (emp_id == chief) return "ผู้ประเมิน"; + else if (emp_id == supervisor1) return "ผู้ประเมิน"; + else if (emp_id == supervisor2) return "ผู้ประเมินสูสุด"; + else if (emp_id == supervisor1A) return "ผู้บังคับบัญชาเหนือขึ้นไป"; + else if (emp_id == supervisor2A) return "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)"; + return ""; + } + #endregion diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs index 3ba235f..4b21c65 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs @@ -43,5 +43,15 @@ namespace TodoAPI2.Models public Guid? create_evaluation_id_eva_create_evaluation_performance_plan_id { get; set; } public string org_id_external_linkage_external_name { get; set; } + public string status_self { get; set; } + + public string status_chief { get; set; } + + public string status_supervisor { get; set; } + + public string role_desc { get; set; } + + public string role_code { get; set; } } -} \ No newline at end of file +} + diff --git a/Models/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01Service.cs b/Models/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01Service.cs index e577b75..620be6d 100644 --- a/Models/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01Service.cs +++ b/Models/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01Service.cs @@ -157,6 +157,15 @@ namespace TodoAPI2.Models var existingEntity = _repository.Get(id); if (existingEntity != null) { + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == model.id + select k).FirstOrDefault(); + + if (current_detail.status_chief == "Y") + { + throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + existingEntity.create_evaluation_id = model.create_evaluation_id; existingEntity.supervisor1 = model.supervisor1; existingEntity.supervisor1_result = model.supervisor1_result; diff --git a/Models/eva_create_evaluation_detail_review02/eva_create_evaluation_detail_review02Service.cs b/Models/eva_create_evaluation_detail_review02/eva_create_evaluation_detail_review02Service.cs index d1c73a3..e38e3b7 100644 --- a/Models/eva_create_evaluation_detail_review02/eva_create_evaluation_detail_review02Service.cs +++ b/Models/eva_create_evaluation_detail_review02/eva_create_evaluation_detail_review02Service.cs @@ -144,9 +144,7 @@ namespace TodoAPI2.Models { var entity = GetEntity(model); entity.id = GetNewPrimaryKey(); - - - + var inserted = _repository.Insert(entity); return Get(inserted.id); @@ -157,6 +155,15 @@ namespace TodoAPI2.Models var existingEntity = _repository.Get(id); if (existingEntity != null) { + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == model.id + select k).FirstOrDefault(); + + if (current_detail.status_supervisor == "Y") + { + throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + existingEntity.create_evaluation_id = model.create_evaluation_id; existingEntity.supervisor2 = model.supervisor2; existingEntity.supervisor2_result = model.supervisor2_result; diff --git a/Models/eva_evaluation_achievement/eva_evaluation_achievementService.cs b/Models/eva_evaluation_achievement/eva_evaluation_achievementService.cs index d70712b..94021e5 100644 --- a/Models/eva_evaluation_achievement/eva_evaluation_achievementService.cs +++ b/Models/eva_evaluation_achievement/eva_evaluation_achievementService.cs @@ -157,6 +157,15 @@ namespace TodoAPI2.Models throw new Exception("ไม่สามารถบันทึกค่าน้ำหนักในส่วนผลสัมฤทธิ์ของงาน ได้เกิน 100"); } + var current_detail = (from i in _repository.Context.eva_create_evaluation_detail + where i.id == model.create_evaluation_detail_id + select i).FirstOrDefault(); + + if(current_detail.status_self == "Y") + { + throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้"); + } + if (!string.IsNullOrEmpty(model.thefile)) { //Move file from temp to physical @@ -185,6 +194,15 @@ namespace TodoAPI2.Models throw new Exception("ไม่สามารถบันทึกค่าน้ำหนักในส่วนผลสัมฤทธิ์ของงาน ได้เกิน 100"); } + var current_detail = (from i in _repository.Context.eva_create_evaluation_detail + where i.id == model.create_evaluation_detail_id + select i).FirstOrDefault(); + + if (current_detail.status_self == "Y") + { + throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้"); + } + var existingEntity = _repository.Get(id); if (existingEntity != null) { @@ -231,6 +249,15 @@ namespace TodoAPI2.Models var existingEntity = _repository.Get(i.id.Value); if (existingEntity != null) { + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_self == "Y") + { + throw new Exception("ผู้รับการประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; existingEntity.achievement = i.achievement; existingEntity.weight = i.weight; diff --git a/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs b/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs index b09f5ba..af3b29f 100644 --- a/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs +++ b/Models/eva_evaluation_achievement_process/eva_evaluation_achievement_processService.cs @@ -156,6 +156,15 @@ namespace TodoAPI2.Models public eva_evaluation_achievement_processViewModel Update(int id, eva_evaluation_achievement_processInputModel model) { + var current_detail = (from i in _repository.Context.eva_create_evaluation_detail + where i.id == model.create_evaluation_detail_id + select i).FirstOrDefault(); + + if (current_detail.status_chief == "Y") + { + throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + var existingEntity = _repository.Get(id); if (existingEntity != null) { @@ -186,6 +195,16 @@ namespace TodoAPI2.Models if (i.active_mode == "1" && i.id.HasValue) // update { var existingEntity = _repository.Get(i.id.Value); + + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_chief == "Y") + { + throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + if (existingEntity != null) { //existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; diff --git a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs index 69fe00c..6be7e9c 100644 --- a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs +++ b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs @@ -20,14 +20,14 @@ namespace TodoAPI2.Models public class eva_evaluation_achievement_process2Service : Ieva_evaluation_achievement_process2Service { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; public eva_evaluation_achievement_process2Service(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) { _repository = repository; - db = mydb; - ext = inext; + db = mydb; + ext = inext; } #region Private Functions @@ -47,7 +47,7 @@ namespace TodoAPI2.Models { return Mapper.Map>(entities); } - + #endregion #region Public Functions @@ -77,12 +77,12 @@ namespace TodoAPI2.Models public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) { - var model = new eva_evaluation_achievement_process2SearchModel(); + var model = new eva_evaluation_achievement_process2SearchModel(); model.create_evaluation_detail_id = create_evaluation_detail_id; return GetListBySearch(model); } - public List GetListBySearch(eva_evaluation_achievement_process2SearchModel model) + public List GetListBySearch(eva_evaluation_achievement_process2SearchModel model) { var data = ( from m_eva_evaluation_achievement_process2 in _repository.Context.eva_evaluation_achievement @@ -92,7 +92,7 @@ namespace TodoAPI2.Models from fk_eva_create_evaluation_detailResult1 in eva_create_evaluation_detailResult1.DefaultIfEmpty() - where 1==1 + where 1 == 1 //&& (m_eva_evaluation_achievement_process2.id == model.id || !model.id.HasValue) && (m_eva_evaluation_achievement_process2.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue) @@ -135,10 +135,10 @@ namespace TodoAPI2.Models int? newkey = 0; var x = (from i in _repository.Context.eva_evaluation_achievement - 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; } @@ -160,7 +160,7 @@ namespace TodoAPI2.Models } var inserted = _repository.Insert(entity); - + return Get(inserted.id); } @@ -174,21 +174,21 @@ namespace TodoAPI2.Models existingEntity.weight = model.weight; if (!string.IsNullOrEmpty(model.thefile)) { - if (model.thefile.StartsWith("Uploads")) - { - var thefileFileName = FileUtil.MoveTempUploadFileToActualPath( + if (model.thefile.StartsWith("Uploads")) + { + var thefileFileName = FileUtil.MoveTempUploadFileToActualPath( model.thefile, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.thefile); - existingEntity.thefile = thefileFileName; - } - else - { - existingEntity.thefile = model.thefile; - } + existingEntity.thefile = thefileFileName; + } + else + { + existingEntity.thefile = model.thefile; + } + } + else + { + existingEntity.thefile = null; } - else - { - existingEntity.thefile = null; - } //existingEntity.score = model.score; existingEntity.score2 = model.score2; @@ -204,38 +204,48 @@ namespace TodoAPI2.Models return Get(updated.id); } else - throw new NotificationException("No data to update"); + throw new NotificationException("No data to update"); } - public string UpdateMultiple(List model) + public string UpdateMultiple(List 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); + + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_supervisor == "Y") + { + throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + if (existingEntity != null) { - existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; - existingEntity.achievement = i.achievement; - existingEntity.weight = i.weight; - if (!string.IsNullOrEmpty(i.thefile)) - { - if (i.thefile.StartsWith("Uploads")) - { - var thefileFileName = FileUtil.MoveTempUploadFileToActualPath( - i.thefile, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.thefile); - existingEntity.thefile = thefileFileName; - } - else - { - existingEntity.thefile = i.thefile; - } - } - else - { - existingEntity.thefile = null; - } + existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; + existingEntity.achievement = i.achievement; + existingEntity.weight = i.weight; + if (!string.IsNullOrEmpty(i.thefile)) + { + if (i.thefile.StartsWith("Uploads")) + { + var thefileFileName = FileUtil.MoveTempUploadFileToActualPath( + i.thefile, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.thefile); + existingEntity.thefile = thefileFileName; + } + else + { + existingEntity.thefile = i.thefile; + } + } + else + { + existingEntity.thefile = null; + } //existingEntity.score = i.score; existingEntity.score2 = i.score2; @@ -257,15 +267,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(); } diff --git a/Models/eva_evaluation_behavior/eva_evaluation_behaviorService.cs b/Models/eva_evaluation_behavior/eva_evaluation_behaviorService.cs index 5f38c3b..a61fa38 100644 --- a/Models/eva_evaluation_behavior/eva_evaluation_behaviorService.cs +++ b/Models/eva_evaluation_behavior/eva_evaluation_behaviorService.cs @@ -20,14 +20,14 @@ namespace TodoAPI2.Models public class eva_evaluation_behaviorService : Ieva_evaluation_behaviorService { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; public eva_evaluation_behaviorService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) { _repository = repository; - db = mydb; - ext = inext; + db = mydb; + ext = inext; } #region Private Functions @@ -47,7 +47,7 @@ namespace TodoAPI2.Models { return Mapper.Map>(entities); } - + #endregion #region Public Functions @@ -77,12 +77,12 @@ namespace TodoAPI2.Models public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) { - var model = new eva_evaluation_behaviorSearchModel(); + var model = new eva_evaluation_behaviorSearchModel(); model.create_evaluation_detail_id = create_evaluation_detail_id; return GetListBySearch(model); } - public List GetListBySearch(eva_evaluation_behaviorSearchModel model) + public List GetListBySearch(eva_evaluation_behaviorSearchModel model) { var data = ( from m_eva_evaluation_behavior in _repository.Context.eva_evaluation_behavior @@ -92,7 +92,7 @@ namespace TodoAPI2.Models from fk_eva_create_evaluation_detailResult1 in eva_create_evaluation_detailResult1.DefaultIfEmpty() - where 1==1 + where 1 == 1 && (m_eva_evaluation_behavior.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue) @@ -124,10 +124,10 @@ namespace TodoAPI2.Models int? newkey = 0; var x = (from i in _repository.Context.eva_evaluation_behavior - 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; } @@ -149,8 +149,17 @@ namespace TodoAPI2.Models throw new Exception("ไม่สามารถบันทึกค่าน้ำหนักในส่วนผลสัมฤทธิ์ของงาน ได้เกิน 100"); } + var current_detail = (from i in _repository.Context.eva_create_evaluation_detail + where i.id == model.create_evaluation_detail_id + select i).FirstOrDefault(); + + if (current_detail.status_self == "Y") + { + throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้"); + } + var inserted = _repository.Insert(entity); - + return Get(inserted.id); } @@ -169,6 +178,15 @@ namespace TodoAPI2.Models throw new Exception("ไม่สามารถบันทึกค่าน้ำหนักในส่วนพฤติกรรมการปฏิบัติงาน ได้เกิน 100"); } + var current_detail = (from i in _repository.Context.eva_create_evaluation_detail + where i.id == model.create_evaluation_detail_id + select i).FirstOrDefault(); + + if (current_detail.status_self == "Y") + { + throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้"); + } + var existingEntity = _repository.Get(id); if (existingEntity != null) { @@ -181,21 +199,30 @@ namespace TodoAPI2.Models return Get(updated.id); } else - throw new NotificationException("No data to update"); + throw new NotificationException("No data to update"); } - public string UpdateMultiple(List model) + public string UpdateMultiple(List 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.create_evaluation_detail_id = i.create_evaluation_detail_id; - existingEntity.behavior = i.behavior; - existingEntity.weight = i.weight; + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_self == "Y") + { + throw new Exception("ผู้รับการประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + + existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; + existingEntity.behavior = i.behavior; + existingEntity.weight = i.weight; _repository.UpdateWithoutCommit(i.id.Value, existingEntity); @@ -208,15 +235,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(); } diff --git a/Models/eva_evaluation_behavior_process/eva_evaluation_behavior_processService.cs b/Models/eva_evaluation_behavior_process/eva_evaluation_behavior_processService.cs index 14fb854..b1bc31f 100644 --- a/Models/eva_evaluation_behavior_process/eva_evaluation_behavior_processService.cs +++ b/Models/eva_evaluation_behavior_process/eva_evaluation_behavior_processService.cs @@ -193,6 +193,15 @@ namespace TodoAPI2.Models var existingEntity = _repository.Get(i.id.Value); if (existingEntity != null) { + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_chief == "Y") + { + throw new Exception("ผู้ประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + //existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; //existingEntity.behavior = i.behavior; //existingEntity.weight = i.weight; diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs index fe425f5..9d8fb6c 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs @@ -190,6 +190,15 @@ namespace TodoAPI2.Models var existingEntity = _repository.Get(i.id.Value); if (existingEntity != null) { + var current_detail = (from k in _repository.Context.eva_create_evaluation_detail + where k.id == existingEntity.create_evaluation_detail_id + select k).FirstOrDefault(); + + if (current_detail.status_supervisor == "Y") + { + throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + } + //existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; //existingEntity.behavior = i.behavior; //existingEntity.weight = i.weight; diff --git a/Views/eva_adjust_postponement_detail_normal_02View/eva_adjust_postponement_detail_normal_02_inline.cshtml b/Views/eva_adjust_postponement_detail_normal_02View/eva_adjust_postponement_detail_normal_02_inline.cshtml deleted file mode 100644 index 3e9dae6..0000000 --- a/Views/eva_adjust_postponement_detail_normal_02View/eva_adjust_postponement_detail_normal_02_inline.cshtml +++ /dev/null @@ -1,83 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewData["Title"] = "eva_adjust_postponement_detail_normal_02"; -} - -
- -
-
-
-
- จัดการ eva_adjust_postponement_detail_normal_02 - - - -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
ลำดับกิจกรรม
- -
- -
- - - -
-
- -
-
-
- -@section FooterPlaceHolder{ - - -} diff --git a/Views/eva_adjust_postponement_detail_quota_02View/eva_adjust_postponement_detail_quota_02_inline.cshtml b/Views/eva_adjust_postponement_detail_quota_02View/eva_adjust_postponement_detail_quota_02_inline.cshtml deleted file mode 100644 index 9c90c4f..0000000 --- a/Views/eva_adjust_postponement_detail_quota_02View/eva_adjust_postponement_detail_quota_02_inline.cshtml +++ /dev/null @@ -1,85 +0,0 @@ -@{ - Layout = "~/Views/Shared/_Layout.cshtml"; - ViewData["Title"] = "eva_adjust_postponement_detail_quota_02"; -} - -
- -
-
-
-
- จัดการ eva_adjust_postponement_detail_quota_02 - - - -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ลำดับกิจกรรม
- -
- -
- - - -
-
- -
-
-
- -@section FooterPlaceHolder{ - - -} diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml index e7fb0f6..9a5ddfe 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml @@ -262,11 +262,30 @@ +
+ +
+
ส่งข้อตกลงการประเมิน
+ + + + + + + +
+
+ +
+
+ +
@section FooterPlaceHolder{ + - -} - diff --git a/Views/eva_create_evaluation_detail_review02View/eva_create_evaluation_detail_review02_d.cshtml b/Views/eva_create_evaluation_detail_review02View/eva_create_evaluation_detail_review02_d.cshtml deleted file mode 100644 index 9124721..0000000 --- a/Views/eva_create_evaluation_detail_review02View/eva_create_evaluation_detail_review02_d.cshtml +++ /dev/null @@ -1,99 +0,0 @@ -@using Microsoft.Extensions.Configuration -@inject IConfiguration Configuration -@{ - ViewData["Title"] = "eva_create_evaluation_detail_review02"; - Layout = "_LayoutDirect"; -} - -
-
-
- @Configuration["SiteInformation:modulename"] -
-
-
- -
-
- -
-
บันทึกข้อมูล eva_create_evaluation_detail_review02
- -
-
- กรุณากรอกข้อมูลลงในแบบฟอร์ม -
-
- -
-
- -
-
-
- - -
- -
- - -
- -
- - -
-
-
-
- - -
- -
- - -
-
-
-
- - -
-
- - -
-
-
-
- -
-
- - -
-
- -
- -@section FooterPlaceHolder{ - - -} - diff --git a/Views/eva_create_evaluation_detail_review03View/eva_create_evaluation_detail_review03_d.cshtml b/Views/eva_create_evaluation_detail_review03View/eva_create_evaluation_detail_review03_d.cshtml deleted file mode 100644 index 014605d..0000000 --- a/Views/eva_create_evaluation_detail_review03View/eva_create_evaluation_detail_review03_d.cshtml +++ /dev/null @@ -1,99 +0,0 @@ -@using Microsoft.Extensions.Configuration -@inject IConfiguration Configuration -@{ - ViewData["Title"] = "eva_create_evaluation_detail_review03"; - Layout = "_LayoutDirect"; -} - -
-
-
- @Configuration["SiteInformation:modulename"] -
-
-
- -
-
- -
-
บันทึกข้อมูล eva_create_evaluation_detail_review03
- -
-
- กรุณากรอกข้อมูลลงในแบบฟอร์ม -
-
- -
-
- -
-
-
- - -
- -
- - -
- -
- - -
-
-
-
- - -
- -
- - -
-
-
-
- - -
-
- - -
-
-
-
- -
-
- - -
-
- -
- -@section FooterPlaceHolder{ - - -} - diff --git a/Views/eva_create_evaluation_detail_review04View/eva_create_evaluation_detail_review04_d.cshtml b/Views/eva_create_evaluation_detail_review04View/eva_create_evaluation_detail_review04_d.cshtml deleted file mode 100644 index a796e5d..0000000 --- a/Views/eva_create_evaluation_detail_review04View/eva_create_evaluation_detail_review04_d.cshtml +++ /dev/null @@ -1,99 +0,0 @@ -@using Microsoft.Extensions.Configuration -@inject IConfiguration Configuration -@{ - ViewData["Title"] = "eva_create_evaluation_detail_review04"; - Layout = "_LayoutDirect"; -} - -
-
-
- @Configuration["SiteInformation:modulename"] -
-
-
- -
-
- -
-
บันทึกข้อมูล eva_create_evaluation_detail_review04
- -
-
- กรุณากรอกข้อมูลลงในแบบฟอร์ม -
-
- -
-
- -
-
-
- - -
- -
- - -
- -
- - -
-
-
-
- - -
- -
- - -
-
-
-
- - -
-
- - -
-
-
-
- -
-
- - -
-
- -
- -@section FooterPlaceHolder{ - - -} - diff --git a/Views/eva_level_scoreView/eva_level_score_d.cshtml b/Views/eva_level_scoreView/eva_level_score_d.cshtml index 07d66d5..f8ecd1c 100644 --- a/Views/eva_level_scoreView/eva_level_score_d.cshtml +++ b/Views/eva_level_scoreView/eva_level_score_d.cshtml @@ -137,9 +137,9 @@ - - + + diff --git a/tb320eva.xml b/tb320eva.xml index 5f9831c..50b871e 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -966,13 +966,14 @@ Returns the item Error Occurred - + Default constructure for dependency injection + diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js index 97106d0..6edd5de 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js @@ -86,12 +86,14 @@ function eva_create_evaluation_detail_process_GoCreate() { //window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d"); } -function eva_create_evaluation_detail_process_GoEdit(a) { - window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a); -} - -function eva_create_evaluation_detail_process_GoEdit2(a) { - window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a); +function eva_create_evaluation_detail_process_GoEdit(a, role_code) { + if(role_code=="1"){ + window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a); + } + else + { + window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a); + } } function eva_create_evaluation_detail_process_SetEditForm(a) { @@ -174,6 +176,8 @@ function eva_create_evaluation_detail_process_GoDelete(a) { var eva_create_evaluation_detail_processTableV; var eva_create_evaluation_detail_process_setupTable = function (result) { + console.log(result); + tmp = '"'; eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({ "processing": true, @@ -188,7 +192,9 @@ var eva_create_evaluation_detail_process_setupTable = function (result) { { "data": "employee_position" }, { "data": "employee_position_level" }, { "data": "org_id_external_linkage_external_name" }, +{ "data": "role_desc" }, { "data": "id" }, + { "data": "id" }, { "data": "id" }, ], "columnDefs": [ @@ -196,22 +202,28 @@ var eva_create_evaluation_detail_process_setupTable = function (result) { "targets": 0, "data": "id", "render": function (data, type, row, meta) { - return " " -+" "; + return " "; } }, -{ + { "targets": -1, - "data": "id", + "data": "status_supervisor", "render": function (data, type, row, meta) { - return ""; + return row["status_supervisor"]; } }, -{ + { "targets": -2, - "data": "id", + "data": "status_chief", "render": function (data, type, row, meta) { - return ""; + return row["status_chief"]; + } + }, + { + "targets": -3, + "data": "status_self", + "render": function (data, type, row, meta) { + return row["status_self"]; } }], "language": { diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js index 31171ce..62f2591 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js @@ -75,6 +75,7 @@ eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_cr function eva_create_evaluation_detail_process_InitialForm() { var successFunc = function (result) { eva_create_evaluation_detail_process_FeedDataToForm(result); + endLoad(); }; startLoad(); @@ -86,7 +87,8 @@ function eva_create_evaluation_detail_process_InitialForm() { function eva_create_evaluation_detail_process_SetEditForm(a) { var successFunc = function (result) { eva_create_evaluation_detail_process_editMode = "UPDATE"; - eva_create_evaluation_detail_process_FeedDataToForm(result); + eva_create_evaluation_detail_process_FeedDataToForm(result); + setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor); endLoad(); }; startLoad(); @@ -147,6 +149,19 @@ function eva_create_evaluation_detail_process_GoDelete(a) { -//================= Multi-Selection Function ========================================= +//================= Control Function ========================================= +function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor){ + if(status_chief === "Y"){ + $("#btn01").hide(); + $("#btn02").hide(); + $("#btn03").hide(); + $("#btna01").hide(); + $("#btna02").hide(); + $("#btna03").hide(); + $("#thestatus").text("(ผู้ประเมิน ส่งแบบประเมินแล้ว)"); + $("#eva_create_evaluation_detail_review01_supervisor1_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", true); + } +} diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js index dabf721..79ba948 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js @@ -86,6 +86,7 @@ function eva_create_evaluation_detail_process_SetEditForm(a) { var successFunc = function (result) { eva_create_evaluation_detail_process_editMode = "UPDATE"; eva_create_evaluation_detail_process_FeedDataToForm(result); + setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor); endLoad(); }; startLoad(); @@ -146,6 +147,44 @@ function eva_create_evaluation_detail_process_GoDelete(a) { -//================= Multi-Selection Function ========================================= +//================= Control Function ========================================= +function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor){ + if(status_supervisor === "Y"){ + $("#btn01").hide(); + $("#btn02").hide(); + $("#btn03").hide(); + $("#btnb01").hide(); + $("#btnb02").hide(); + $("#btnb03").hide(); + $("#thestatus").text("(ผู้ประเมินสูงสุด ส่งแบบประเมินแล้ว)"); + $("#eva_create_evaluation_detail_review02_supervisor2_result").attr("disabled", true); + $("#eva_create_evaluation_detail_review02_supervisor2_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("disabled", true); + } + + $("#eva_create_evaluation_detail_review03_supervisor1A_result").attr("disabled", true); + $("#eva_create_evaluation_detail_review03_supervisor1A_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("disabled", true); + $("#btnc01").hide(); + + $("#eva_create_evaluation_detail_review04_supervisor2A_result").attr("disabled", true); + $("#eva_create_evaluation_detail_review04_supervisor2A_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("disabled", true); + $("#btnd01").hide(); + + if(role_code === "3"){ + $("#eva_create_evaluation_detail_review03_supervisor1A_result").attr("disabled", false); + $("#eva_create_evaluation_detail_review03_supervisor1A_date").attr("disabled", false); + $("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("disabled", false); + $("#btnc01").show(); + } + + if(role_code === "4"){ + $("#eva_create_evaluation_detail_review04_supervisor2A_result").attr("disabled", false); + $("#eva_create_evaluation_detail_review04_supervisor2A_date").attr("disabled", false); + $("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("disabled", false); + $("#btnd01").show(); + } +} diff --git a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js index 91b407d..3330ec2 100644 --- a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js @@ -63,7 +63,10 @@ function eva_create_evaluation_detail_status_PutUpdate(a) { } var data = eva_create_evaluation_detail_status_GetFromForm(); - if(a == "next1"){ + if(a == "next0"){ + data.status_self = "Y"; + } + else if(a == "next1"){ data.status_chief = "Y"; } else if(a == "back1"){ diff --git a/wwwroot/js/eva_promoted_percentage/eva_promoted_percentage.js b/wwwroot/js/eva_promoted_percentage/eva_promoted_percentage.js index b85cfd4..ed21a1b 100644 --- a/wwwroot/js/eva_promoted_percentage/eva_promoted_percentage.js +++ b/wwwroot/js/eva_promoted_percentage/eva_promoted_percentage.js @@ -165,8 +165,8 @@ var eva_promoted_percentage_setupTable = function (result) { { "data": "code" }, { "data": "detail" }, { "data": "promoted_percentage" }, - { "data": "max_score" }, - { "data": "min_score" }, + { "data": "min_score" }, + { "data": "max_score" }, ], "columnDefs": [ {