From 08b0cbf291fb964d62363050a5a33986f5a33de6 Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Sun, 11 Apr 2021 19:40:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B8=E0=B8=87=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=81?= =?UTF-8?q?=E0=B8=99=E0=B8=9A=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C=20?= =?UTF-8?q?=E0=B8=9C=E0=B8=A5=E0=B8=AA=E0=B8=B1=E0=B8=A1=E0=B8=A4=E0=B8=97?= =?UTF-8?q?=E0=B8=98=E0=B8=B4=E0=B9=8C=E0=B8=82=E0=B8=AD=E0=B8=87=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99=20=E0=B9=84=E0=B8=94=E0=B9=89=E0=B8=AB?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2=E0=B8=A2=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...valuation_achievement_attachControllers.cs | 403 +++++++ EF/DataContext.cs | 2 + EXCEL/eva_evaluation_achievement_attach.xlsx | Bin 0 -> 10576 bytes .../20210411122053_AddAttach.Designer.cs | 999 ++++++++++++++++++ Migrations/20210411122053_AddAttach.cs | 44 + Migrations/DataContextModelSnapshot.cs | 29 + ...va_evaluation_achievement_attachService.cs | 32 + ...eva_evaluation_achievement_attachEntity.cs | 48 + ...evaluation_achievement_attachInputModel.cs | 26 + ...on_achievement_attachReportRequestModel.cs | 21 + ...valuation_achievement_attachSearchModel.cs | 23 + ...va_evaluation_achievement_attachService.cs | 332 ++++++ ..._evaluation_achievement_attachViewModel.cs | 34 + ...chievement_attachWithSelectionViewModel.cs | 12 + Startup.cs | 7 + ...ation_achievement_attachViewControllers.cs | 66 ++ ...reate_evaluation_detail_agreement_d.cshtml | 30 +- .../eva_evaluation_achievement_attach.cshtml | 102 ++ tb320eva.csproj | 7 +- tb320eva.xml | 126 +++ .../eva_evaluation_achievement.js | 19 +- .../eva_evaluation_achievement_attach.js | 227 ++++ 22 files changed, 2562 insertions(+), 27 deletions(-) create mode 100644 ApiControllers/eva_evaluation_achievement_attachControllers.cs create mode 100644 EXCEL/eva_evaluation_achievement_attach.xlsx create mode 100644 Migrations/20210411122053_AddAttach.Designer.cs create mode 100644 Migrations/20210411122053_AddAttach.cs create mode 100644 Models/eva_evaluation_achievement_attach/Ieva_evaluation_achievement_attachService.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachEntity.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachInputModel.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachReportRequestModel.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachSearchModel.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachService.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachViewModel.cs create mode 100644 Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachWithSelectionViewModel.cs create mode 100644 ViewControllers/eva_evaluation_achievement_attachViewControllers.cs create mode 100644 Views/eva_evaluation_achievement_attachView/eva_evaluation_achievement_attach.cshtml create mode 100644 wwwroot/js/eva_evaluation_achievement_attach/eva_evaluation_achievement_attach.js diff --git a/ApiControllers/eva_evaluation_achievement_attachControllers.cs b/ApiControllers/eva_evaluation_achievement_attachControllers.cs new file mode 100644 index 0000000..b3be847 --- /dev/null +++ b/ApiControllers/eva_evaluation_achievement_attachControllers.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_achievement_attach")] + public class eva_evaluation_achievement_attachController : BaseController + { + #region Private Variables + private ILogger _logger; + private Ieva_evaluation_achievement_attachService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_evaluation_achievement_attachController(ILogger logger, Ieva_evaluation_achievement_attachService 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_achievement_attachWithSelectionViewModel), 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_achievement_attachWithSelectionViewModel), 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 achievement_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? achievement_id) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + return Ok(_repository.GetListByachievement_id(achievement_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_achievement_attachSearchModel 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_achievement_attach_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult eva_evaluation_achievement_attach_report(eva_evaluation_achievement_attachReportRequestModel 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_achievement_attachInputModel model) + { + if (ModelState.IsValid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.Insert(model, true); + 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_achievement_attachInputModel model) + { + if (ModelState.IsValid) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.Update(id, model, true); + 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 231ef81..2a374d9 100644 --- a/EF/DataContext.cs +++ b/EF/DataContext.cs @@ -43,6 +43,8 @@ namespace TTSW.EF { public DbSet eva_limit_frame_plan { get; set; } public DbSet eva_idp_plan { get; set; } + + public DbSet eva_evaluation_achievement_attach { get; set; } protected override void OnModelCreating (ModelBuilder modelBuilder) { base.OnModelCreating (modelBuilder); diff --git a/EXCEL/eva_evaluation_achievement_attach.xlsx b/EXCEL/eva_evaluation_achievement_attach.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..eb0c35bb36bb0790c4c7d3bb0958c0f31c376ef2 GIT binary patch literal 10576 zcmeHtg;O2d^7X+XxVt;S2~M!!9z3`mf*jllPH^`iAwYlx0t9z=cY-?v=in~i$-Vb| zd6##8f5Ce*RWmg;)2nLs?$zCU^;VIGfyDv90}ufK03|?-H(};KZw$6s?9`-;deO7lH5Je6wG(#2u8uI=Bj{o8jC{pjUZD+@5(%Kb~Xx0qN4k;`| zB&jFSrP)UK;2y6{Q@u&ZaOX{L{#v69v5odMXhfIpREVH>j_!@P=sJk?=8ZCq5%QO) zV#ni`_cEU(19FQrqbgz}xU&dQ!C?4_Dg=evITKbZsz)kXJnqV8Tw84?N;~4;LPcKD zHZlDygub5Hd)e3i23nrcg}{W*Jy4Z}NN!21vGFx0mnO~kbSF{`*2K#wMw~L0y2=}J z+1>teoGkq^3qpZcU6sQqBpNNjHO=(xUY1H^x#ea^g6d=&OOEV zAK9k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02zXKr3l& z*~6UNJhY^U|3CwF`jj}mbKl_^R)~}un>d=N_nmR*ONE!~{ZjSIcgu8p$h$Llz9yae zd5P7XvqG7e$FN`P7q(imZy=QWPxmvHMZyS!xF04Y*a6SuYRkTZ<<|B6Iv9vKOIv&HaY9L8@2Jy{YFA| zkwn1oEOx9*C2TVX2M(6l8vi26eP&VL2Ny0Lsp^d3)O0i|fFCb6+1_$vA4O9j6P=0Ui-R`io z%kaBogQb;G4un;^mQ#UwACR4W-EFjTu52*iGvv4N{eF z=--hxn6<|RshxKOz4el5aJNP@nD!7>pZ{U@^%_oTPZ)Lbr5)!jrP*RyX~@mgX$!m1 z!}?jr`HAOiAJ%LAw_LQ#59JTY|8id_XckCa^v}D({xx0yy8pu-F%|j01N?oz%D)VM z-M>IM@o&3Vo*F*w;r})rgi!5CNB^nu-&>x)O#y&8NaFmz8=y~dp7z0hBcVb%WB*rI z>?z7qP5d{CG{zq&PZjc~08dx$zX8_p{{Z;Cj(=+UwA}q|x=r$@>C@u(DZNi3= z+0!xj$0F+~;L|GQH()3EAAnD4lz*&Qo`U{8(f@`70De#a0RNHppPK(YQ2)ER2Behy b|K@*%Z54Sqhz|k)D3Fs5;>I|1zn=ad#64_s literal 0 HcmV?d00001 diff --git a/Migrations/20210411122053_AddAttach.Designer.cs b/Migrations/20210411122053_AddAttach.Designer.cs new file mode 100644 index 0000000..64fa97e --- /dev/null +++ b/Migrations/20210411122053_AddAttach.Designer.cs @@ -0,0 +1,999 @@ +// +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("20210411122053_AddAttach")] + partial class AddAttach + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") + .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("achievement_final"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("competency_final"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("employee_no_at_this_time") + .HasMaxLength(1000); + + b.Property("fullname_at_this_time") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("is_for_postponement"); + + b.Property("level_score_final") + .HasMaxLength(255); + + 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("score_final"); + + 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("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + 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("eva_employee_id"); + + b.Property("help_org_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("order_of_data"); + + 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_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + 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_id"); + + 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_id"); + + 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.Property("work_period"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(8000); + + 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_achievement_attachEntity", b => + { + b.Property("id"); + + b.Property("achievement_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("the_file") + .HasMaxLength(1000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("achievement_id"); + + b.ToTable("eva_evaluation_achievement_attach"); + }); + + 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("main_dept_id"); + + b.Property("percentage"); + + 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_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("cost_of_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("help_org_id"); + + b.Property("isActive"); + + b.Property("level_text") + .HasMaxLength(1000); + + b.Property("monthly_remuneration"); + + b.Property("order_of_data"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_text") + .HasMaxLength(1000); + + b.Property("salary"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("frame_group_guid"); + + b.ToTable("eva_limit_frame_employee"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("main_dept_id"); + + b.Property("remark") + .HasMaxLength(4000); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("frame_plan_guid"); + + b.HasIndex("group_guid"); + + b.ToTable("eva_limit_frame_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("limit_frame_005_total"); + + b.Property("limit_frame_005_total_rounded"); + + b.Property("plan_guid"); + + b.Property("salary_adjustment_date"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("total_salary"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("percent"); + + 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_create_evaluation_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation_create_evaluation_id") + .WithMany() + .HasForeignKey("create_evaluation_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_achievement_attachEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement_achievement_id") + .WithMany() + .HasForeignKey("achievement_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_limit_frame_employeeEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid") + .WithMany() + .HasForeignKey("frame_group_guid"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_limit_frame_planEntity", "eva_limit_frame_plan_frame_plan_guid") + .WithMany() + .HasForeignKey("frame_plan_guid"); + + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid") + .WithMany() + .HasForeignKey("group_guid"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan_plan_guid") + .WithMany() + .HasForeignKey("plan_guid"); + }); + + 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/20210411122053_AddAttach.cs b/Migrations/20210411122053_AddAttach.cs new file mode 100644 index 0000000..003c3e4 --- /dev/null +++ b/Migrations/20210411122053_AddAttach.cs @@ -0,0 +1,44 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddAttach : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "eva_evaluation_achievement_attach", + columns: table => new + { + id = table.Column(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + achievement_id = table.Column(nullable: true), + the_file = table.Column(maxLength: 1000, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_eva_evaluation_achievement_attach", x => x.id); + table.ForeignKey( + name: "FK_eva_evaluation_achievement_attach_eva_evaluation_achievemen~", + column: x => x.achievement_id, + principalTable: "eva_evaluation_achievement", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_eva_evaluation_achievement_attach_achievement_id", + table: "eva_evaluation_achievement_attach", + column: "achievement_id"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "eva_evaluation_achievement_attach"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 9d42432..4832bab 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -431,6 +431,28 @@ namespace tb320eva.Migrations b.ToTable("eva_evaluation_achievement"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b => + { + b.Property("id"); + + b.Property("achievement_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("the_file") + .HasMaxLength(1000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("achievement_id"); + + b.ToTable("eva_evaluation_achievement_attach"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => { b.Property("id"); @@ -903,6 +925,13 @@ namespace tb320eva.Migrations .HasForeignKey("create_evaluation_detail_id"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement_achievement_id") + .WithMany() + .HasForeignKey("achievement_id"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => { b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail") diff --git a/Models/eva_evaluation_achievement_attach/Ieva_evaluation_achievement_attachService.cs b/Models/eva_evaluation_achievement_attach/Ieva_evaluation_achievement_attachService.cs new file mode 100644 index 0000000..637dbad --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/Ieva_evaluation_achievement_attachService.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_achievement_attachService : IBaseService2 + { + new eva_evaluation_achievement_attachViewModel Insert(eva_evaluation_achievement_attachInputModel model, bool is_force_save); + new eva_evaluation_achievement_attachViewModel Update(int id, eva_evaluation_achievement_attachInputModel model, bool is_force_save); + List GetListByachievement_id(int? achievement_id); + List GetListBySearch(eva_evaluation_achievement_attachSearchModel model); + + string UpdateMultiple(List model, bool is_force_save); + eva_evaluation_achievement_attachWithSelectionViewModel GetWithSelection(int id); + eva_evaluation_achievement_attachWithSelectionViewModel GetBlankItem(); + + void RefreshAutoFieldOfAllData(); + eva_evaluation_achievement_attachEntity GetEntity(int id); + DataContext GetContext(); + + + + } +} + diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachEntity.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachEntity.cs new file mode 100644 index 0000000..0b5e58b --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachEntity.cs @@ -0,0 +1,48 @@ +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_achievement_attachEntity : BaseEntity2 + { + + + [ForeignKey("achievement_id")] + public eva_evaluation_achievementEntity eva_evaluation_achievement_achievement_id { get; set; } + public int? achievement_id { get; set; } + + [MaxLength(1000)] + public string the_file { get; set; } + + [NotMapped] + public string the_fileDisplay + { + get + { + return (string.IsNullOrEmpty(the_file) ? "" : + FileUtil.GetFileInfo(TTSW.Constant.FilePathConstant.DirType.FilesTestUpload, id, the_file).RelativePath).Replace(@"\", "/"); + } + } + + + public void SetAutoField(DataContext context) + { + + } + + public void DoAfterInsertUpdate(DataContext context) + { + + } + + } +} diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachInputModel.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachInputModel.cs new file mode 100644 index 0000000..92ef2b0 --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachInputModel.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 eva_evaluation_achievement_attachInputModel + { + + public int? id { get; set; } + + public int? achievement_id { get; set; } + + public string the_file { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachReportRequestModel.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachReportRequestModel.cs new file mode 100644 index 0000000..6cdae6f --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachReportRequestModel.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_achievement_attachReportRequestModel : eva_evaluation_achievement_attachSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachSearchModel.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachSearchModel.cs new file mode 100644 index 0000000..312da4c --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachSearchModel.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_achievement_attachSearchModel + { + + public int id { get; set; } + + public int? achievement_id { get; set; } + + } +} + diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachService.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachService.cs new file mode 100644 index 0000000..a249a2d --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachService.cs @@ -0,0 +1,332 @@ +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_achievement_attachService : Ieva_evaluation_achievement_attachService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public eva_evaluation_achievement_attachService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + #region Private Functions + private eva_evaluation_achievement_attachEntity GetEntity(eva_evaluation_achievement_attachInputModel model) + { + return Mapper.Map(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_evaluation_achievement_attachViewModel GetDto(eva_evaluation_achievement_attachEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(entities); + } + + #endregion + + #region Public Functions + #region Query Functions + + public eva_evaluation_achievement_attachViewModel Get(int id) + { + var entity = _repository.Get(id); + + return GetDto(entity); + } + + public eva_evaluation_achievement_attachEntity GetEntity(int id) + { + var entity = _repository.Get(id); + + return entity; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + public eva_evaluation_achievement_attachWithSelectionViewModel GetWithSelection(int id) + { + var entity = _repository.Get(id); + var i = Mapper.Map(entity); + + + return i; + } + public eva_evaluation_achievement_attachWithSelectionViewModel GetBlankItem() + { + var i = new eva_evaluation_achievement_attachWithSelectionViewModel(); + + + return i; + } + + public List GetListByachievement_id(int? achievement_id) + { + var model = new eva_evaluation_achievement_attachSearchModel(); + model.achievement_id = achievement_id; + return GetListBySearch(model); + } + + public List GetListBySearch(eva_evaluation_achievement_attachSearchModel model) + { + var data = ( + from m_eva_evaluation_achievement_attach in _repository.Context.eva_evaluation_achievement_attach + + join fk_eva_evaluation_achievement1 in _repository.Context.eva_evaluation_achievement on m_eva_evaluation_achievement_attach.achievement_id equals fk_eva_evaluation_achievement1.id + into eva_evaluation_achievementResult1 + from fk_eva_evaluation_achievementResult1 in eva_evaluation_achievementResult1.DefaultIfEmpty() + + + where + 1 == 1 + && (!model.achievement_id.HasValue || m_eva_evaluation_achievement_attach.achievement_id == model.achievement_id) + + + orderby m_eva_evaluation_achievement_attach.created descending + select new eva_evaluation_achievement_attachViewModel() + { + id = m_eva_evaluation_achievement_attach.id, + achievement_id = m_eva_evaluation_achievement_attach.achievement_id, + the_file = m_eva_evaluation_achievement_attach.the_file, + the_fileDisplay = m_eva_evaluation_achievement_attach.the_fileDisplay, + + achievement_id_eva_evaluation_achievement_create_evaluation_detail_id = fk_eva_evaluation_achievementResult1.create_evaluation_detail_id, + + isActive = m_eva_evaluation_achievement_attach.isActive, + Created = m_eva_evaluation_achievement_attach.created, + Updated = m_eva_evaluation_achievement_attach.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_achievement_attach + orderby i.id descending + select i).Take(1).ToList(); + + if(x.Count > 0) + { + newkey = x[0].id + 1; + } + + return newkey.Value; + } + + + public eva_evaluation_achievement_attachViewModel Insert(eva_evaluation_achievement_attachInputModel model, bool is_force_save) + { + var entity = GetEntity(model); + entity.id = GetNewPrimaryKey(); + + if (!string.IsNullOrEmpty(model.the_file)) + { + //Move file from temp to physical + string the_fileFileName = FileUtil.MoveTempUploadFileToActualPath( + model.the_file, FilePathConstant.DirType.FilesTestUpload, entity.id); + entity.the_file = the_fileFileName; + } + entity.SetAutoField(_repository.Context); + + if (is_force_save) + { + var inserted = _repository.Insert(entity); + entity.DoAfterInsertUpdate(_repository.Context); + return Get(inserted.id); + } + else + { + _repository.InsertWithoutCommit(entity); + entity.DoAfterInsertUpdate(_repository.Context); + return Mapper.Map(entity); + } + } + + public eva_evaluation_achievement_attachViewModel Update(int id, eva_evaluation_achievement_attachInputModel model, bool is_force_save) + { + var existingEntity = _repository.Get(id); + if (existingEntity != null) + { + existingEntity.achievement_id = model.achievement_id; + if (!string.IsNullOrEmpty(model.the_file)) + { + if (model.the_file.StartsWith("Uploads")) + { + var the_fileFileName = FileUtil.MoveTempUploadFileToActualPath( + model.the_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.the_file); + existingEntity.the_file = the_fileFileName; + } + else + { + existingEntity.the_file = model.the_file; + } + } + else + { + existingEntity.the_file = null; + } + + + existingEntity.SetAutoField(_repository.Context); + + if (is_force_save) + { + var updated = _repository.Update(id, existingEntity); + existingEntity.DoAfterInsertUpdate(_repository.Context); + return Get(updated.id); + } + else + { + _repository.UpdateWithoutCommit(id, existingEntity); + existingEntity.DoAfterInsertUpdate(_repository.Context); + return Mapper.Map(existingEntity); + } + } + 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.achievement_id = i.achievement_id; + if (!string.IsNullOrEmpty(i.the_file)) + { + if (i.the_file.StartsWith("Uploads")) + { + var the_fileFileName = FileUtil.MoveTempUploadFileToActualPath( + i.the_file, FilePathConstant.DirType.FilesTestUpload, existingEntity.id, existingEntity.the_file); + existingEntity.the_file = the_fileFileName; + } + else + { + existingEntity.the_file = i.the_file; + } + } + else + { + existingEntity.the_file = null; + } + + + 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_achievement_attachViewModel SetAsActive(int id) + { + var updated = _repository.SetAsActive(id); + + return Get(updated.id); + } + public eva_evaluation_achievement_attachViewModel 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_achievement_attach + select i; + foreach (var item in all_items) + { + item.SetAutoField(_repository.Context); + } + _repository.Context.SaveChanges(); + } + + private Dictionary GetLookupForLog() + { + var i = new Dictionary(); + + + i.Add("achievement_id", "อ้างอิงตาราง eva_create_evaluation_detail"); + i.Add("achievement_id_eva_evaluation_achievement_create_evaluation_detail_id", "อ้างอิงตาราง eva_create_evaluation_detail"); + + return i; + } + + #endregion + + #region Match Item + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachViewModel.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachViewModel.cs new file mode 100644 index 0000000..8e5731f --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachViewModel.cs @@ -0,0 +1,34 @@ +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_achievement_attachViewModel : BaseViewModel2 + { + + public int? achievement_id { get; set; } + + public string the_file { get; set; } + public string the_fileDisplay { get; set; } + + public string txt_the_file + { + get + { + return (string.IsNullOrEmpty(the_file) ? "" : + $"{the_file}"); + } + } + + public int? achievement_id_eva_evaluation_achievement_create_evaluation_detail_id { get; set; } + + } +} \ No newline at end of file diff --git a/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachWithSelectionViewModel.cs b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachWithSelectionViewModel.cs new file mode 100644 index 0000000..de257c1 --- /dev/null +++ b/Models/eva_evaluation_achievement_attach/eva_evaluation_achievement_attachWithSelectionViewModel.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_achievement_attachWithSelectionViewModel: eva_evaluation_achievement_attachViewModel + { + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 8f8ab37..98a9daa 100644 --- a/Startup.cs +++ b/Startup.cs @@ -327,6 +327,9 @@ namespace Test01 services.AddScoped(); + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -610,6 +613,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/eva_evaluation_achievement_attachViewControllers.cs b/ViewControllers/eva_evaluation_achievement_attachViewControllers.cs new file mode 100644 index 0000000..f9d0e18 --- /dev/null +++ b/ViewControllers/eva_evaluation_achievement_attachViewControllers.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 eva_evaluation_achievement_attachViewController : Controller + { + private ILogger _logger; + private Ieva_evaluation_achievement_attachService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_evaluation_achievement_attachViewController(ILogger logger, Ieva_evaluation_achievement_attachService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + public IActionResult eva_evaluation_achievement_attach() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + // public IActionResult eva_evaluation_achievement_attach_d() + // { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + // } + + //public IActionResult eva_evaluation_achievement_attach_report() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + //public IActionResult eva_evaluation_achievement_attach_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/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 e13346b..8f02eea 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 @@ -118,15 +118,7 @@
- -

- ดูหรือดาวโหลดไฟล์ของคุณ - ลบไฟล์ -

- - นำเข้าไฟล์ใหม่ - - +