From 4859e4bdbdb6a4c60c205fd530f9ef5d9c8e5173 Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Wed, 24 Mar 2021 20:53:25 +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=20=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=9A=E0=B8=B8=E0=B8=84=E0=B8=84?= =?UTF-8?q?=E0=B8=A5=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vw_eva_performance_planControllers.cs | 164 ++++++++++++++ ...formance_plan@vw_eva_performance_plan.xlsx | Bin 0 -> 10206 bytes .../Ivw_eva_performance_planService.cs | 28 +++ .../vw_eva_performance_planInputModel.cs | 26 +++ ..._eva_performance_planReportRequestModel.cs | 21 ++ .../vw_eva_performance_planSearchModel.cs | 25 ++ .../vw_eva_performance_planService.cs | 133 +++++++++++ .../vw_eva_performance_planViewModel.cs | 23 ++ ..._performance_planWithSelectionViewModel.cs | 12 + Startup.cs | 6 + .../vw_eva_performance_planViewControllers.cs | 66 ++++++ .../rep_eva_self_review_all_report.cshtml | 1 + .../vw_eva_performance_plan.cshtml | 92 ++++++++ tb320eva.xml | 56 +++++ .../rep_eva_self_review_all_report.js | 4 + .../vw_eva_performance_plan.js | 213 ++++++++++++++++++ 16 files changed, 870 insertions(+) create mode 100644 ApiControllers/vw_eva_performance_planControllers.cs create mode 100644 EXCEL/eva_performance_plan@vw_eva_performance_plan.xlsx create mode 100644 Models/vw_eva_performance_plan/Ivw_eva_performance_planService.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planInputModel.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planReportRequestModel.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planSearchModel.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planService.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planViewModel.cs create mode 100644 Models/vw_eva_performance_plan/vw_eva_performance_planWithSelectionViewModel.cs create mode 100644 ViewControllers/vw_eva_performance_planViewControllers.cs create mode 100644 Views/vw_eva_performance_planView/vw_eva_performance_plan.cshtml create mode 100644 wwwroot/js/vw_eva_performance_plan/vw_eva_performance_plan.js diff --git a/ApiControllers/vw_eva_performance_planControllers.cs b/ApiControllers/vw_eva_performance_planControllers.cs new file mode 100644 index 0000000..4b0bc78 --- /dev/null +++ b/ApiControllers/vw_eva_performance_planControllers.cs @@ -0,0 +1,164 @@ +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/vw_eva_performance_plan")] + public class vw_eva_performance_planController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ivw_eva_performance_planService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public vw_eva_performance_planController(ILogger logger, Ivw_eva_performance_planService 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(vw_eva_performance_planWithSelectionViewModel), 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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(vw_eva_performance_planWithSelectionViewModel), 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 fiscal_year + /// + /// + /// + /// 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? fiscal_year) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListByfiscal_year(fiscal_year)); + } + 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(vw_eva_performance_planSearchModel 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}"); + } + } + + + } +} diff --git a/EXCEL/eva_performance_plan@vw_eva_performance_plan.xlsx b/EXCEL/eva_performance_plan@vw_eva_performance_plan.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..96c6f63266e48c7ca0e5812e77c00375a3f59739 GIT binary patch literal 10206 zcmeHtbx>T(w)fx=T!I7(?(XivCAb7qP0Ncxjl31XUaT zj}qwXxjmtwZXIZOIyZb1UXMUkrWbN6TCJ_G**P>RE7DzvHJFnwqv>#}RGMmUNM(1w zOycC|S6LG9OOT3Ml|dERv6G^3gdky5vEiJ&wD5yxp;&JI(#Za-XTjsG(VjGZbLRKY z^=^iD0s&v+qBL@pXR1L>)|;`&r>QQd`<#QH%EOty=mPhZE|DHQ@PTj79T@XZ@%+bk zUS_ey9ecI~A-aTMSS1>2DIjCK_|N?3 zD6sx0`x4HUa~DxW*QJYS%bB@iq-)8?XoL?CIeUDB0jT^7v2X+^>OtipDK}1T2=vs>$*-Ks)_XDC zXU=CXQl;fQY2Djm=}Q}nKFSZRQoNcvmaM`UXV!Xwg#C#q1Xn24U$W^Tg!Pooax!igVa+xcr+9cNm{f5u~`2u zB>uulDW{MfX@&^N3jiXNhb_w=asqO2wlQ&Vu=&lJ{Yz$`ASMlh@}J$xR2AiWAu1jD zA(R!A?*1He-j#)XUt}zjIAM@63y1f|6)hD(XkG!i zsqL2s)HXD{Orta3dTf$dynxRR@Fe|uN`NFQ zi0TR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?24M@A04~vVhe2iPAvEs~y|`-Zx6s=@i!PBq zYnf_hWA5po8sE)B7sc>Lmk8aV*|K{$(q?|mM!|uVz)NXGFyNXsL3zJJoqY~k4+#() zdqh93r=)9>vr141qY?eOE&Pbl$McU2m;z-}ItrPoga-gXp7Go5)msPkq%kSklD-9gIE((_%v;uNb;7b@7 zM2SxL5UPe)ztnj2$4DV92DiM%Mo>eHdjTf& zi$T9YJ%+v(^E2+siB*6xf_Hawc7ok9i8G968$9kpp+X5q@$6KkkN=1$6B7_m2%S?4 zk-L9z;a9|P=OZ9fm=L>)@mG;Fc69u&L_)Ug&z6xO=CH_$5)6j9AVpawxx z;W?``fl6?&k}L2al}~*s`!N1^-PU=3;+o|g#KO|ri=1>gI z7{xS|=(`MrtJr*_uFwE?n?y|PR=nA&p=Tpl#;48GPeFUluF_x>^2si0xJW~}l!USG zP0sDGO$$yRX&~#GdM?j=s%R9~T!DF+kNB4x&`9hYGzR@ph!tOl3=gQf(;I;A-*c$*na!{{dK<9{N5ZDb_`=iNj9_KhR;GD zp~O+^*y+cGdTNPL7DwGns~mgJ#CdeGy>CH6)8knU-A7mGQ|Pn9rBc_$o1o0mq_@|@ zH>8l0_#*^`f@Xr$HvajJ(!b8@U;RJaSW=PyJHX#>PyCDUx4sY}6o0u(@s#lI73IGY zjzILw|G&Qc6z6G~@fXq~y{{jqx)Hoo3PxJRr0iNa+egTl;{;{V2$uc}8eHtVDB8_?RbTPjohNmch zcT|31007D)0KmVwElP5lcJ0N5b=%QyY0w^iifAUp^F Qpg?}q5H`-G{B89A0PJ0%-v9sr literal 0 HcmV?d00001 diff --git a/Models/vw_eva_performance_plan/Ivw_eva_performance_planService.cs b/Models/vw_eva_performance_plan/Ivw_eva_performance_planService.cs new file mode 100644 index 0000000..036e9a2 --- /dev/null +++ b/Models/vw_eva_performance_plan/Ivw_eva_performance_planService.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 Ivw_eva_performance_planService + { + List GetListByfiscal_year(int? fiscal_year); + List GetListBySearch(vw_eva_performance_planSearchModel model); + + vw_eva_performance_planWithSelectionViewModel GetWithSelection(Guid id); + vw_eva_performance_planWithSelectionViewModel GetBlankItem(); + + eva_performance_planEntity GetEntity(Guid id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planInputModel.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planInputModel.cs new file mode 100644 index 0000000..8949cd2 --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planInputModel.cs @@ -0,0 +1,26 @@ +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 vw_eva_performance_planInputModel + { + + public Guid? id { get; set; } + + public int? fiscal_year { get; set; } + + public int? theTime { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planReportRequestModel.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planReportRequestModel.cs new file mode 100644 index 0000000..19ad14e --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planReportRequestModel.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 vw_eva_performance_planReportRequestModel : vw_eva_performance_planSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planSearchModel.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planSearchModel.cs new file mode 100644 index 0000000..1a23d5a --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planSearchModel.cs @@ -0,0 +1,25 @@ +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 vw_eva_performance_planSearchModel + { + + public Guid id { get; set; } + + public int? fiscal_year { get; set; } + + public int? theTime { get; set; } + + } +} + diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planService.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planService.cs new file mode 100644 index 0000000..2079c3f --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planService.cs @@ -0,0 +1,133 @@ +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 vw_eva_performance_planService : Ivw_eva_performance_planService + { + private IBaseRepository _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public vw_eva_performance_planService(IBaseRepository repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + #region Private Functions + private eva_performance_planEntity GetEntity(vw_eva_performance_planInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private vw_eva_performance_planViewModel GetDto(eva_performance_planEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public vw_eva_performance_planViewModel Get(Guid id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_performance_planEntity GetEntity(Guid id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public vw_eva_performance_planWithSelectionViewModel GetWithSelection(Guid id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + + + return i; + } + public vw_eva_performance_planWithSelectionViewModel GetBlankItem() + { + var i = new vw_eva_performance_planWithSelectionViewModel(); + + + return i; + } + + public List GetListByfiscal_year(int? fiscal_year) + { + var model = new vw_eva_performance_planSearchModel(); + model.fiscal_year = fiscal_year; + return GetListBySearch(model); + } + + public List GetListBySearch(vw_eva_performance_planSearchModel model) + { + var data = ( + from m_vw_eva_performance_plan in _repository.Context.eva_performance_plan + + + where + 1 == 1 + && (!model.fiscal_year.HasValue || m_vw_eva_performance_plan.fiscal_year == model.fiscal_year) + && (!model.theTime.HasValue || m_vw_eva_performance_plan.theTime == model.theTime) + + + orderby m_vw_eva_performance_plan.created descending + select new vw_eva_performance_planViewModel() + { + id = m_vw_eva_performance_plan.id, + fiscal_year = m_vw_eva_performance_plan.fiscal_year, + theTime = m_vw_eva_performance_plan.theTime, + + + isActive = m_vw_eva_performance_plan.isActive, + Created = m_vw_eva_performance_plan.created, + Updated = m_vw_eva_performance_plan.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + + + #endregion + } +} \ No newline at end of file diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planViewModel.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planViewModel.cs new file mode 100644 index 0000000..b063379 --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planViewModel.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 vw_eva_performance_planViewModel : BaseViewModel2 + { + + public int? fiscal_year { get; set; } + + public int? theTime { get; set; } + + + } +} \ No newline at end of file diff --git a/Models/vw_eva_performance_plan/vw_eva_performance_planWithSelectionViewModel.cs b/Models/vw_eva_performance_plan/vw_eva_performance_planWithSelectionViewModel.cs new file mode 100644 index 0000000..805f961 --- /dev/null +++ b/Models/vw_eva_performance_plan/vw_eva_performance_planWithSelectionViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class vw_eva_performance_planWithSelectionViewModel: vw_eva_performance_planViewModel + { + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 07f8c78..8f8ab37 100644 --- a/Startup.cs +++ b/Startup.cs @@ -325,6 +325,8 @@ namespace Test01 services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -604,6 +606,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/vw_eva_performance_planViewControllers.cs b/ViewControllers/vw_eva_performance_planViewControllers.cs new file mode 100644 index 0000000..f44a497 --- /dev/null +++ b/ViewControllers/vw_eva_performance_planViewControllers.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using TodoAPI2.Models; +using STAFF_API.Models; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Configuration; +using TodoAPI2.Controllers; + +namespace TodoAPI2.Controllers +{ + public class vw_eva_performance_planViewController : Controller + { + private ILogger _logger; + private Ivw_eva_performance_planService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public vw_eva_performance_planViewController(ILogger logger, Ivw_eva_performance_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult vw_eva_performance_plan() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + public IActionResult vw_eva_performance_plan_d() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult vw_eva_performance_plan_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult vw_eva_performance_plan_inline() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} + + diff --git a/Views/rep_eva_self_review_allView/rep_eva_self_review_all_report.cshtml b/Views/rep_eva_self_review_allView/rep_eva_self_review_all_report.cshtml index a29a5bc..0648e7f 100644 --- a/Views/rep_eva_self_review_allView/rep_eva_self_review_all_report.cshtml +++ b/Views/rep_eva_self_review_allView/rep_eva_self_review_all_report.cshtml @@ -26,6 +26,7 @@
+
diff --git a/Views/vw_eva_performance_planView/vw_eva_performance_plan.cshtml b/Views/vw_eva_performance_planView/vw_eva_performance_plan.cshtml new file mode 100644 index 0000000..7d4c036 --- /dev/null +++ b/Views/vw_eva_performance_planView/vw_eva_performance_plan.cshtml @@ -0,0 +1,92 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "vw_eva_performance_plan"; +} + + + +
+
+
+
+

@Configuration["SiteInformation:modulename"]

+
+
+ +
+
+
+
+ + +
+
+ + +
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ + + + + + + + + + +
เครื่องมือ
+
+
+
+ +
+ + +
+ +
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/tb320eva.xml b/tb320eva.xml index f75a344..1b73ada 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -4794,6 +4794,54 @@ Returns the item Error Occurred + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by fiscal_year + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + Default constructure for dependency injection @@ -5292,6 +5340,14 @@ + + + Default constructure for dependency injection + + + + + Default constructure for dependency injection diff --git a/wwwroot/js/rep_eva_self_review_all/rep_eva_self_review_all_report.js b/wwwroot/js/rep_eva_self_review_all/rep_eva_self_review_all_report.js index db7722d..72e0480 100644 --- a/wwwroot/js/rep_eva_self_review_all/rep_eva_self_review_all_report.js +++ b/wwwroot/js/rep_eva_self_review_all/rep_eva_self_review_all_report.js @@ -2,6 +2,10 @@ //================= Search Customizaiton ========================================= +function rep_eva_self_review_all_GoBack() { + window.location = appsite + "/vw_eva_performance_planView/vw_eva_performance_plan"; +} + function rep_eva_self_review_all_GetSearchParameter(fileType) { var rep_eva_self_review_allSearchObject = new Object(); rep_eva_self_review_allSearchObject.employee_id = $("#s_rep_eva_self_review_all_employee_id").val(); diff --git a/wwwroot/js/vw_eva_performance_plan/vw_eva_performance_plan.js b/wwwroot/js/vw_eva_performance_plan/vw_eva_performance_plan.js new file mode 100644 index 0000000..dc610d5 --- /dev/null +++ b/wwwroot/js/vw_eva_performance_plan/vw_eva_performance_plan.js @@ -0,0 +1,213 @@ +var vw_eva_performance_plan_editMode = "CREATE"; +var vw_eva_performance_plan_API = "/api/vw_eva_performance_plan/"; + +//================= Search Customizaiton ========================================= + +function vw_eva_performance_plan_GetSearchParameter() { + var vw_eva_performance_planSearchObject = new Object(); + vw_eva_performance_planSearchObject.fiscal_year = $("#s_vw_eva_performance_plan_fiscal_year").val(); + vw_eva_performance_planSearchObject.theTime = $("#s_vw_eva_performance_plan_theTime").val(); + + return vw_eva_performance_planSearchObject; +} + +function vw_eva_performance_plan_FeedDataToSearchForm(data) { + $("#s_vw_eva_performance_plan_fiscal_year").val(data.fiscal_year); + $("#s_vw_eva_performance_plan_theTime").val(data.theTime); + +} + +//================= Form Data Customizaiton ========================================= + +function vw_eva_performance_plan_FeedDataToForm(data) { + $("#vw_eva_performance_plan_id").val(data.id); + $("#vw_eva_performance_plan_fiscal_year").val(data.fiscal_year); + $("#vw_eva_performance_plan_theTime").val(data.theTime); + +} + +function vw_eva_performance_plan_GetFromForm() { + var vw_eva_performance_planObject = new Object(); + vw_eva_performance_planObject.id = $("#vw_eva_performance_plan_id").val(); + vw_eva_performance_planObject.fiscal_year = $("#vw_eva_performance_plan_fiscal_year").val(); + vw_eva_performance_planObject.theTime = $("#vw_eva_performance_plan_theTime").val(); + + + return vw_eva_performance_planObject; +} + +function vw_eva_performance_plan_InitialForm(s) { + var successFunc = function (result) { + vw_eva_performance_plan_FeedDataToForm(result); + vw_eva_performance_plan_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#vw_eva_performance_planModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function vw_eva_performance_plan_GoAll() { + window.location = appsite + "/rep_eva_self_review_allView/rep_eva_self_review_all_report"; +} + +function vw_eva_performance_plan_GoEdit(a) { + alert("กำลังจัดทำ"); +} + +function vw_eva_performance_plan_SetEditForm(a) { + var successFunc = function (result) { + vw_eva_performance_plan_editMode = "UPDATE"; + vw_eva_performance_plan_FeedDataToForm(result); + $("#vw_eva_performance_planModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + vw_eva_performance_plan_API + a, successFunc, AlertDanger); +} + +function vw_eva_performance_plan_SetCreateForm(s) { + vw_eva_performance_plan_editMode = "CREATE"; + vw_eva_performance_plan_InitialForm(s); +} + +function vw_eva_performance_plan_RefreshTable() { + // Incase model popup + vw_eva_performance_plan_DoSearch(); + + // Incase open new page + //window.parent.vw_eva_performance_plan_DoSearch(); +} + +//================= Update and Delete ========================================= + +var vw_eva_performance_plan_customValidation = function (group) { + return ""; +}; + +function vw_eva_performance_plan_PutUpdate() { + if (!ValidateForm('vw_eva_performance_plan', vw_eva_performance_plan_customValidation)) { + return; + } + + var data = vw_eva_performance_plan_GetFromForm(); + + //Update Mode + if (vw_eva_performance_plan_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#vw_eva_performance_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_eva_performance_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + vw_eva_performance_plan_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#vw_eva_performance_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_eva_performance_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + vw_eva_performance_plan_API, data, successFunc2, AlertDanger); + } +} + +function vw_eva_performance_plan_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#vw_eva_performance_planModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + vw_eva_performance_plan_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + vw_eva_performance_plan_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var vw_eva_performance_planTableV; + +var vw_eva_performance_plan_setupTable = function (result) { + tmp = '"'; + vw_eva_performance_planTableV = $('#vw_eva_performance_planTable').DataTable({ + "processing": true, + "serverSide": false, + "data": result, + //"select": { + // "style": 'multi' + //}, + "columns": [ + //{ "data": "" }, + { "data": "id" }, + { "data": "fiscal_year" }, + { "data": "theTime" }, + ], + "columnDefs": [ + { + "targets": 0, //1, + "data": "id", + "render": function (data, type, row, meta) { + return " "; + } + }, + //{ + // targets: 0, + // data: "", + // defaultContent: '', + // orderable: false, + // className: 'select-checkbox' + //} + ], + "language": { + "url": appsite + "/DataTables-1.10.16/thai.json" + }, + "paging": true, + "searching": false + }); + endLoad(); +}; + +function vw_eva_performance_plan_InitiateDataTable() { + startLoad(); + var p = $.param(vw_eva_performance_plan_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/vw_eva_performance_plan/GetListBySearch?" + p, vw_eva_performance_plan_setupTable, AlertDanger); +} + +function vw_eva_performance_plan_DoSearch() { + var p = $.param(vw_eva_performance_plan_GetSearchParameter()); + var vw_eva_performance_plan_reload = function (result) { + vw_eva_performance_planTableV.destroy(); + vw_eva_performance_plan_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/vw_eva_performance_plan/GetListBySearch?" + p, vw_eva_performance_plan_reload, AlertDanger); +} + +function vw_eva_performance_plan_GetSelect(f) { + var vw_eva_performance_plan_selectitem = []; + $.each(vw_eva_performance_planTableV.rows('.selected').data(), function (key, value) { + vw_eva_performance_plan_selectitem.push(value[f]); + }); + alert(vw_eva_performance_plan_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + +