From da69b4fee4997a51c557835ce32c01034f487fc8 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Thu, 14 May 2020 21:17:29 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=A7=E0=B8=A1=20code=20=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=20op=204=20=E0=B8=82=E0=B9=89=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eva_idp_plan_ownerControllers.cs | 320 ++++++++++++++++++ EXCEL/eva_idp_plan@eva_idp_plan_owner.xlsx | Bin 0 -> 10631 bytes ...reate_evaluation_detail_review01Service.cs | 2 +- ...reate_evaluation_detail_review02Service.cs | 2 +- .../Ieva_idp_plan_ownerService.cs | 28 ++ .../eva_idp_plan_ownerInputModel.cs | 32 ++ .../eva_idp_plan_ownerReportRequestModel.cs | 21 ++ .../eva_idp_plan_ownerSearchModel.cs | 23 ++ .../eva_idp_plan_ownerService.cs | 249 ++++++++++++++ .../eva_idp_plan_ownerViewModel.cs | 33 ++ ...va_idp_plan_ownerWithSelectionViewModel.cs | 12 + Startup.cs | 6 + Views/Shared/_Layout.cshtml | 1 - ...reate_evaluation_detail_agreement_d.cshtml | 88 +++++ ..._create_evaluation_detail_process_d.cshtml | 12 +- ...create_evaluation_detail_process_d2.cshtml | 19 +- tb320eva.xml | 97 ++++++ .../eva_create_evaluation_detail_process_d.js | 6 +- ...eva_create_evaluation_detail_process_d2.js | 8 +- ...a_evaluation_achievement_process_inline.js | 1 - wwwroot/js/eva_idp_plan/eva_idp_plan.js | 9 +- .../eva_idp_plan_owner/eva_idp_plan_owner.js | 218 ++++++++++++ 22 files changed, 1152 insertions(+), 35 deletions(-) create mode 100644 ApiControllers/eva_idp_plan_ownerControllers.cs create mode 100644 EXCEL/eva_idp_plan@eva_idp_plan_owner.xlsx create mode 100644 Models/eva_idp_plan_owner/Ieva_idp_plan_ownerService.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerInputModel.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerReportRequestModel.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerSearchModel.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerViewModel.cs create mode 100644 Models/eva_idp_plan_owner/eva_idp_plan_ownerWithSelectionViewModel.cs create mode 100644 wwwroot/js/eva_idp_plan_owner/eva_idp_plan_owner.js diff --git a/ApiControllers/eva_idp_plan_ownerControllers.cs b/ApiControllers/eva_idp_plan_ownerControllers.cs new file mode 100644 index 0000000..df1dc4c --- /dev/null +++ b/ApiControllers/eva_idp_plan_ownerControllers.cs @@ -0,0 +1,320 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; +using TTSW.Controllers; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.Data; +using Microsoft.Extensions.Configuration; +using System.IO; + +namespace TodoAPI2.Controllers +{ + //[Authorize] + [Produces("application/json")] + [Route("api/eva_idp_plan_owner")] + public class eva_idp_plan_ownerController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_idp_plan_ownerService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_idp_plan_ownerController(ILogger logger, Ieva_idp_plan_ownerService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [HttpGet("{id}")] + [ProducesResponseType(typeof(eva_idp_plan_ownerWithSelectionViewModel), 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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(eva_idp_plan_ownerWithSelectionViewModel), 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}"); + } + } + + /// + /// Get list items by create_evaluation_detail_id + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetList(int? create_evaluation_detail_id) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListBycreate_evaluation_detail_id(create_evaluation_detail_id)); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetList.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetListBySearch(eva_idp_plan_ownerSearchModel 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}"); + } + } + + /// + /// Create new item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPost("")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Insert([FromBody] eva_idp_plan_ownerInputModel model) + { + if (ModelState.IsValid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.Insert(model); + var message = new CommonResponseMessage(); + message.code = "200"; + message.message = $"เพิ่มข้อมูล เรียบร้อย"; + message.data = result; + return Ok(message); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while insert.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + return BadRequest(ModelState); + } + + /// + /// Update item + /// + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("{id}")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult Update(int id, [FromBody] eva_idp_plan_ownerInputModel model) + { + if (ModelState.IsValid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.Update(id, model); + var message = new CommonResponseMessage(); + message.code = "200"; + message.message = $"แก้ไขข้อมูล เรียบร้อย"; + message.data = result; + return Ok(message); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while update {id.ToString()}.", ex); + return StatusCode(500, $"{id.ToString()}. {ex.Message}"); + } + } + + return BadRequest(ModelState); + } + + /// + /// Delete item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + /// + /// Update multiple item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("UpdateMultiple")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult UpdateMultiple([FromBody] List model) + { + if (ModelState.IsValid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + string rowCount = _repository.UpdateMultiple(model); + var message = new CommonResponseMessage(); + message.code = "200"; + message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ"; + message.data = null; + return Ok(message); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while UpdateMultiple.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + return BadRequest(ModelState); + } + + + } +} diff --git a/EXCEL/eva_idp_plan@eva_idp_plan_owner.xlsx b/EXCEL/eva_idp_plan@eva_idp_plan_owner.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..1d0fdddf1627005dc57456806ca89af38c342e0a GIT binary patch literal 10631 zcmeHtg;yL~_H{$!PVfN1-3e|%f@^RM+PKpJIs}Ktoj{Oa!QEX01eYMeAwdGc-2=bQ zdoz=H%=^B7V5VxVs#UA%?5ca~>~rqj=c*|J5%2*>02BZKKn0NC4;XWV0{{>Z0RTJz z3cP`olOq`92sYM)ID_1b*gYNWDRU6u8M6TJu;>4`{TKH@spf#=M^2nJ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yn!(ZnD7%Bd3 z(aS@_zn1?0-EbHdU;f_<0UqK!tOx%_x`(Zodr%#IX#B7;_uIG{{SV{+sM9?}cvy}3 zjR3&<*X#d(wV8*2k`Ia-zX9Q4GZ9#O9+o;D0z8ypegnKG{IgB}5@a5lKAiLXHnk#s z*qGllpob`b9jN@q001swZulR=mWSpK)68!G2=yNy@gT|kZPIxN`qxPP8xjDBfYs3c b^-ceX+iHr4FdqZ}Fkm}9%#9W4e_j0_FxzCG literal 0 HcmV?d00001 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 3aeeeaf..aa6a98a 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 @@ -170,7 +170,7 @@ namespace TodoAPI2.Models existingEntity.supervisor1 = model.supervisor1; existingEntity.supervisor1_result = model.supervisor1_result; existingEntity.supervisor1_remark = model.supervisor1_remark; - existingEntity.supervisor1_date = model.supervisor1_date; + existingEntity.supervisor1_date = DateTime.Now; var updated = _repository.Update(id, existingEntity); 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 a0b037f..e62a654 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 @@ -168,7 +168,7 @@ namespace TodoAPI2.Models existingEntity.supervisor2 = model.supervisor2; existingEntity.supervisor2_result = model.supervisor2_result; existingEntity.supervisor2_remark = model.supervisor2_remark; - existingEntity.supervisor2_date = model.supervisor2_date; + existingEntity.supervisor2_date = DateTime.Now; var updated = _repository.Update(id, existingEntity); diff --git a/Models/eva_idp_plan_owner/Ieva_idp_plan_ownerService.cs b/Models/eva_idp_plan_owner/Ieva_idp_plan_ownerService.cs new file mode 100644 index 0000000..96cab28 --- /dev/null +++ b/Models/eva_idp_plan_owner/Ieva_idp_plan_ownerService.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; + +namespace TodoAPI2.Models +{ + public interface Ieva_idp_plan_ownerService : IBaseService + { + new eva_idp_plan_ownerViewModel Insert(eva_idp_plan_ownerInputModel model); + new eva_idp_plan_ownerViewModel Update(int id, eva_idp_plan_ownerInputModel model); + List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id); + List GetListBySearch(eva_idp_plan_ownerSearchModel model); + + string UpdateMultiple(List model); + eva_idp_plan_ownerWithSelectionViewModel GetWithSelection(int id); + eva_idp_plan_ownerWithSelectionViewModel GetBlankItem(); + + + + } +} + diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerInputModel.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerInputModel.cs new file mode 100644 index 0000000..cbfb7ee --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerInputModel.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerInputModel + { + + public int? id { get; set; } + + public int? create_evaluation_detail_id { get; set; } + + public string develop { get; set; } + + public string development_method { get; set; } + + public DateTime? start_date { get; set; } + + public DateTime? end_date { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerReportRequestModel.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerReportRequestModel.cs new file mode 100644 index 0000000..7bf0889 --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerReportRequestModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerReportRequestModel : eva_idp_plan_ownerSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerSearchModel.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerSearchModel.cs new file mode 100644 index 0000000..57e1457 --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerSearchModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerSearchModel + { + + public int id { get; set; } + + public int? create_evaluation_detail_id { get; set; } + + } +} + diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs new file mode 100644 index 0000000..3f8f808 --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerService.cs @@ -0,0 +1,249 @@ +using AutoMapper; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.IO; +using System.Web; +using System.Net; +using TTSW.Configure; +using Microsoft.Extensions.Options; +using System.Data; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerService : Ieva_idp_plan_ownerService + { + private IBaseRepository2 _repository; + 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; + } + + #region Private Functions + private eva_idp_planEntity GetEntity(eva_idp_plan_ownerInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_idp_plan_ownerViewModel GetDto(eva_idp_planEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_idp_plan_ownerViewModel Get(int id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + public eva_idp_plan_ownerWithSelectionViewModel GetWithSelection(int id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + + + return i; + } + public eva_idp_plan_ownerWithSelectionViewModel GetBlankItem() + { + var i = new eva_idp_plan_ownerWithSelectionViewModel(); + + + return i; + } + + public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) + { + 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) + { + var data = ( + from m_eva_idp_plan_owner in _repository.Context.eva_idp_plan + + + 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) + + + orderby m_eva_idp_plan_owner.created descending + select new eva_idp_plan_ownerViewModel() + { + id = m_eva_idp_plan_owner.id, + create_evaluation_detail_id = m_eva_idp_plan_owner.create_evaluation_detail_id, + develop = m_eva_idp_plan_owner.develop, + development_method = m_eva_idp_plan_owner.development_method, + start_date = m_eva_idp_plan_owner.start_date, + end_date = m_eva_idp_plan_owner.end_date, + + + isActive = m_eva_idp_plan_owner.isActive, + Created = m_eva_idp_plan_owner.created, + Updated = m_eva_idp_plan_owner.updated + } + ).Take(100).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + public int GetNewPrimaryKey() + { + int? newkey = 0; + + var x = (from i in _repository.Context.eva_idp_plan + orderby i.id descending + select i).Take(1).ToList(); + + if(x.Count > 0) + { + newkey = x[0].id + 1; + } + + return newkey.Value; + } + + public eva_idp_plan_ownerViewModel Insert(eva_idp_plan_ownerInputModel model) + { + var entity = GetEntity(model); + entity.id = GetNewPrimaryKey(); + + + + var inserted = _repository.Insert(entity); + + return Get(inserted.id); + } + + public eva_idp_plan_ownerViewModel Update(int id, eva_idp_plan_ownerInputModel model) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.create_evaluation_detail_id = model.create_evaluation_detail_id; + existingEntity.develop = model.develop; + existingEntity.development_method = model.development_method; + existingEntity.start_date = model.start_date; + existingEntity.end_date = model.end_date; + + + var updated = _repository.Update(id, existingEntity); + return Get(updated.id); + } + else + throw new NotificationException("No data to update"); + } + + public string UpdateMultiple(List 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; + + + _repository.UpdateWithoutCommit(i.id.Value, existingEntity); + } + } + else if (i.active_mode == "1" && !i.id.HasValue) // add + { + var entity = GetEntity(i); + entity.id = GetNewPrimaryKey(); + _repository.InsertWithoutCommit(entity); + } + else if (i.active_mode == "0" && i.id.HasValue) // remove + { + _repository.DeleteWithoutCommit(i.id.Value); + } + else if (i.active_mode == "0" && !i.id.HasValue) + { + // nothing to do + } + } + _repository.Context.SaveChanges(); + + return model.Count().ToString(); + } + + public eva_idp_plan_ownerViewModel SetAsActive(int id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_idp_plan_ownerViewModel SetAsInactive(int id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(int id) + { + _repository.Delete(id); + + return; + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("create_evaluation_detail_id", "create_evaluation_detail_id"); + i.Add("develop", "ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา"); + i.Add("development_method", "วิธีการพัฒนา"); + i.Add("start_date", "ช่วงเวลาเริ่มต้นพัฒนา"); + i.Add("txt_start_date", "ช่วงเวลาเริ่มต้นพัฒนา"); + i.Add("end_date", "ช่วงเวลาสิ้นสุดพัฒนา"); + i.Add("txt_end_date", "ช่วงเวลาสิ้นสุดพัฒนา"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerViewModel.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerViewModel.cs new file mode 100644 index 0000000..822c6ee --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerViewModel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerViewModel : BaseViewModel2 + { + + public int? create_evaluation_detail_id { get; set; } + + public string develop { get; set; } + + public string development_method { get; set; } + + public DateTime? start_date { get; set; } + + public string txt_start_date { get { return MyHelper.GetDateStringForReport(this.start_date); } } + + public DateTime? end_date { get; set; } + + public string txt_end_date { get { return MyHelper.GetDateStringForReport(this.end_date); } } + + + } +} \ No newline at end of file diff --git a/Models/eva_idp_plan_owner/eva_idp_plan_ownerWithSelectionViewModel.cs b/Models/eva_idp_plan_owner/eva_idp_plan_ownerWithSelectionViewModel.cs new file mode 100644 index 0000000..e26fcc9 --- /dev/null +++ b/Models/eva_idp_plan_owner/eva_idp_plan_ownerWithSelectionViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_idp_plan_ownerWithSelectionViewModel: eva_idp_plan_ownerViewModel + { + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 53a3f13..f5a4a3e 100644 --- a/Startup.cs +++ b/Startup.cs @@ -292,6 +292,8 @@ namespace Test01 services.AddScoped, BaseRepository2>(); services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -499,6 +501,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 76e7df9..d1e87ba 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -12,7 +12,6 @@ @Environment.GetEnvironmentVariable("JasperReportServer_MainURL") @Environment.GetEnvironmentVariable("JasperReportServer_reportsite") @Environment.GetEnvironmentVariable("JasperReportServer_username") - @Environment.GetEnvironmentVariable("JasperReportServer_password") "> @Environment.GetEnvironmentVariable("SiteInformation_sitename") 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 aaaaec7..cb6c16f 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 @@ -143,6 +143,57 @@ + +
@@ -297,6 +348,38 @@
+ +
+
แผนพัฒนาการปฏิบัติงานรายบุคคล
+
+
+ + + +
+ +
+ +
+
+ + + + + + + + + + + + + +
เครื่องมือ
+
+ +
+
ส่งข้อตกลงการประเมิน
@@ -321,6 +404,7 @@ + } 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 9fb3501..62e159d 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 @@ -171,7 +171,7 @@ ลำดับ - + @@ -179,7 +179,7 @@ - + @@ -229,13 +229,13 @@ ลำดับ - + - + @@ -282,7 +282,7 @@ - + @@ -340,7 +340,7 @@
- +
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 385ea12..ba73751 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 @@ -23,23 +23,23 @@
- +
- +
- +
- +
@@ -47,7 +47,7 @@
-