From 91c6ecd5a1078a648ce9b865d2c9246b60281df7 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Tue, 2 Feb 2021 15:59:55 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=99=E0=B8=B3=E0=B9=80=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=88=E0=B8=AD?= =?UTF-8?q?=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=20=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=20=E0=B8=A5=E0=B8=9A=20?= =?UTF-8?q?=E0=B9=81=E0=B8=9A=E0=B8=9A=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=95?= =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...aluation_operating_agreementControllers.cs | 403 ++++++++++ EF/DataContext.cs | 2 + EXCEL/eva_evaluation_operating_agreement.xlsx | Bin 0 -> 10387 bytes ...02082506_AddOperatingAgreement.Designer.cs | 754 ++++++++++++++++++ .../25640202082506_AddOperatingAgreement.cs | 47 ++ Migrations/DataContextModelSnapshot.cs | 37 + ...a_evaluation_operating_agreementService.cs | 32 + ...va_evaluation_operating_agreementEntity.cs | 46 ++ ...valuation_operating_agreementInputModel.cs | 32 + ...n_operating_agreementReportRequestModel.cs | 21 + ...aluation_operating_agreementSearchModel.cs | 23 + ...a_evaluation_operating_agreementService.cs | 287 +++++++ ...evaluation_operating_agreementViewModel.cs | 30 + ...erating_agreementWithSelectionViewModel.cs | 12 + Startup.cs | 8 + ...reate_evaluation_detail_agreement_d.cshtml | 94 ++- .../eva_evaluation_operating_agreement.cshtml | 124 +++ tb320eva.csproj | 8 +- tb320eva.xml | 118 +++ .../eva_evaluation_operating_agreement.js | 227 ++++++ 20 files changed, 2298 insertions(+), 7 deletions(-) create mode 100644 ApiControllers/eva_evaluation_operating_agreementControllers.cs create mode 100644 EXCEL/eva_evaluation_operating_agreement.xlsx create mode 100644 Migrations/25640202082506_AddOperatingAgreement.Designer.cs create mode 100644 Migrations/25640202082506_AddOperatingAgreement.cs create mode 100644 Models/eva_evaluation_operating_agreement/Ieva_evaluation_operating_agreementService.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementEntity.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementInputModel.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementReportRequestModel.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementSearchModel.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementService.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementViewModel.cs create mode 100644 Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementWithSelectionViewModel.cs create mode 100644 Views/eva_evaluation_operating_agreementView/eva_evaluation_operating_agreement.cshtml create mode 100644 wwwroot/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js diff --git a/ApiControllers/eva_evaluation_operating_agreementControllers.cs b/ApiControllers/eva_evaluation_operating_agreementControllers.cs new file mode 100644 index 0000000..d6025d1 --- /dev/null +++ b/ApiControllers/eva_evaluation_operating_agreementControllers.cs @@ -0,0 +1,403 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; +using TTSW.Controllers; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.Data; +using Microsoft.Extensions.Configuration; +using System.IO; +using System.Net; + +namespace TodoAPI2.Controllers +{ + //[Authorize] + [Produces("application/json")] + [Route("api/eva_evaluation_operating_agreement")] + public class eva_evaluation_operating_agreementController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_evaluation_operating_agreementService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_evaluation_operating_agreementController(ILogger logger, Ieva_evaluation_operating_agreementService 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_evaluation_operating_agreementWithSelectionViewModel), 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_evaluation_operating_agreementWithSelectionViewModel), 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_evaluation_operating_agreementSearchModel 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}"); + } + } + + /// + /// Download Report + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("eva_evaluation_operating_agreement_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult eva_evaluation_operating_agreement_report(eva_evaluation_operating_agreementReportRequestModel model) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var httpclient = new WebClient(); + string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL"); + string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite"); + string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username"); + string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password"); + + string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; + + if (model.filetype == "xlsx") + { + url += "&ignorePagination=true"; + } + + var data = httpclient.DownloadData(url); + var stream = new MemoryStream(data); + + return File(stream, model.contentType); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while GetReport.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// 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_evaluation_operating_agreementInputModel 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_evaluation_operating_agreementInputModel 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, true); + var message = new CommonResponseMessage(); + message.code = "200"; + message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ"; + message.data = null; + return Ok(message); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while UpdateMultiple.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + return BadRequest(ModelState); + } + + /// + /// Refresh AutoField of all items + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("RefreshAutoField")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult RefreshAutoField() + { + if (ModelState.IsValid) + { + try + { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + _repository.RefreshAutoFieldOfAllData(); + var message = new CommonResponseMessage(); + message.code = "200"; + message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย"; + message.data = null; + return Ok(message); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while RefreshAutoField.", ex); + return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}"); + } + } + + return BadRequest(ModelState); + } + + + + } +} diff --git a/EF/DataContext.cs b/EF/DataContext.cs index f15795c..e72701c 100644 --- a/EF/DataContext.cs +++ b/EF/DataContext.cs @@ -37,6 +37,8 @@ namespace TTSW.EF { public DbSet eva_adjust_postponement_detail { get; set; } //public DbSet eva_adjust_postponement_detail_normal { get; set; } + public DbSet eva_evaluation_operating_agreement { get; set; } + public DbSet eva_idp_plan { get; set; } protected override void OnModelCreating (ModelBuilder modelBuilder) { diff --git a/EXCEL/eva_evaluation_operating_agreement.xlsx b/EXCEL/eva_evaluation_operating_agreement.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..28b54d63fbaa1da81dbcdc5e3c46fa5f3e2565b1 GIT binary patch literal 10387 zcmeHN1y>x|wr;!$F2SKgaDoNb5InfMOA~0^Awhz>hCpx&?(XjH4uK$nAi>>U&&<6q zGt9jA2kxz2t83M&+F#YF+TY%1@9!u`!@=VM5CK2{06-29;_?}_h5-QJ5dZ)j01#GN z#KzhYZ0)G8;${nW&}DM9vV4{a4@;X4fQ4TF-|av64HT*LTX(QvHmmOlingc)X9N}$ z07)81v?;fdKD)+fP}Xb`(%yQ|m@2B41KX(-El0JfPxuLn7pOIbU$0v-U2Doy8ldEc z7uz2R+`UN?^Z8Pw7G4<@%8^chc5r|=S&bx9w_wBsdH(R63Xh}e3ENitvD^>g!XQBr zs%HA{1+Z6hy8`_kny}JzP6S5WuD(i)L{eYXo0=3^+0-aYlN?A@nPM-(>2S*x>Z`6n zk~;$vxaqp(W`w*Vpx5R_FnLz2AXK&hWX$rHxW~`len4cVSZ)}oV|~)O;OcI$D?!kZ zvR+c-q<_ojGaePDnl3+G;ZhITh(tL_a5&jx@5?R@W*pE0@5x;t-@6ik-Op?ozMSBD zk8VFpeHnG+*6as#2*5O727GPU$2ui(D2CleJ~~z7!au~niA9f?;^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H@)gH!easB7s5QWW$>@t|9^7EW5CCHz%Rf>^xpv=s{@Y#9(OH%0XXCR zF{c0RVLUc{TowH?RU~>mm|r#0W0b$nRDNLq0B}$@{M)?cvH9aP^9#VA{P%}=lw|%f p={yGgYoz`K2>`@D|I;)5D{d=DBS3u+06>NQsG)AGPW9W-{{Vm=_ILmQ literal 0 HcmV?d00001 diff --git a/Migrations/25640202082506_AddOperatingAgreement.Designer.cs b/Migrations/25640202082506_AddOperatingAgreement.Designer.cs new file mode 100644 index 0000000..d528111 --- /dev/null +++ b/Migrations/25640202082506_AddOperatingAgreement.Designer.cs @@ -0,0 +1,754 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using TTSW.EF; + +namespace tb320eva.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("25640202082506_AddOperatingAgreement")] + partial class AddOperatingAgreement + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_id"); + + b.ToTable("eva_adjust_postponement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b => + { + b.Property("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("adjust_postponement_id"); + + b.HasIndex("adjust_postponement_quota_id"); + + b.ToTable("eva_adjust_postponement_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("evaluation_group_id"); + + b.HasIndex("performance_plan_id"); + + b.ToTable("eva_create_evaluation"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b => + { + b.Property("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_behavior"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("evaluation_group_id"); + + b.ToTable("eva_evaluation_group_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_operating_agreement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("performance_plan_id"); + + b.ToTable("eva_performance_plan_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_salary_cylinder"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation") + .WithMany() + .HasForeignKey("create_evaluation_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement") + .WithMany() + .HasForeignKey("adjust_postponement_id"); + + b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota") + .WithMany() + .HasForeignKey("adjust_postponement_quota_id") + .HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group") + .WithMany() + .HasForeignKey("evaluation_group_id"); + + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan") + .WithMany() + .HasForeignKey("performance_plan_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group") + .WithMany() + .HasForeignKey("evaluation_group_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan") + .WithMany() + .HasForeignKey("performance_plan_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score") + .WithMany() + .HasForeignKey("level_score_id"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/25640202082506_AddOperatingAgreement.cs b/Migrations/25640202082506_AddOperatingAgreement.cs new file mode 100644 index 0000000..5eaf567 --- /dev/null +++ b/Migrations/25640202082506_AddOperatingAgreement.cs @@ -0,0 +1,47 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddOperatingAgreement : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "eva_evaluation_operating_agreement", + columns: table => new + { + id = table.Column(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + create_evaluation_detail_id = table.Column(nullable: true), + mission_no = table.Column(nullable: true), + mission_detail = table.Column(maxLength: 4000, nullable: true), + target = table.Column(maxLength: 4000, nullable: true), + indicators = table.Column(maxLength: 4000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_eva_evaluation_operating_agreement", x => x.id); + table.ForeignKey( + name: "FK_eva_evaluation_operating_agreement_eva_create_evaluation_de~", + column: x => x.create_evaluation_detail_id, + principalTable: "eva_create_evaluation_detail", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_eva_evaluation_operating_agreement_create_evaluation_detail~", + table: "eva_evaluation_operating_agreement", + column: "create_evaluation_detail_id"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "eva_evaluation_operating_agreement"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 9c0013a..1a2052b 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -476,6 +476,36 @@ namespace tb320eva.Migrations b.ToTable("eva_evaluation_group_detail"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_operating_agreement"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b => { b.Property("id"); @@ -696,6 +726,13 @@ namespace tb320eva.Migrations .HasForeignKey("evaluation_group_id"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => { b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan") diff --git a/Models/eva_evaluation_operating_agreement/Ieva_evaluation_operating_agreementService.cs b/Models/eva_evaluation_operating_agreement/Ieva_evaluation_operating_agreementService.cs new file mode 100644 index 0000000..bf718e1 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/Ieva_evaluation_operating_agreementService.cs @@ -0,0 +1,32 @@ +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_evaluation_operating_agreementService : IBaseService + { + new eva_evaluation_operating_agreementViewModel Insert(eva_evaluation_operating_agreementInputModel model); + new eva_evaluation_operating_agreementViewModel Update(int id, eva_evaluation_operating_agreementInputModel model); + List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id); + List GetListBySearch(eva_evaluation_operating_agreementSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + eva_evaluation_operating_agreementWithSelectionViewModel GetWithSelection(int id); + eva_evaluation_operating_agreementWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_evaluation_operating_agreementEntity GetEntity(int id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementEntity.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementEntity.cs new file mode 100644 index 0000000..5fbbff1 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementEntity.cs @@ -0,0 +1,46 @@ +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; +using System.IO; + +namespace TodoAPI2.Models +{ + public class eva_evaluation_operating_agreementEntity : BaseEntity2 + { + + + [ForeignKey("create_evaluation_detail_id")] + public eva_create_evaluation_detailEntity eva_create_evaluation_detail_create_evaluation_detail_id { get; set; } + public int? create_evaluation_detail_id { get; set; } + + public int? mission_no { get; set; } + + [MaxLength(4000)] + public string mission_detail { get; set; } + + [MaxLength(4000)] + public string target { get; set; } + + [MaxLength(4000)] + public string indicators { get; set; } + + + public void SetAutoField(DataContext context) + { + + } + + public void DoAfterInsertUpdate(DataContext context) + { + + } + + } +} diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementInputModel.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementInputModel.cs new file mode 100644 index 0000000..de5c958 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementInputModel.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_evaluation_operating_agreementInputModel + { + + public int? id { get; set; } + + public int? create_evaluation_detail_id { get; set; } + + public int? mission_no { get; set; } + + public string mission_detail { get; set; } + + public string target { get; set; } + + public string indicators { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementReportRequestModel.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementReportRequestModel.cs new file mode 100644 index 0000000..64519d2 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementReportRequestModel.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_evaluation_operating_agreementReportRequestModel : eva_evaluation_operating_agreementSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementSearchModel.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementSearchModel.cs new file mode 100644 index 0000000..6a5c222 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementSearchModel.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_evaluation_operating_agreementSearchModel + { + + public int id { get; set; } + + public int? create_evaluation_detail_id { get; set; } + + } +} + diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementService.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementService.cs new file mode 100644 index 0000000..cc4e8f8 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementService.cs @@ -0,0 +1,287 @@ +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_evaluation_operating_agreementService : Ieva_evaluation_operating_agreementService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public eva_evaluation_operating_agreementService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + #region Private Functions + private eva_evaluation_operating_agreementEntity GetEntity(eva_evaluation_operating_agreementInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_evaluation_operating_agreementViewModel GetDto(eva_evaluation_operating_agreementEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_evaluation_operating_agreementViewModel Get(int id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_evaluation_operating_agreementEntity GetEntity(int id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_evaluation_operating_agreementWithSelectionViewModel GetWithSelection(int id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + + + return i; + } + public eva_evaluation_operating_agreementWithSelectionViewModel GetBlankItem() + { + var i = new eva_evaluation_operating_agreementWithSelectionViewModel(); + + + return i; + } + + public List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id) + { + var model = new eva_evaluation_operating_agreementSearchModel(); + model.create_evaluation_detail_id = create_evaluation_detail_id; + return GetListBySearch(model); + } + + public List GetListBySearch(eva_evaluation_operating_agreementSearchModel model) + { + var data = ( + from m_eva_evaluation_operating_agreement in _repository.Context.eva_evaluation_operating_agreement + + join fk_eva_create_evaluation_detail1 in _repository.Context.eva_create_evaluation_detail on m_eva_evaluation_operating_agreement.create_evaluation_detail_id equals fk_eva_create_evaluation_detail1.id + into eva_create_evaluation_detailResult1 + from fk_eva_create_evaluation_detailResult1 in eva_create_evaluation_detailResult1.DefaultIfEmpty() + + + where + (model.create_evaluation_detail_id.HasValue && m_eva_evaluation_operating_agreement.create_evaluation_detail_id == model.create_evaluation_detail_id) + + + orderby m_eva_evaluation_operating_agreement.created descending + select new eva_evaluation_operating_agreementViewModel() + { + id = m_eva_evaluation_operating_agreement.id, + create_evaluation_detail_id = m_eva_evaluation_operating_agreement.create_evaluation_detail_id, + mission_no = m_eva_evaluation_operating_agreement.mission_no, + mission_detail = m_eva_evaluation_operating_agreement.mission_detail, + target = m_eva_evaluation_operating_agreement.target, + indicators = m_eva_evaluation_operating_agreement.indicators, + + create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id = fk_eva_create_evaluation_detailResult1.create_evaluation_id, + + isActive = m_eva_evaluation_operating_agreement.isActive, + Created = m_eva_evaluation_operating_agreement.created, + Updated = m_eva_evaluation_operating_agreement.updated + } + ).Take(1000).ToList(); + + return data; + } + + #endregion + + #region Manipulation Functions + + + public int GetNewPrimaryKey() + { + int? newkey = 0; + + var x = (from i in _repository.Context.eva_evaluation_operating_agreement + orderby i.id descending + select i).Take(1).ToList(); + + if(x.Count > 0) + { + newkey = x[0].id + 1; + } + + return newkey.Value; + } + + + public eva_evaluation_operating_agreementViewModel Insert(eva_evaluation_operating_agreementInputModel model) + { + var entity = GetEntity(model); + entity.id = GetNewPrimaryKey(); + + + entity.SetAutoField(_repository.Context); + + var inserted = _repository.Insert(entity); + entity.DoAfterInsertUpdate(_repository.Context); + return Get(inserted.id); + } + + public eva_evaluation_operating_agreementViewModel Update(int id, eva_evaluation_operating_agreementInputModel model) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.create_evaluation_detail_id = model.create_evaluation_detail_id; + existingEntity.mission_no = model.mission_no; + existingEntity.mission_detail = model.mission_detail; + existingEntity.target = model.target; + existingEntity.indicators = model.indicators; + + existingEntity.SetAutoField(_repository.Context); + + var updated = _repository.Update(id, existingEntity); + existingEntity.DoAfterInsertUpdate(_repository.Context); + return Get(updated.id); + } + else + throw new NotificationException("No data to update"); + } + + public string UpdateMultiple(List model, bool is_force_save) + { + 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.mission_no = i.mission_no; + existingEntity.mission_detail = i.mission_detail; + existingEntity.target = i.target; + existingEntity.indicators = i.indicators; + + existingEntity.SetAutoField(_repository.Context); + _repository.UpdateWithoutCommit(i.id.Value, existingEntity); + } + } + else if (i.active_mode == "1" && !i.id.HasValue) // add + { + 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 + } + } + if (is_force_save) + { + _repository.Context.SaveChanges(); + } + + return model.Count().ToString(); + } + + public eva_evaluation_operating_agreementViewModel SetAsActive(int id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_evaluation_operating_agreementViewModel SetAsInactive(int id) + { + var updated = _repository.SetAsInActive(id); + + return Get(updated.id); + } + public void Delete(int id) + { + _repository.Delete(id); + + return; + } + + public void RefreshAutoFieldOfAllData() + { + var all_items = from i in _repository.Context.eva_evaluation_operating_agreement + select i; + foreach (var item in all_items) + { + item.SetAutoField(_repository.Context); + } + _repository.Context.SaveChanges(); + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("create_evaluation_detail_id", "อ้างอิงตาราง eva_create_evaluation_detail"); + i.Add("create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id", "อ้างอิงตาราง eva_create_evaluation_detail"); + i.Add("mission_no", "ภารกิจที่"); + i.Add("mission_detail", "รายละเอียดภารกิจ"); + i.Add("target", "เป้าหมาย"); + i.Add("indicators", "ตัวชี้วัด"); + + return i; + } + + + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementViewModel.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementViewModel.cs new file mode 100644 index 0000000..4b99a6b --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementViewModel.cs @@ -0,0 +1,30 @@ +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_evaluation_operating_agreementViewModel : BaseViewModel2 + { + + public int? create_evaluation_detail_id { get; set; } + + public int? mission_no { get; set; } + + public string mission_detail { get; set; } + + public string target { get; set; } + + public string indicators { get; set; } + + public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementWithSelectionViewModel.cs b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementWithSelectionViewModel.cs new file mode 100644 index 0000000..0a6e0c5 --- /dev/null +++ b/Models/eva_evaluation_operating_agreement/eva_evaluation_operating_agreementWithSelectionViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class eva_evaluation_operating_agreementWithSelectionViewModel: eva_evaluation_operating_agreementViewModel + { + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index bb7184a..3256f87 100644 --- a/Startup.cs +++ b/Startup.cs @@ -305,6 +305,9 @@ namespace Test01 services.AddScoped(); + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -551,6 +554,11 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); + + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion 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 a05852a..8105070 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 @@ -233,6 +233,60 @@ + + +
การประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา
@@ -291,6 +345,38 @@
+
+
ข้อตกลงการปฏิบัติงาน
+
+
+ + + +
+ + +
+ +
+
+ + + + + + + + + + + + + +
เครื่องมือ
+
+ +
+
ผลสัมฤทธิ์ของงาน (น้ำหนัก %)
@@ -398,7 +484,7 @@
- + @@ -414,6 +500,7 @@ + + +} + diff --git a/tb320eva.csproj b/tb320eva.csproj index 68c6c13..8fd25de 100644 --- a/tb320eva.csproj +++ b/tb320eva.csproj @@ -68,15 +68,11 @@ - - - - - - + + diff --git a/tb320eva.xml b/tb320eva.xml index 3e682bc..0b2be61 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -2659,6 +2659,124 @@ If the model is invalid 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 create_evaluation_detail_id + + + + 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 + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Refresh AutoField of all items + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + Default constructure for dependency injection diff --git a/wwwroot/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js b/wwwroot/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js new file mode 100644 index 0000000..bb48525 --- /dev/null +++ b/wwwroot/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js @@ -0,0 +1,227 @@ +var eva_evaluation_operating_agreement_editMode = "CREATE"; +var eva_evaluation_operating_agreement_API = "/api/eva_evaluation_operating_agreement/"; + +//================= Search Customizaiton ========================================= + +function eva_evaluation_operating_agreement_GetSearchParameter() { + var eva_evaluation_operating_agreementSearchObject = new Object(); + eva_evaluation_operating_agreementSearchObject.create_evaluation_detail_id = getUrlParameter("id"); + + return eva_evaluation_operating_agreementSearchObject; +} + +function eva_evaluation_operating_agreement_FeedDataToSearchForm(data) { + $("#s_eva_evaluation_operating_agreement_create_evaluation_detail_id").val(data.create_evaluation_detail_id); + +} + +//================= Form Data Customizaiton ========================================= + +function eva_evaluation_operating_agreement_FeedDataToForm(data) { + $("#eva_evaluation_operating_agreement_id").val(data.id); + $("#eva_evaluation_operating_agreement_create_evaluation_detail_id").val(data.create_evaluation_detail_id); + $("#eva_evaluation_operating_agreement_mission_no").val(data.mission_no); + $("#eva_evaluation_operating_agreement_mission_detail").val(data.mission_detail); + $("#eva_evaluation_operating_agreement_target").val(data.target); + $("#eva_evaluation_operating_agreement_indicators").val(data.indicators); + +} + +function eva_evaluation_operating_agreement_GetFromForm() { + var eva_evaluation_operating_agreementObject = new Object(); + eva_evaluation_operating_agreementObject.id = $("#eva_evaluation_operating_agreement_id").val(); + eva_evaluation_operating_agreementObject.create_evaluation_detail_id = getUrlParameter("id"); + eva_evaluation_operating_agreementObject.mission_no = $("#eva_evaluation_operating_agreement_mission_no").val(); + eva_evaluation_operating_agreementObject.mission_detail = $("#eva_evaluation_operating_agreement_mission_detail").val(); + eva_evaluation_operating_agreementObject.target = $("#eva_evaluation_operating_agreement_target").val(); + eva_evaluation_operating_agreementObject.indicators = $("#eva_evaluation_operating_agreement_indicators").val(); + + + return eva_evaluation_operating_agreementObject; +} + +function eva_evaluation_operating_agreement_InitialForm(s) { + var successFunc = function (result) { + eva_evaluation_operating_agreement_FeedDataToForm(result); + eva_evaluation_operating_agreement_FeedDataToSearchForm(result); + if (s) { + // Incase model popup + $("#eva_evaluation_operating_agreementModel").modal("show"); + } + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_evaluation_operating_agreement_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Form Mode Setup and Flow ========================================= + +function eva_evaluation_operating_agreement_GoCreate() { + // Incase model popup + eva_evaluation_operating_agreement_SetCreateForm(true); + + // Incase open new page + //window_open(appsite + "/eva_evaluation_operating_agreementView/eva_evaluation_operating_agreement_d"); +} + +function eva_evaluation_operating_agreement_GoEdit(a) { + // Incase model popup + eva_evaluation_operating_agreement_SetEditForm(a); + + // Incase open new page + //window_open(appsite + "/eva_evaluation_operating_agreementView/eva_evaluation_operating_agreement_d?id=" + a); +} + +function eva_evaluation_operating_agreement_SetEditForm(a) { + var successFunc = function (result) { + eva_evaluation_operating_agreement_editMode = "UPDATE"; + eva_evaluation_operating_agreement_FeedDataToForm(result); + $("#eva_evaluation_operating_agreementModel").modal("show"); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + eva_evaluation_operating_agreement_API + a, successFunc, AlertDanger); +} + +function eva_evaluation_operating_agreement_SetCreateForm(s) { + eva_evaluation_operating_agreement_editMode = "CREATE"; + eva_evaluation_operating_agreement_InitialForm(s); +} + +function eva_evaluation_operating_agreement_RefreshTable() { + // Incase model popup + eva_evaluation_operating_agreement_DoSearch(); + + // Incase open new page + //window.parent.eva_evaluation_operating_agreement_DoSearch(); +} + +//================= Update and Delete ========================================= + +var eva_evaluation_operating_agreement_customValidation = function (group) { + return ""; +}; + +function eva_evaluation_operating_agreement_PutUpdate() { + if (!ValidateForm('eva_evaluation_operating_agreement', eva_evaluation_operating_agreement_customValidation)) { + return; + } + + var data = eva_evaluation_operating_agreement_GetFromForm(); + + //Update Mode + if (eva_evaluation_operating_agreement_editMode === "UPDATE") { + var successFunc1 = function (result) { + $("#eva_evaluation_operating_agreementModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_evaluation_operating_agreement_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPutRequest(apisite + eva_evaluation_operating_agreement_API + data.id, data, successFunc1, AlertDanger); + } + // Create mode + else { + var successFunc2 = function (result) { + $("#eva_evaluation_operating_agreementModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_evaluation_operating_agreement_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxPostRequest(apisite + eva_evaluation_operating_agreement_API, data, successFunc2, AlertDanger); + } +} + +function eva_evaluation_operating_agreement_GoDelete(a) { + if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { + var successFunc = function (result) { + $("#eva_evaluation_operating_agreementModel").modal("hide"); + AlertSuccess(result.code + " " + result.message); + eva_evaluation_operating_agreement_RefreshTable(); + endLoad(); + }; + startLoad(); + AjaxDeleteRequest(apisite + eva_evaluation_operating_agreement_API + a, null, successFunc, AlertDanger); + } +} + +//================= Data Table ========================================= + +var eva_evaluation_operating_agreementTableV; + +var eva_evaluation_operating_agreement_setupTable = function (result) { + tmp = '"'; + eva_evaluation_operating_agreementTableV = $('#eva_evaluation_operating_agreementTable').DataTable({ + "processing": true, + "serverSide": false, + "data": result, + //"select": { + // "style": 'multi' + //}, + "columns": [ + //{ "data": "" }, + { "data": "id" }, + { "data": "mission_no" }, + { "data": "mission_detail" }, + { "data": "target" }, + { "data": "indicators" }, + ], + "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 eva_evaluation_operating_agreement_InitiateDataTable() { + startLoad(); + var p = $.param(eva_evaluation_operating_agreement_GetSearchParameter()); + AjaxGetRequest(apisite + "/api/eva_evaluation_operating_agreement/GetListBySearch?" + p, eva_evaluation_operating_agreement_setupTable, AlertDanger); +} + +function eva_evaluation_operating_agreement_DoSearch() { + var p = $.param(eva_evaluation_operating_agreement_GetSearchParameter()); + var eva_evaluation_operating_agreement_reload = function (result) { + eva_evaluation_operating_agreementTableV.destroy(); + eva_evaluation_operating_agreement_setupTable(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + "/api/eva_evaluation_operating_agreement/GetListBySearch?" + p, eva_evaluation_operating_agreement_reload, AlertDanger); +} + +function eva_evaluation_operating_agreement_GetSelect(f) { + var eva_evaluation_operating_agreement_selectitem = []; + $.each(eva_evaluation_operating_agreementTableV.rows('.selected').data(), function (key, value) { + eva_evaluation_operating_agreement_selectitem.push(value[f]); + }); + alert(eva_evaluation_operating_agreement_selectitem); +} + +//================= File Upload ========================================= + + + +//================= Multi-Selection Function ========================================= + + +