diff --git a/ApiControllers/rep_eva_xControllers.cs b/ApiControllers/rep_eva_xControllers.cs index 461cb3c..277c228 100644 --- a/ApiControllers/rep_eva_xControllers.cs +++ b/ApiControllers/rep_eva_xControllers.cs @@ -257,14 +257,14 @@ namespace TodoAPI2.Controllers select x).FirstOrDefault(); if(detail != null) { - i.total_summary_supervisor2A = detail.total_summary_supervisor2A; - i.Final_summary_supervisor2A = detail.Final_summary_supervisor2A; - i.total_summary_competency_supervisor2A = detail.total_summary_competency_supervisor2A; - i.Final_summary_competency_supervisor2A = detail.Final_summary_competency_supervisor2A; - i.achievement_supervisor2A = detail.achievement_supervisor2A; - i.competency_supervisor2A = detail.competency_supervisor2A; - i.score_supervisor2A = detail.score_supervisor2A; - i.level_score_supervisor2A = detail.level_score_supervisor2A; + i.total_summary_supervisor2a = detail.total_summary_supervisor2A; + i.final_summary_supervisor2a = detail.Final_summary_supervisor2A; + i.total_summary_competency_supervisor2a = detail.total_summary_competency_supervisor2A; + i.final_summary_competency_supervisor2a = detail.Final_summary_competency_supervisor2A; + i.achievement_supervisor2a = detail.achievement_supervisor2A; + i.competency_supervisor2a = detail.competency_supervisor2A; + i.score_supervisor2a = detail.score_supervisor2A; + i.level_score_supervisor2a = detail.level_score_supervisor2A; } i.w1 = p.create_evaluation_score1; diff --git a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs index df6f7b4..b2e71c1 100644 --- a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs +++ b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs @@ -174,15 +174,66 @@ namespace TodoAPI2.Models { existingEntity.create_evaluation_id = model.create_evaluation_id; - existingEntity.total_summary_supervisor = model.total_summary_supervisor; - existingEntity.Final_summary_supervisor = model.Final_summary_supervisor; - existingEntity.total_summary_competency_supervisor = model.total_summary_competency_supervisor; - existingEntity.Final_summary_competency_supervisor = model.Final_summary_competency_supervisor; - existingEntity.achievement_supervisor = model.achievement_supervisor; - existingEntity.competency_supervisor = model.competency_supervisor; - existingEntity.score_supervisor = model.score_supervisor; - existingEntity.level_score_supervisor = model.level_score_supervisor; + //existingEntity.total_summary_supervisor = model.total_summary_supervisor; + //existingEntity.Final_summary_supervisor = model.Final_summary_supervisor; + //existingEntity.total_summary_competency_supervisor = model.total_summary_competency_supervisor; + //existingEntity.Final_summary_competency_supervisor = model.Final_summary_competency_supervisor; + //existingEntity.achievement_supervisor = model.achievement_supervisor; + //existingEntity.competency_supervisor = model.competency_supervisor; + //existingEntity.score_supervisor = model.score_supervisor; + //existingEntity.level_score_supervisor = model.level_score_supervisor; + if (model.who_update == "2") + { + existingEntity.total_summary_supervisor = model.total_summary_supervisor; + existingEntity.Final_summary_supervisor = model.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor = model.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor = model.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor = model.achievement_supervisor; + existingEntity.competency_supervisor = model.competency_supervisor; + existingEntity.score_supervisor = model.score_supervisor; + existingEntity.level_score_supervisor = model.level_score_supervisor; + + existingEntity.total_summary_supervisor1A = model.total_summary_supervisor; + existingEntity.Final_summary_supervisor1A = model.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor1A = model.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor1A = model.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor1A = model.achievement_supervisor; + existingEntity.competency_supervisor1A = model.competency_supervisor; + existingEntity.score_supervisor1A = model.score_supervisor; + existingEntity.level_score_supervisor1A = model.level_score_supervisor; + } + else if (model.who_update == "3") + { + existingEntity.total_summary_supervisor1A = model.total_summary_supervisor; + existingEntity.Final_summary_supervisor1A = model.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor1A = model.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor1A = model.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor1A = model.achievement_supervisor; + existingEntity.competency_supervisor1A = model.competency_supervisor; + existingEntity.score_supervisor1A = model.score_supervisor; + existingEntity.level_score_supervisor1A = model.level_score_supervisor; + + existingEntity.total_summary_supervisor2A = model.total_summary_supervisor; + existingEntity.Final_summary_supervisor2A = model.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor2A = model.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor2A = model.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor2A = model.achievement_supervisor; + existingEntity.competency_supervisor2A = model.competency_supervisor; + existingEntity.score_supervisor2A = model.score_supervisor; + existingEntity.level_score_supervisor2A = model.level_score_supervisor; + } + else if (model.who_update == "4") + { + existingEntity.total_summary_supervisor2A = model.total_summary_supervisor; + existingEntity.Final_summary_supervisor2A = model.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor2A = model.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor2A = model.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor2A = model.achievement_supervisor; + existingEntity.competency_supervisor2A = model.competency_supervisor; + existingEntity.score_supervisor2A = model.score_supervisor; + existingEntity.level_score_supervisor2A = model.level_score_supervisor; + } var updated = _repository.Update(id, existingEntity); return Get(updated.id); diff --git a/Models/eva_idp_plan/eva_idp_planEntity.cs b/Models/eva_idp_plan/eva_idp_planEntity.cs index bd9d0e0..3f3bf49 100644 --- a/Models/eva_idp_plan/eva_idp_planEntity.cs +++ b/Models/eva_idp_plan/eva_idp_planEntity.cs @@ -40,6 +40,7 @@ namespace TodoAPI2.Models { temp += " ถึง " + MyHelper.GetDateStringForReport(end_date); } + period_text = temp; } public void DoAfterInsertUpdate(DataContext context) diff --git a/Models/eva_idp_plan/eva_idp_planService.cs b/Models/eva_idp_plan/eva_idp_planService.cs index 972430f..2802eb4 100644 --- a/Models/eva_idp_plan/eva_idp_planService.cs +++ b/Models/eva_idp_plan/eva_idp_planService.cs @@ -20,14 +20,14 @@ namespace TodoAPI2.Models public class eva_idp_planService : Ieva_idp_planService { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; public eva_idp_planService(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,18 +77,18 @@ namespace TodoAPI2.Models public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) { - var model = new eva_idp_planSearchModel(); + var model = new eva_idp_planSearchModel(); model.create_evaluation_detail_id = create_evaluation_detail_id; return GetListBySearch(model); } - public List GetListBySearch(eva_idp_planSearchModel model) + public List GetListBySearch(eva_idp_planSearchModel model) { var data = ( from m_eva_idp_plan in _repository.Context.eva_idp_plan - where 1==1 + where 1 == 1 //&& (m_eva_idp_plan.id == model.id || !model.id.HasValue) && (m_eva_idp_plan.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue) @@ -122,10 +122,10 @@ namespace TodoAPI2.Models int? newkey = 0; var x = (from i in _repository.Context.eva_idp_plan - 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; } @@ -141,7 +141,7 @@ namespace TodoAPI2.Models entity.SetAutoField(_repository.Context); var inserted = _repository.Insert(entity); - + return Get(inserted.id); } @@ -161,23 +161,23 @@ 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.develop = i.develop; - existingEntity.development_method = i.development_method; - existingEntity.start_date = i.start_date; - existingEntity.end_date = i.end_date; + existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; + existingEntity.develop = i.develop; + existingEntity.development_method = i.development_method; + existingEntity.start_date = i.start_date; + existingEntity.end_date = i.end_date; _repository.UpdateWithoutCommit(i.id.Value, existingEntity); @@ -190,15 +190,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_idp_plan_owner/eva_idp_plan_ownerService.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs index 3f8f808..2bd7b7c 100644 --- a/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs @@ -20,14 +20,14 @@ namespace TodoAPI2.Models public class eva_idp_plan_ownerService : Ieva_idp_plan_ownerService { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; public eva_idp_plan_ownerService(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,18 +77,18 @@ namespace TodoAPI2.Models public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) { - var model = new eva_idp_plan_ownerSearchModel(); + var model = new eva_idp_plan_ownerSearchModel(); model.create_evaluation_detail_id = create_evaluation_detail_id; return GetListBySearch(model); } - public List GetListBySearch(eva_idp_plan_ownerSearchModel model) + public List GetListBySearch(eva_idp_plan_ownerSearchModel model) { var data = ( from m_eva_idp_plan_owner in _repository.Context.eva_idp_plan - where 1==1 + where 1 == 1 //&& (m_eva_idp_plan_owner.id == model.id || !model.id.HasValue) && (m_eva_idp_plan_owner.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue) @@ -122,10 +122,10 @@ namespace TodoAPI2.Models int? newkey = 0; var x = (from i in _repository.Context.eva_idp_plan - 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; } @@ -139,9 +139,9 @@ namespace TodoAPI2.Models entity.id = GetNewPrimaryKey(); - + entity.SetAutoField(_repository.Context); var inserted = _repository.Insert(entity); - + return Get(inserted.id); } @@ -156,30 +156,30 @@ namespace TodoAPI2.Models existingEntity.start_date = model.start_date; existingEntity.end_date = model.end_date; - + existingEntity.SetAutoField(_repository.Context); 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 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.develop = i.develop; - existingEntity.development_method = i.development_method; - existingEntity.start_date = i.start_date; - existingEntity.end_date = i.end_date; - + existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; + existingEntity.develop = i.develop; + existingEntity.development_method = i.development_method; + existingEntity.start_date = i.start_date; + existingEntity.end_date = i.end_date; + existingEntity.SetAutoField(_repository.Context); _repository.UpdateWithoutCommit(i.id.Value, existingEntity); } } @@ -187,18 +187,19 @@ namespace TodoAPI2.Models { var entity = GetEntity(i); entity.id = GetNewPrimaryKey(); + entity.SetAutoField(_repository.Context); _repository.InsertWithoutCommit(entity); } else if (i.active_mode == "0" && i.id.HasValue) // remove - { + { _repository.DeleteWithoutCommit(i.id.Value); } else if (i.active_mode == "0" && !i.id.HasValue) { // nothing to do - } + } } - _repository.Context.SaveChanges(); + _repository.Context.SaveChanges(); return model.Count().ToString(); } @@ -222,7 +223,7 @@ namespace TodoAPI2.Models return; } - private Dictionary GetLookupForLog() + private Dictionary GetLookupForLog() { var i = new Dictionary(); @@ -233,7 +234,7 @@ namespace TodoAPI2.Models i.Add("start_date", "ช่วงเวลาเริ่มต้นพัฒนา"); i.Add("txt_start_date", "ช่วงเวลาเริ่มต้นพัฒนา"); i.Add("end_date", "ช่วงเวลาสิ้นสุดพัฒนา"); - i.Add("txt_end_date", "ช่วงเวลาสิ้นสุดพัฒนา"); + i.Add("txt_end_date", "ช่วงเวลาสิ้นสุดพัฒนา"); return i; } @@ -246,4 +247,5 @@ namespace TodoAPI2.Models #endregion } -} \ No newline at end of file +} + diff --git a/Models/rep_eva_x/rep_eva_xInputModel2.cs b/Models/rep_eva_x/rep_eva_xInputModel2.cs index ff4c3a6..b3a8058 100644 --- a/Models/rep_eva_x/rep_eva_xInputModel2.cs +++ b/Models/rep_eva_x/rep_eva_xInputModel2.cs @@ -35,14 +35,14 @@ namespace TodoAPI2.Models public int? selected_round { get; set; } public string round1_text { get; set; } public string round2_text { get; set; } - public decimal? total_summary_supervisor2A { get; set; } - public decimal? Final_summary_supervisor2A { get; set; } - public decimal? total_summary_competency_supervisor2A { get; set; } - public decimal? Final_summary_competency_supervisor2A { get; set; } - public decimal? achievement_supervisor2A { get; set; } - public decimal? competency_supervisor2A { get; set; } - public decimal? score_supervisor2A { get; set; } - public string level_score_supervisor2A { get; set; } + public decimal? total_summary_supervisor2a { get; set; } + public decimal? final_summary_supervisor2a { get; set; } + public decimal? total_summary_competency_supervisor2a { get; set; } + public decimal? final_summary_competency_supervisor2a { get; set; } + public decimal? achievement_supervisor2a { get; set; } + public decimal? competency_supervisor2a { get; set; } + public decimal? score_supervisor2a { get; set; } + public string level_score_supervisor2a { get; set; } public decimal? w1 { get; set; } public decimal? w2 { get; set; } diff --git a/Utils/MyHelper.cs b/Utils/MyHelper.cs index db137e7..20481f3 100644 --- a/Utils/MyHelper.cs +++ b/Utils/MyHelper.cs @@ -255,6 +255,15 @@ public class MyHelper + (d.Month < 10 ? "0" + d.Month.ToString() : d.Month.ToString()) + "-" + (d.Day < 10 ? "0" + d.Day.ToString() : d.Day.ToString()); } + if (propertyInfo.PropertyType.ToString().Contains("Decimal") + || propertyInfo.PropertyType.ToString().Contains("Double") + || propertyInfo.PropertyType.ToString().Contains("Float")) + { + if(value != null) + { + value = ((decimal)value).ToString("0.#####"); + } + } parameter += propertyInfo.Name + "=" + value; } } diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml index 30fb257..6bc65f1 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml @@ -106,20 +106,20 @@ ลาป่วย ลากิจ ลาพักผ่อน - ขอกลับก่อนเวลา + ขอกลับ
ก่อนเวลา สาย ขาด รวม (ป่วย/กิจ) - วัน - ครั้ง - วัน - ครั้ง - สาย - ขาด - วัน - ครั้ง + วัน + ครั้ง + วัน + ครั้ง + สาย + ขาด + วัน + ครั้ง

@*ลาป่วย วัน*@ diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index 851a267..f9a8bd7 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -156,20 +156,20 @@ ลาป่วย ลากิจ ลาพักผ่อน - ขอกลับก่อนเวลา + ขอกลับ
ก่อนเวลา สาย ขาด รวม (ป่วย/กิจ) - วัน - ครั้ง - วัน - ครั้ง - สาย - ขาด - วัน - ครั้ง + วัน + ครั้ง + วัน + ครั้ง + สาย + ขาด + วัน + ครั้ง

@*ลาป่วย วัน*@ diff --git a/wwwroot/js/rep_eva_x/rep_eva_x_report.js b/wwwroot/js/rep_eva_x/rep_eva_x_report.js index 5717180..7a2b1a4 100644 --- a/wwwroot/js/rep_eva_x/rep_eva_x_report.js +++ b/wwwroot/js/rep_eva_x/rep_eva_x_report.js @@ -45,6 +45,7 @@ function rep_eva_x_DoSearch(fileType, data) { var report_url = apisite + "/api/rep_eva_x/rep_eva_x_report?" + p; if (fileType === "pdf") { + $("#report_result").attr("src", ""); $("#report_result").attr("src", report_url); $("#report_result").show(); //window.open(report_url);