From 7d46ee9b2d6851831ceb4a01a464b6a722e7480e Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Wed, 12 Aug 2020 21:39:10 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20Feature=20OP=20=E0=B8=82=E0=B9=89=E0=B8=AD=202990?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0812141704_AddStatusDateColumn.Designer.cs | 637 ++++++++++++++++++ .../25630812141704_AddStatusDateColumn.cs | 59 ++ Migrations/DataContextModelSnapshot.cs | 10 + .../eva_create_evaluation_detailEntity.cs | 12 + ...create_evaluation_detail_processService.cs | 6 + ...eate_evaluation_detail_processViewModel.cs | 28 + ...eate_evaluation_detail_statusInputModel.cs | 2 + ..._create_evaluation_detail_statusService.cs | 47 ++ ...reate_evaluation_detail_statusViewModel.cs | 12 + Utils/MyHelper.cs | 9 + ..._create_evaluation_detail_process_d.cshtml | 2 +- appsettings.Development.json | 8 +- .../eva_create_evaluation_detail_process.js | 10 +- .../eva_create_evaluation_detail_process_d.js | 6 +- .../eva_create_evaluation_detail_status_d.js | 10 +- 15 files changed, 841 insertions(+), 17 deletions(-) create mode 100644 Migrations/25630812141704_AddStatusDateColumn.Designer.cs create mode 100644 Migrations/25630812141704_AddStatusDateColumn.cs diff --git a/Migrations/25630812141704_AddStatusDateColumn.Designer.cs b/Migrations/25630812141704_AddStatusDateColumn.Designer.cs new file mode 100644 index 0000000..738efb7 --- /dev/null +++ b/Migrations/25630812141704_AddStatusDateColumn.Designer.cs @@ -0,0 +1,637 @@ +// +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("25630812141704_AddStatusDateColumn")] + partial class AddStatusDateColumn + { + 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(100); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + 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("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("middle"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + 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_supervisor"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("chief"); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + 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("score_chief"); + + b.Property("score_supervisor"); + + 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_supervisor"); + + 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("sumary"); + + b.Property("sumary2"); + + 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("sumary"); + + b.Property("sumary2"); + + 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_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("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_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/25630812141704_AddStatusDateColumn.cs b/Migrations/25630812141704_AddStatusDateColumn.cs new file mode 100644 index 0000000..b868cd7 --- /dev/null +++ b/Migrations/25630812141704_AddStatusDateColumn.cs @@ -0,0 +1,59 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddStatusDateColumn : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "status_chief_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "status_self_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "status_supervisor1A_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "status_supervisor2A_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "status_supervisor_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "status_chief_click_date", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "status_self_click_date", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "status_supervisor1A_click_date", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "status_supervisor2A_click_date", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "status_supervisor_click_date", + table: "eva_create_evaluation_detail"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 48a8095..10cc031 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -181,18 +181,28 @@ namespace tb320eva.Migrations 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"); diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs index 3d82ccb..c001333 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs @@ -110,5 +110,17 @@ namespace TodoAPI2.Models [MaxLength(1)] public string status_supervisor2A { get; set; } + + //existingEntity.status_self = model.status_self; + // existingEntity.status_chief = model.status_chief; + // existingEntity.status_supervisor = model.status_supervisor; + // existingEntity.status_supervisor1A = model.status_supervisor1A; + // existingEntity.status_supervisor2A = model.status_supervisor2A; + + public DateTime? status_self_click_date { get; set; } + public DateTime? status_chief_click_date { get; set; } + public DateTime? status_supervisor_click_date { get; set; } + public DateTime? status_supervisor1A_click_date { get; set; } + public DateTime? status_supervisor2A_click_date { get; set; } } } diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs index b26d6b1..92068aa 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs @@ -275,6 +275,12 @@ namespace TodoAPI2.Models fk_eva_create_evaluationResult10.supervisor1_id, fk_eva_create_evaluationResult10.supervisor2_id, path), + status_self_click_date = m_eva_create_evaluation_detail_process.status_self_click_date, + status_chief_click_date = m_eva_create_evaluation_detail_process.status_chief_click_date, + status_supervisor_click_date = m_eva_create_evaluation_detail_process.status_supervisor_click_date, + status_supervisor1A_click_date = m_eva_create_evaluation_detail_process.status_supervisor1A_click_date, + status_supervisor2A_click_date = m_eva_create_evaluation_detail_process.status_supervisor2A_click_date, + isActive = m_eva_create_evaluation_detail_process.isActive, Created = m_eva_create_evaluation_detail_process.created, Updated = m_eva_create_evaluation_detail_process.updated diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs index eb146e7..0933ee6 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs @@ -60,6 +60,34 @@ namespace TodoAPI2.Models public string role_code { get; set; } public string remark_hrm_work_record { get; set; } + + public DateTime? status_self_click_date { get; set; } + public DateTime? status_chief_click_date { get; set; } + public DateTime? status_supervisor_click_date { get; set; } + public DateTime? status_supervisor1A_click_date { get; set; } + public DateTime? status_supervisor2A_click_date { get; set; } + + public string txt_status_self { get { return getStatusText(status_self) + MyHelper.GetDateStringForReport(status_self_click_date); } } + public string txt_status_chief { get { return getStatusText(status_chief) + MyHelper.GetDateStringForReport(status_chief_click_date); } } + public string txt_status_supervisor { get { return getStatusText(status_supervisor) + MyHelper.GetDateStringForReport(status_supervisor_click_date); } } + public string txt_status_supervisor1A { get { return getStatusText(status_supervisor1A) + MyHelper.GetDateStringForReport(status_supervisor1A_click_date); } } + public string txt_status_supervisor2A { get { return getStatusText(status_supervisor2A) + MyHelper.GetDateStringForReport(status_supervisor2A_click_date); } } + + private string getStatusText(string s) + { + if (!string.IsNullOrEmpty(s)) + { + if(s=="Y") + { + return "ส่งแบบประเมินแล้ว "; + } + else if (s == "N") + { + return "ตีกลับ "; + } + } + return " "; + } } } diff --git a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusInputModel.cs b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusInputModel.cs index ae4476c..d6e2bf5 100644 --- a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusInputModel.cs +++ b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusInputModel.cs @@ -28,6 +28,8 @@ namespace TodoAPI2.Models public string status_supervisor2A { get; set; } + public string status_mode { get; set; } + public string active_mode { get; set; } } } diff --git a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs index 0d56044..13b6cd4 100644 --- a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs +++ b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs @@ -105,6 +105,12 @@ namespace TodoAPI2.Models status_supervisor1A = m_eva_create_evaluation_detail_status.status_supervisor1A, status_supervisor2A = m_eva_create_evaluation_detail_status.status_supervisor2A, + status_self_click_date = m_eva_create_evaluation_detail_status.status_self_click_date, + status_chief_click_date = m_eva_create_evaluation_detail_status.status_chief_click_date, + status_supervisor_click_date = m_eva_create_evaluation_detail_status.status_supervisor_click_date, + status_supervisor1A_click_date = m_eva_create_evaluation_detail_status.status_supervisor1A_click_date, + status_supervisor2A_click_date = m_eva_create_evaluation_detail_status.status_supervisor2A_click_date, + isActive = m_eva_create_evaluation_detail_status.isActive, Created = m_eva_create_evaluation_detail_status.created, Updated = m_eva_create_evaluation_detail_status.updated @@ -168,6 +174,47 @@ namespace TodoAPI2.Models if(existingEntity.status_chief == "Y") existingEntity.status_supervisor = existingEntity.status_chief; } + if (model.status_mode == "next0") + { + existingEntity.status_self_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + } + else if (model.status_mode == "next1") + { + existingEntity.status_chief_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + } + else if (model.status_mode == "back1") + { + existingEntity.status_chief_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + existingEntity.status_self_click_date = null; + } + else if (model.status_mode == "next2") + { + existingEntity.status_supervisor_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + } + else if (model.status_mode == "back2") + { + existingEntity.status_supervisor_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + existingEntity.status_chief_click_date = null; + } + else if (model.status_mode == "next3") + { + existingEntity.status_supervisor1A_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + } + else if (model.status_mode == "back3") + { + existingEntity.status_supervisor1A_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + existingEntity.status_supervisor_click_date = null; + } + else if (model.status_mode == "next4") + { + existingEntity.status_supervisor2A_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + } + else if (model.status_mode == "back4") + { + existingEntity.status_supervisor2A_click_date = MyHelper.RemoveTimeFromDate(DateTime.Now); + existingEntity.status_supervisor1A_click_date = null; + } + var updated = _repository.Update(id, existingEntity); return Get(updated.id); } diff --git a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusViewModel.cs b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusViewModel.cs index 53007f3..b20a201 100644 --- a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusViewModel.cs +++ b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusViewModel.cs @@ -25,6 +25,18 @@ namespace TodoAPI2.Models public string status_supervisor1A { get; set; } public string status_supervisor2A { get; set; } + + public DateTime? status_self_click_date { get; set; } + public DateTime? status_chief_click_date { get; set; } + public DateTime? status_supervisor_click_date { get; set; } + public DateTime? status_supervisor1A_click_date { get; set; } + public DateTime? status_supervisor2A_click_date { get; set; } + + public string txt_status_self_click_date { get { return MyHelper.GetDateStringForReport(status_self_click_date); } } + public string txt_status_chief_click_date { get { return MyHelper.GetDateStringForReport(status_chief_click_date); } } + public string txt_status_supervisor_click_date { get { return MyHelper.GetDateStringForReport(status_supervisor_click_date); } } + public string txt_status_supervisor1A_click_date { get { return MyHelper.GetDateStringForReport(status_supervisor1A_click_date); } } + public string txt_status_supervisor2A_click_date { get { return MyHelper.GetDateStringForReport(status_supervisor2A_click_date); } } } } diff --git a/Utils/MyHelper.cs b/Utils/MyHelper.cs index bb32bcd..31a40c5 100644 --- a/Utils/MyHelper.cs +++ b/Utils/MyHelper.cs @@ -34,6 +34,15 @@ public class MyHelper return result; } + public static DateTime? RemoveTimeFromDate(DateTime? d) + { + if (d.HasValue) + { + return new DateTime(d.Value.Year, d.Value.Month, d.Value.Day); + } + return null; + } + public static string GetDateStringForReport(DateTime? date) { if (date.HasValue) diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml index 8424ebf..99aef59 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml @@ -304,7 +304,7 @@
- +
diff --git a/appsettings.Development.json b/appsettings.Development.json index 360c0a1..89a4a83 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -1,9 +1,9 @@ { "connectionStrings": { - //"mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", - //"externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" - "mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", - "externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" + "mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", + "externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" + //"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", + //"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" }, "IdentityServer": { "url": "", diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js index e02bddd..67a914c 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js @@ -195,11 +195,11 @@ var eva_create_evaluation_detail_process_setupTable = function (result) { { "data": "employee_position_level" }, { "data": "org_id_external_linkage_external_name" }, { "data": "role_desc" }, -{ "data": "status_self" }, -{ "data": "status_chief" }, -{ "data": "status_supervisor" }, -{ "data": "status_supervisor1A" }, -{ "data": "status_supervisor2A" } +{ "data": "txt_status_self" }, +{ "data": "txt_status_chief" }, +{ "data": "txt_status_supervisor" }, +{ "data": "txt_status_supervisor1A" }, +{ "data": "txt_status_supervisor2A" } ], "columnDefs": [ { diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js index 9de1adc..d619ff0 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js @@ -170,7 +170,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btna01").hide(); $("#btna02").hide(); $("#btna03").hide(); - $("#eva_create_evaluation_detail_review01_supervisor1_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review01_supervisor1_date").prop('disabled', true); $("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", true); if(role_code === "1"){ // ผู้ประเมิน @@ -181,7 +181,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btna01").show(); $("#btna02").show(); $("#btna03").show(); - $("#eva_create_evaluation_detail_review01_supervisor1_date").attr("disabled", false); + $("#eva_create_evaluation_detail_review01_supervisor1_date").prop("disabled", false); $("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", false); }else{ $("#thestatus").text("(ผู้รับการประเมิน ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)"); @@ -195,7 +195,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btna01").hide(); $("#btna02").hide(); $("#btna03").hide(); - $("#eva_create_evaluation_detail_review01_supervisor1_date").attr("disabled", true); + $("#eva_create_evaluation_detail_review01_supervisor1_date").prop("disabled", true); $("#eva_create_evaluation_detail_review01_supervisor1_remark").attr("disabled", true); } }else{ diff --git a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js index 3742325..730b692 100644 --- a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js @@ -73,6 +73,8 @@ function eva_create_evaluation_detail_status_PutUpdate(a) { var data = eva_create_evaluation_detail_status_GetFromForm(); + data.status_mode = a; + if(a == "next0"){ data.status_self = "Y"; } @@ -81,27 +83,27 @@ function eva_create_evaluation_detail_status_PutUpdate(a) { } else if(a == "back1"){ data.status_chief = "N"; - data.status_self = "N"; + data.status_self = ""; } else if(a == "next2"){ data.status_supervisor = "Y"; } else if(a == "back2"){ data.status_supervisor = "N"; - data.status_chief = "N"; + data.status_chief = ""; } else if(a == "next3"){ data.status_supervisor1A = "Y"; } else if(a == "back3"){ - data.status_supervisor = "N"; + data.status_supervisor = ""; data.status_supervisor1A = "N"; } else if(a == "next4"){ data.status_supervisor2A = "Y"; } else if(a == "back4"){ - data.status_supervisor1A = "N"; + data.status_supervisor1A = ""; data.status_supervisor2A = "N"; }