diff --git a/Migrations/25630817055844_AddSupervisor1A2AField.Designer.cs b/Migrations/25630817055844_AddSupervisor1A2AField.Designer.cs new file mode 100644 index 0000000..bbb3373 --- /dev/null +++ b/Migrations/25630817055844_AddSupervisor1A2AField.Designer.cs @@ -0,0 +1,687 @@ +// +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("25630817055844_AddSupervisor1A2AField")] + partial class AddSupervisor1A2AField + { + 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_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_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/25630817055844_AddSupervisor1A2AField.cs b/Migrations/25630817055844_AddSupervisor1A2AField.cs new file mode 100644 index 0000000..d92f75c --- /dev/null +++ b/Migrations/25630817055844_AddSupervisor1A2AField.cs @@ -0,0 +1,231 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddSupervisor1A2AField : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "score3", + table: "eva_evaluation_behavior", + nullable: true); + + migrationBuilder.AddColumn( + name: "score4", + table: "eva_evaluation_behavior", + nullable: true); + + migrationBuilder.AddColumn( + name: "sumary3", + table: "eva_evaluation_behavior", + nullable: true); + + migrationBuilder.AddColumn( + name: "sumary4", + table: "eva_evaluation_behavior", + nullable: true); + + migrationBuilder.AddColumn( + name: "score3", + table: "eva_evaluation_achievement", + nullable: true); + + migrationBuilder.AddColumn( + name: "score4", + table: "eva_evaluation_achievement", + nullable: true); + + migrationBuilder.AddColumn( + name: "sumary3", + table: "eva_evaluation_achievement", + nullable: true); + + migrationBuilder.AddColumn( + name: "sumary4", + table: "eva_evaluation_achievement", + nullable: true); + + migrationBuilder.AddColumn( + name: "Final_summary_competency_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "Final_summary_competency_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "Final_summary_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "Final_summary_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "achievement_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "achievement_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "competency_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "competency_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "level_score_supervisor1A", + table: "eva_create_evaluation_detail", + maxLength: 255, + nullable: true); + + migrationBuilder.AddColumn( + name: "level_score_supervisor2A", + table: "eva_create_evaluation_detail", + maxLength: 255, + nullable: true); + + migrationBuilder.AddColumn( + name: "score_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "score_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "total_summary_competency_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "total_summary_competency_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "total_summary_supervisor1A", + table: "eva_create_evaluation_detail", + nullable: true); + + migrationBuilder.AddColumn( + name: "total_summary_supervisor2A", + table: "eva_create_evaluation_detail", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "score3", + table: "eva_evaluation_behavior"); + + migrationBuilder.DropColumn( + name: "score4", + table: "eva_evaluation_behavior"); + + migrationBuilder.DropColumn( + name: "sumary3", + table: "eva_evaluation_behavior"); + + migrationBuilder.DropColumn( + name: "sumary4", + table: "eva_evaluation_behavior"); + + migrationBuilder.DropColumn( + name: "score3", + table: "eva_evaluation_achievement"); + + migrationBuilder.DropColumn( + name: "score4", + table: "eva_evaluation_achievement"); + + migrationBuilder.DropColumn( + name: "sumary3", + table: "eva_evaluation_achievement"); + + migrationBuilder.DropColumn( + name: "sumary4", + table: "eva_evaluation_achievement"); + + migrationBuilder.DropColumn( + name: "Final_summary_competency_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "Final_summary_competency_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "Final_summary_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "Final_summary_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "achievement_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "achievement_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "competency_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "competency_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "level_score_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "level_score_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "score_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "score_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "total_summary_competency_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "total_summary_competency_supervisor2A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "total_summary_supervisor1A", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "total_summary_supervisor2A", + table: "eva_create_evaluation_detail"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 10cc031..b9a4470 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -148,18 +148,34 @@ namespace tb320eva.Migrations 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"); @@ -174,10 +190,20 @@ namespace tb320eva.Migrations 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); @@ -249,8 +275,16 @@ namespace tb320eva.Migrations 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"); @@ -275,10 +309,18 @@ namespace tb320eva.Migrations 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); @@ -325,10 +367,18 @@ namespace tb320eva.Migrations 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); 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 c001333..fa460b6 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs @@ -14,8 +14,6 @@ namespace TodoAPI2.Models { public class eva_create_evaluation_detailEntity : BaseEntity2 { - - public int? create_evaluation_id { get; set; } public int? employee_id { get; set; } @@ -122,5 +120,40 @@ namespace TodoAPI2.Models 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 decimal? total_summary_supervisor1A { get; set; } + + public decimal? Final_summary_supervisor1A { get; set; } + + public decimal? total_summary_competency_supervisor1A { get; set; } + + public decimal? Final_summary_competency_supervisor1A { get; set; } + + public decimal? achievement_supervisor1A { get; set; } + + public decimal? competency_supervisor1A { get; set; } + + public decimal? score_supervisor1A { get; set; } + + [MaxLength(255)] + public string level_score_supervisor1A { get; set; } + + public decimal? total_summary_supervisor2A { get; set; } + + public decimal? Final_summary_supervisor2A { get; set; } + + public decimal? total_summary_competency_supervisor2A { get; set; } + + public decimal? Final_summary_competency_supervisor2A { get; set; } + + public decimal? achievement_supervisor2A { get; set; } + + public decimal? competency_supervisor2A { get; set; } + + public decimal? score_supervisor2A { get; set; } + + [MaxLength(255)] + public string level_score_supervisor2A { get; set; } } } + diff --git a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2InputModel.cs b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2InputModel.cs index 6bb1e1b..acbdbe5 100644 --- a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2InputModel.cs +++ b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2InputModel.cs @@ -34,6 +34,8 @@ namespace TodoAPI2.Models public string level_score_supervisor { get; set; } + public string who_update { get; set; } + public string active_mode { get; set; } } } diff --git a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs index 7e75271..df6f7b4 100644 --- a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs +++ b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2Service.cs @@ -20,14 +20,14 @@ namespace TodoAPI2.Models public class eva_create_evaluation_detail_summary2Service : Ieva_create_evaluation_detail_summary2Service { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; public eva_create_evaluation_detail_summary2Service(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) { _repository = repository; - db = mydb; - ext = inext; + db = mydb; + ext = inext; } #region Private Functions @@ -47,7 +47,7 @@ namespace TodoAPI2.Models { return Mapper.Map>(entities); } - + #endregion #region Public Functions @@ -77,18 +77,18 @@ namespace TodoAPI2.Models public List GetListBycreate_evaluation_id(int? create_evaluation_id) { - var model = new eva_create_evaluation_detail_summary2SearchModel(); + var model = new eva_create_evaluation_detail_summary2SearchModel(); model.create_evaluation_id = create_evaluation_id; return GetListBySearch(model); } - public List GetListBySearch(eva_create_evaluation_detail_summary2SearchModel model) + public List GetListBySearch(eva_create_evaluation_detail_summary2SearchModel model) { var data = ( from m_eva_create_evaluation_detail_summary2 in _repository.Context.eva_create_evaluation_detail - where 1==1 + where 1 == 1 //&& (m_eva_create_evaluation_detail_summary2.id == model.id || !model.id.HasValue) && (m_eva_create_evaluation_detail_summary2.create_evaluation_id == model.create_evaluation_id || !model.create_evaluation_id.HasValue) @@ -98,6 +98,7 @@ namespace TodoAPI2.Models { id = m_eva_create_evaluation_detail_summary2.id, create_evaluation_id = m_eva_create_evaluation_detail_summary2.create_evaluation_id, + total_summary_supervisor = m_eva_create_evaluation_detail_summary2.total_summary_supervisor, Final_summary_supervisor = m_eva_create_evaluation_detail_summary2.Final_summary_supervisor, total_summary_competency_supervisor = m_eva_create_evaluation_detail_summary2.total_summary_competency_supervisor, @@ -107,6 +108,23 @@ namespace TodoAPI2.Models score_supervisor = m_eva_create_evaluation_detail_summary2.score_supervisor, level_score_supervisor = m_eva_create_evaluation_detail_summary2.level_score_supervisor, + total_summary_supervisor1A = m_eva_create_evaluation_detail_summary2.total_summary_supervisor1A, + Final_summary_supervisor1A = m_eva_create_evaluation_detail_summary2.Final_summary_supervisor1A, + total_summary_competency_supervisor1A = m_eva_create_evaluation_detail_summary2.total_summary_competency_supervisor1A, + Final_summary_competency_supervisor1A = m_eva_create_evaluation_detail_summary2.Final_summary_competency_supervisor1A, + achievement_supervisor1A = m_eva_create_evaluation_detail_summary2.achievement_supervisor1A, + competency_supervisor1A = m_eva_create_evaluation_detail_summary2.competency_supervisor1A, + score_supervisor1A = m_eva_create_evaluation_detail_summary2.score_supervisor1A, + level_score_supervisor1A = m_eva_create_evaluation_detail_summary2.level_score_supervisor1A, + + total_summary_supervisor2A = m_eva_create_evaluation_detail_summary2.total_summary_supervisor2A, + Final_summary_supervisor2A = m_eva_create_evaluation_detail_summary2.Final_summary_supervisor2A, + total_summary_competency_supervisor2A = m_eva_create_evaluation_detail_summary2.total_summary_competency_supervisor2A, + Final_summary_competency_supervisor2A = m_eva_create_evaluation_detail_summary2.Final_summary_competency_supervisor2A, + achievement_supervisor2A = m_eva_create_evaluation_detail_summary2.achievement_supervisor2A, + competency_supervisor2A = m_eva_create_evaluation_detail_summary2.competency_supervisor2A, + score_supervisor2A = m_eva_create_evaluation_detail_summary2.score_supervisor2A, + level_score_supervisor2A = m_eva_create_evaluation_detail_summary2.level_score_supervisor2A, isActive = m_eva_create_evaluation_detail_summary2.isActive, Created = m_eva_create_evaluation_detail_summary2.created, @@ -126,10 +144,10 @@ namespace TodoAPI2.Models int? newkey = 0; var x = (from i in _repository.Context.eva_create_evaluation_detail - orderby i.id descending - select i).Take(1).ToList(); + orderby i.id descending + select i).Take(1).ToList(); - if(x.Count > 0) + if (x.Count > 0) { newkey = x[0].id + 1; } @@ -145,7 +163,7 @@ namespace TodoAPI2.Models var inserted = _repository.Insert(entity); - + return Get(inserted.id); } @@ -155,6 +173,7 @@ namespace TodoAPI2.Models if (existingEntity != null) { existingEntity.create_evaluation_id = model.create_evaluation_id; + existingEntity.total_summary_supervisor = model.total_summary_supervisor; existingEntity.Final_summary_supervisor = model.Final_summary_supervisor; existingEntity.total_summary_competency_supervisor = model.total_summary_competency_supervisor; @@ -169,28 +188,71 @@ namespace TodoAPI2.Models return Get(updated.id); } else - throw new NotificationException("No data to update"); + throw new NotificationException("No data to update"); } - public string UpdateMultiple(List model) + public string UpdateMultiple(List model) { - foreach(var i in model) + foreach (var i in model) { if (i.active_mode == "1" && i.id.HasValue) // update - { + { var existingEntity = _repository.Get(i.id.Value); if (existingEntity != null) { - existingEntity.create_evaluation_id = i.create_evaluation_id; - existingEntity.total_summary_supervisor = i.total_summary_supervisor; - existingEntity.Final_summary_supervisor = i.Final_summary_supervisor; - existingEntity.total_summary_competency_supervisor = i.total_summary_competency_supervisor; - existingEntity.Final_summary_competency_supervisor = i.Final_summary_competency_supervisor; - existingEntity.achievement_supervisor = i.achievement_supervisor; - existingEntity.competency_supervisor = i.competency_supervisor; - existingEntity.score_supervisor = i.score_supervisor; - existingEntity.level_score_supervisor = i.level_score_supervisor; + existingEntity.create_evaluation_id = i.create_evaluation_id; + if(i.who_update == "2") + { + existingEntity.total_summary_supervisor = i.total_summary_supervisor; + existingEntity.Final_summary_supervisor = i.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor = i.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor = i.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor = i.achievement_supervisor; + existingEntity.competency_supervisor = i.competency_supervisor; + existingEntity.score_supervisor = i.score_supervisor; + existingEntity.level_score_supervisor = i.level_score_supervisor; + + existingEntity.total_summary_supervisor1A = i.total_summary_supervisor; + existingEntity.Final_summary_supervisor1A = i.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor1A = i.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor1A = i.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor1A = i.achievement_supervisor; + existingEntity.competency_supervisor1A = i.competency_supervisor; + existingEntity.score_supervisor1A = i.score_supervisor; + existingEntity.level_score_supervisor1A = i.level_score_supervisor; + } + else if (i.who_update == "3") + { + existingEntity.total_summary_supervisor1A = i.total_summary_supervisor; + existingEntity.Final_summary_supervisor1A = i.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor1A = i.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor1A = i.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor1A = i.achievement_supervisor; + existingEntity.competency_supervisor1A = i.competency_supervisor; + existingEntity.score_supervisor1A = i.score_supervisor; + existingEntity.level_score_supervisor1A = i.level_score_supervisor; + + existingEntity.total_summary_supervisor2A = i.total_summary_supervisor; + existingEntity.Final_summary_supervisor2A = i.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor2A = i.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor2A = i.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor2A = i.achievement_supervisor; + existingEntity.competency_supervisor2A = i.competency_supervisor; + existingEntity.score_supervisor2A = i.score_supervisor; + existingEntity.level_score_supervisor2A = i.level_score_supervisor; + } + else if (i.who_update == "4") + { + existingEntity.total_summary_supervisor2A = i.total_summary_supervisor; + existingEntity.Final_summary_supervisor2A = i.Final_summary_supervisor; + existingEntity.total_summary_competency_supervisor2A = i.total_summary_competency_supervisor; + existingEntity.Final_summary_competency_supervisor2A = i.Final_summary_competency_supervisor; + existingEntity.achievement_supervisor2A = i.achievement_supervisor; + existingEntity.competency_supervisor2A = i.competency_supervisor; + existingEntity.score_supervisor2A = i.score_supervisor; + existingEntity.level_score_supervisor2A = i.level_score_supervisor; + } _repository.UpdateWithoutCommit(i.id.Value, existingEntity); } @@ -202,15 +264,15 @@ namespace TodoAPI2.Models _repository.InsertWithoutCommit(entity); } else if (i.active_mode == "0" && i.id.HasValue) // remove - { + { _repository.DeleteWithoutCommit(i.id.Value); } else if (i.active_mode == "0" && !i.id.HasValue) { // nothing to do - } + } } - _repository.Context.SaveChanges(); + _repository.Context.SaveChanges(); return model.Count().ToString(); } diff --git a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2ViewModel.cs b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2ViewModel.cs index ab39fee..967ad77 100644 --- a/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2ViewModel.cs +++ b/Models/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2ViewModel.cs @@ -32,6 +32,36 @@ namespace TodoAPI2.Models public string level_score_supervisor { get; set; } + public decimal? total_summary_supervisor1A { get; set; } + public decimal? Final_summary_supervisor1A { get; set; } + + public decimal? total_summary_competency_supervisor1A { get; set; } + + public decimal? Final_summary_competency_supervisor1A { get; set; } + + public decimal? achievement_supervisor1A { get; set; } + + public decimal? competency_supervisor1A { get; set; } + + public decimal? score_supervisor1A { get; set; } + + public string level_score_supervisor1A { get; set; } + + public decimal? total_summary_supervisor2A { get; set; } + + public decimal? Final_summary_supervisor2A { get; set; } + + public decimal? total_summary_competency_supervisor2A { get; set; } + + public decimal? Final_summary_competency_supervisor2A { get; set; } + + public decimal? achievement_supervisor2A { get; set; } + + public decimal? competency_supervisor2A { get; set; } + + public decimal? score_supervisor2A { get; set; } + + public string level_score_supervisor2A { get; set; } } } \ No newline at end of file diff --git a/Models/eva_evaluation_achievement/eva_evaluation_achievementEntity.cs b/Models/eva_evaluation_achievement/eva_evaluation_achievementEntity.cs index c324436..b749a74 100644 --- a/Models/eva_evaluation_achievement/eva_evaluation_achievementEntity.cs +++ b/Models/eva_evaluation_achievement/eva_evaluation_achievementEntity.cs @@ -39,11 +39,13 @@ namespace TodoAPI2.Models } public decimal? score { get; set; } - public decimal? sumary { get; set; } public decimal? score2 { get; set; } - public decimal? sumary2 { get; set; } + public decimal? score3 { get; set; } + public decimal? sumary3 { get; set; } + public decimal? score4 { get; set; } + public decimal? sumary4 { get; set; } [MaxLength(255)] public string target_score1 { get; set; } diff --git a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2InputModel.cs b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2InputModel.cs index cbec351..5545acd 100644 --- a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2InputModel.cs +++ b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2InputModel.cs @@ -40,6 +40,8 @@ namespace TodoAPI2.Models public string target_score5 { get; set; } + public string who_update { get; set; } + public string active_mode { get; set; } } } diff --git a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs index 86a14d2..83f9462 100644 --- a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs +++ b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2Service.cs @@ -106,10 +106,16 @@ namespace TodoAPI2.Models weight = m_eva_evaluation_achievement_process2.weight, thefile = m_eva_evaluation_achievement_process2.thefile, thefileDisplay = m_eva_evaluation_achievement_process2.thefileDisplay, + score = m_eva_evaluation_achievement_process2.score, sumary = m_eva_evaluation_achievement_process2.sumary, score2 = m_eva_evaluation_achievement_process2.score2, sumary2 = m_eva_evaluation_achievement_process2.sumary2, + score3 = m_eva_evaluation_achievement_process2.score3, + sumary3 = m_eva_evaluation_achievement_process2.sumary3, + score4 = m_eva_evaluation_achievement_process2.score4, + sumary4 = m_eva_evaluation_achievement_process2.sumary4, + target_score1 = m_eva_evaluation_achievement_process2.target_score1, target_score2 = m_eva_evaluation_achievement_process2.target_score2, target_score3 = m_eva_evaluation_achievement_process2.target_score3, @@ -220,10 +226,10 @@ namespace TodoAPI2.Models where k.id == existingEntity.create_evaluation_detail_id select k).FirstOrDefault(); - if (current_detail.status_supervisor == "Y") - { - throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); - } + //if (current_detail.status_supervisor == "Y") + //{ + // throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + //} if (existingEntity != null) { @@ -249,8 +255,27 @@ namespace TodoAPI2.Models } //existingEntity.score = i.score; - existingEntity.score2 = i.score2; - existingEntity.sumary2 = i.sumary2; + + if (i.who_update == "2") + { + existingEntity.score2 = i.score2; + existingEntity.sumary2 = i.sumary2; + existingEntity.score3 = i.score2; + existingEntity.sumary3 = i.sumary2; + } + else if (i.who_update == "3") + { + existingEntity.score3 = i.score2; + existingEntity.sumary3 = i.sumary2; + existingEntity.score4 = i.score2; + existingEntity.sumary4 = i.sumary2; + } + else if (i.who_update == "4") + { + existingEntity.score4 = i.score2; + existingEntity.sumary4 = i.sumary2; + } + //existingEntity.target_score1 = i.target_score1; //existingEntity.target_score2 = i.target_score2; //existingEntity.target_score3 = i.target_score3; diff --git a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2ViewModel.cs b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2ViewModel.cs index 8bfeaf6..ba1bc37 100644 --- a/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2ViewModel.cs +++ b/Models/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2ViewModel.cs @@ -39,6 +39,12 @@ namespace TodoAPI2.Models public decimal? score2 { get; set; } public decimal? sumary2 { get; set; } + public decimal? score3 { get; set; } + + public decimal? sumary3 { get; set; } + public decimal? score4 { get; set; } + + public decimal? sumary4 { get; set; } public string target_score1 { get; set; } diff --git a/Models/eva_evaluation_behavior/eva_evaluation_behaviorEntity.cs b/Models/eva_evaluation_behavior/eva_evaluation_behaviorEntity.cs index 3bc13c1..f4e2bb7 100644 --- a/Models/eva_evaluation_behavior/eva_evaluation_behaviorEntity.cs +++ b/Models/eva_evaluation_behavior/eva_evaluation_behaviorEntity.cs @@ -26,11 +26,13 @@ namespace TodoAPI2.Models public decimal? weight { get; set; } public decimal? score { get; set; } - public decimal? sumary { get; set; } public decimal? score2 { get; set; } - public decimal? sumary2 { get; set; } + public decimal? score3 { get; set; } + public decimal? sumary3 { get; set; } + public decimal? score4 { get; set; } + public decimal? sumary4 { get; set; } [MaxLength(255)] public string target_score1 { get; set; } diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2InputModel.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2InputModel.cs index 8dc961c..7ff5ac6 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2InputModel.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2InputModel.cs @@ -38,6 +38,8 @@ namespace TodoAPI2.Models public string target_score5 { get; set; } + public string who_update { get; set; } + public string active_mode { get; set; } } } diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs index 7c8fe53..f49e850 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2Service.cs @@ -104,10 +104,16 @@ namespace TodoAPI2.Models create_evaluation_detail_id = m_eva_evaluation_behavior_process2.create_evaluation_detail_id, behavior = m_eva_evaluation_behavior_process2.behavior_fix, weight = m_eva_evaluation_behavior_process2.weight, + score = m_eva_evaluation_behavior_process2.score, sumary = m_eva_evaluation_behavior_process2.sumary, score2 = m_eva_evaluation_behavior_process2.score2, sumary2 = m_eva_evaluation_behavior_process2.sumary2, + score3 = m_eva_evaluation_behavior_process2.score3, + sumary3 = m_eva_evaluation_behavior_process2.sumary3, + score4 = m_eva_evaluation_behavior_process2.score4, + sumary4 = m_eva_evaluation_behavior_process2.sumary4, + target_score1 = m_eva_evaluation_behavior_process2.target_score1, target_score2 = m_eva_evaluation_behavior_process2.target_score2, target_score3 = m_eva_evaluation_behavior_process2.target_score3, @@ -195,17 +201,36 @@ namespace TodoAPI2.Models where k.id == existingEntity.create_evaluation_detail_id select k).FirstOrDefault(); - if (current_detail.status_supervisor == "Y") - { - throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); - } + //if (current_detail.status_supervisor == "Y") + //{ + // throw new Exception("ผู้ประเมินสูงสุด ส่งแบบประเมินไปแล้ว บันทึกไม่ได้"); + //} //existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id; //existingEntity.behavior = i.behavior; existingEntity.weight = i.weight; //existingEntity.score = i.score; - existingEntity.score2 = i.score2; - existingEntity.sumary2 = i.sumary2; + + if (i.who_update == "2") + { + existingEntity.score2 = i.score2; + existingEntity.sumary2 = i.sumary2; + existingEntity.score3 = i.score2; + existingEntity.sumary3 = i.sumary2; + } + else if (i.who_update == "3") + { + existingEntity.score3 = i.score2; + existingEntity.sumary3 = i.sumary2; + existingEntity.score4 = i.score2; + existingEntity.sumary4 = i.sumary2; + } + else if (i.who_update == "4") + { + existingEntity.score4 = i.score2; + existingEntity.sumary4 = i.sumary2; + } + existingEntity.target_score1 = i.target_score1; existingEntity.target_score2 = i.target_score2; existingEntity.target_score3 = i.target_score3; diff --git a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs index c01ec6c..7ccd8ed 100644 --- a/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs +++ b/Models/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2ViewModel.cs @@ -28,6 +28,14 @@ namespace TodoAPI2.Models public decimal? sumary2 { get; set; } + public decimal? score3 { get; set; } + + public decimal? sumary3 { get; set; } + + public decimal? score4 { get; set; } + + public decimal? sumary4 { get; set; } + public string target_score1 { get; set; } public string target_score2 { get; set; } diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index 9053be9..851a267 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -592,9 +592,7 @@ var id = getUrlParameter("id"); if (id) { eva_create_evaluation_detail_process_SetEditForm(id); - eva_evaluation_achievement_process2_InitialForm(id); - eva_evaluation_behavior_process2_InitialForm(id); - eva_create_evaluation_detail_summary2_SetEditForm(id); + eva_create_evaluation_detail_review01_SetEditForm(id); eva_create_evaluation_detail_review02_SetEditForm(id); eva_create_evaluation_detail_review03_SetEditForm(id); @@ -655,7 +653,7 @@ searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val())); searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val())); searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val(); - console.log(searchVacationObject); + //console.log(searchVacationObject); return searchVacationObject; } @@ -705,13 +703,17 @@ } function saveReview03(){ - //saveAll(); - eva_create_evaluation_detail_review03_PutUpdate(true); + saveAll(); + setTimeout(function() { + eva_create_evaluation_detail_review03_PutUpdate(true); + }, 1000); } function saveReview04(){ - //saveAll(); - eva_create_evaluation_detail_review04_PutUpdate(true); + saveAll(); + setTimeout(function() { + eva_create_evaluation_detail_review04_PutUpdate(true); + }, 1000); } function saveStatus(s){ @@ -721,7 +723,8 @@ return; } saveAll(); - setTimeout(function() { + eva_create_evaluation_detail_review02_PutUpdate(false); + setTimeout(function() { eva_create_evaluation_detail_status_PutUpdate(s); }, 1000); } @@ -730,16 +733,22 @@ { return; } + saveAll(); eva_create_evaluation_detail_review03_PutUpdate(false); - eva_create_evaluation_detail_status_PutUpdate(s); + setTimeout(function() { + eva_create_evaluation_detail_status_PutUpdate(s); + }, 1000); } else if(s === "next4"){ if (!ValidateForm('eva_create_evaluation_detail_review04', eva_create_evaluation_detail_review04_customValidation)) { return; } + saveAll(); eva_create_evaluation_detail_review04_PutUpdate(false); - eva_create_evaluation_detail_status_PutUpdate(s); + setTimeout(function() { + eva_create_evaluation_detail_status_PutUpdate(s); + }, 1000); } } diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js index 228f157..d190c99 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js @@ -63,20 +63,20 @@ $("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFi function eva_create_evaluation_detail_process_GetFromForm() { var eva_create_evaluation_detail_processObject = new Object(); -eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val(); -eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text(); -eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text(); -eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text(); -eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text(); -eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text(); -eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text(); -eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text(); -eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text(); -eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text(); -eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val(); -eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val(); -eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val(); -eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val(); + eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val(); + eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text(); + eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text(); + eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text(); + eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text(); + eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text(); + eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text(); + eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text(); + eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text(); + eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text(); + eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val(); + eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val(); + eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val(); + eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val(); return eva_create_evaluation_detail_processObject; @@ -96,9 +96,16 @@ function eva_create_evaluation_detail_process_InitialForm() { function eva_create_evaluation_detail_process_SetEditForm(a) { var successFunc = function (result) { eva_create_evaluation_detail_process_editMode = "UPDATE"; - eva_create_evaluation_detail_process_FeedDataToForm(result); - setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor, result.status_supervisor1A, result.status_supervisor2A); - endLoad(); + eva_create_evaluation_detail_process_FeedDataToForm(result); + + //startLoad(); + eva_evaluation_achievement_process2_InitialForm(a, result.role_code); + eva_evaluation_behavior_process2_InitialForm(a, result.role_code); + eva_create_evaluation_detail_summary2_SetEditForm(a, result.role_code); + + setTimeout(function(){ + setPageByRoleAndStatus(result.role_code, result.status_self, result.status_chief, result.status_supervisor, result.status_supervisor1A, result.status_supervisor2A); + },1000); }; startLoad(); @@ -177,7 +184,11 @@ function setViewOfComment(status_supervisor, status_supervisor1A, status_supervi } } +var the_role_code = ""; + function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor, status_supervisor1A, status_supervisor2A){ + endLoad(); + the_role_code = role_code; $(".myeditor").attr("disabled", true); $("#btnb01").hide(); @@ -241,6 +252,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btnc01").show(); $("#btnc02").show(); //$("#btnc03").show(); + $(".myeditor").attr("disabled", false); }else{ $("#thestatus1A").text("(ผู้รับการประเมิน หรือ ผู้ประเมิน หรือ ผู้ประเมินสูงสุด ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)"); } @@ -253,6 +265,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btnc02").hide(); $("#btnc03").hide(); $("#thestatus1A").text("(ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง ส่งแบบประเมินแล้ว)"); + $(".myeditor").attr("disabled", true); } } @@ -267,6 +280,7 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btnd01").show(); $("#btnd02").show(); //$("#btnd03").show(); + $(".myeditor").attr("disabled", false); }else{ $("#thestatus2A").text("(ผู้รับการประเมิน หรือ ผู้ประเมิน หรือ ผู้ประเมินสูงสุด หรือ ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง ยังไม่ส่งแบบประเมิน คุณจึงไม่สามารถให้ความเห็นได้)"); } @@ -278,11 +292,13 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btnd02").hide(); $("#btnd03").hide(); $("#thestatus2A").text("(ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด) ส่งแบบประเมินแล้ว)"); + $(".myeditor").attr("disabled", true); } } else { alert('คุณไม่มีสิทธิเข้าถึงหน้าจอนี้!'); window_close(); } + } diff --git a/wwwroot/js/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2_d.js b/wwwroot/js/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2_d.js index 8392160..9203a2a 100644 --- a/wwwroot/js/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_summary2/eva_create_evaluation_detail_summary2_d.js @@ -3,33 +3,56 @@ var eva_create_evaluation_detail_summary2_API = "/api/eva_create_evaluation_deta //================= Form Data Customizaiton ========================================= -function eva_create_evaluation_detail_summary2_FeedDataToForm(data) { -$("#eva_create_evaluation_detail_summary2_id").val(data.id); -$("#eva_create_evaluation_detail_summary2_create_evaluation_id").val(data.create_evaluation_id); -$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor); -$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor); -$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor); -$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(data.Final_summary_competency_supervisor); -$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(data.achievement_supervisor); -$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(data.competency_supervisor); -$("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor); -$("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor); -console.log(data); +function eva_create_evaluation_detail_summary2_FeedDataToForm(data, role_code) { + $("#eva_create_evaluation_detail_summary2_id").val(data.id); + $("#eva_create_evaluation_detail_summary2_create_evaluation_id").val(data.create_evaluation_id); + + if(role_code === "2"){ + $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor); + $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor); + $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor); + $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(data.Final_summary_competency_supervisor); + $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(data.achievement_supervisor); + $("#eva_create_evaluation_detail_summary2_competency_supervisor").text(data.competency_supervisor); + $("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor); + $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor); + } + else if(role_code === "3"){ + $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor1A); + $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor1A); + $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor1A); + $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(data.Final_summary_competency_supervisor1A); + $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(data.achievement_supervisor1A); + $("#eva_create_evaluation_detail_summary2_competency_supervisor").text(data.competency_supervisor1A); + $("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor1A); + $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor1A); + } + else if(role_code === "4"){ + $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor2A); + $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor2A); + $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor2A); + $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(data.Final_summary_competency_supervisor2A); + $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(data.achievement_supervisor2A); + $("#eva_create_evaluation_detail_summary2_competency_supervisor").text(data.competency_supervisor2A); + $("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor2A); + $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor2A); + } } function eva_create_evaluation_detail_summary2_GetFromForm() { var eva_create_evaluation_detail_summary2Object = new Object(); -eva_create_evaluation_detail_summary2Object.id = $("#eva_create_evaluation_detail_summary2_id").val(); -eva_create_evaluation_detail_summary2Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary2_create_evaluation_id").val(); -eva_create_evaluation_detail_summary2Object.total_summary_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(); -eva_create_evaluation_detail_summary2Object.Final_summary_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(); -eva_create_evaluation_detail_summary2Object.total_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(); -eva_create_evaluation_detail_summary2Object.Final_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(); -eva_create_evaluation_detail_summary2Object.achievement_supervisor = $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(); -eva_create_evaluation_detail_summary2Object.competency_supervisor = $("#eva_create_evaluation_detail_summary2_competency_supervisor").text(); -eva_create_evaluation_detail_summary2Object.score_supervisor = $("#eva_create_evaluation_detail_summary2_score_supervisor").text(); -eva_create_evaluation_detail_summary2Object.level_score_supervisor = $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(); + eva_create_evaluation_detail_summary2Object.id = $("#eva_create_evaluation_detail_summary2_id").val(); + eva_create_evaluation_detail_summary2Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary2_create_evaluation_id").val(); + eva_create_evaluation_detail_summary2Object.total_summary_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(); + eva_create_evaluation_detail_summary2Object.Final_summary_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(); + eva_create_evaluation_detail_summary2Object.total_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(); + eva_create_evaluation_detail_summary2Object.Final_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(); + eva_create_evaluation_detail_summary2Object.achievement_supervisor = $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(); + eva_create_evaluation_detail_summary2Object.competency_supervisor = $("#eva_create_evaluation_detail_summary2_competency_supervisor").text(); + eva_create_evaluation_detail_summary2Object.score_supervisor = $("#eva_create_evaluation_detail_summary2_score_supervisor").text(); + eva_create_evaluation_detail_summary2Object.level_score_supervisor = $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(); + eva_create_evaluation_detail_summary2Object.who_update = the_role_code; return eva_create_evaluation_detail_summary2Object; } @@ -45,10 +68,10 @@ function eva_create_evaluation_detail_summary2_InitialForm() { //================= Form Mode Setup and Flow ========================================= -function eva_create_evaluation_detail_summary2_SetEditForm(a) { +function eva_create_evaluation_detail_summary2_SetEditForm(a, role_code) { var successFunc = function (result) { eva_create_evaluation_detail_summary2_editMode = "UPDATE"; - eva_create_evaluation_detail_summary2_FeedDataToForm(result); + eva_create_evaluation_detail_summary2_FeedDataToForm(result, role_code); endLoad(); }; startLoad(); diff --git a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js index f075160..1748cdb 100644 --- a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js +++ b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js @@ -1,55 +1,73 @@ function eva_evaluation_achievement_process2_ClearForm(i, blankItem) { var data = blankItem; -$("#eva_evaluation_achievement_process2_id_" + i).val(""); -$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(""); -$("#eva_evaluation_achievement_process2_achievement_" + i).text(""); -$("#eva_evaluation_achievement_process2_weight_" + i).text(""); - -$("#eva_evaluation_achievement_process2_score_" + i).text(""); -$("#eva_evaluation_achievement_process2_score2_" + i).val(""); -$("#eva_evaluation_achievement_process2_sumary2_" + i).text(""); -//$("#eva_evaluation_achievement_process2_target_score1_" + i).val(""); -//$("#eva_evaluation_achievement_process2_target_score2_" + i).val(""); -//$("#eva_evaluation_achievement_process2_target_score3_" + i).val(""); -//$("#eva_evaluation_achievement_process2_target_score4_" + i).val(""); -//$("#eva_evaluation_achievement_process2_target_score5_" + i).val(""); + $("#eva_evaluation_achievement_process2_id_" + i).val(""); + $("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(""); + $("#eva_evaluation_achievement_process2_achievement_" + i).text(""); + $("#eva_evaluation_achievement_process2_weight_" + i).text(""); + $("#eva_evaluation_achievement_process2_score_" + i).text(""); + $("#eva_evaluation_achievement_process2_score2_" + i).val(""); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(""); + //$("#eva_evaluation_achievement_process2_target_score1_" + i).val(""); + //$("#eva_evaluation_achievement_process2_target_score2_" + i).val(""); + //$("#eva_evaluation_achievement_process2_target_score3_" + i).val(""); + //$("#eva_evaluation_achievement_process2_target_score4_" + i).val(""); + //$("#eva_evaluation_achievement_process2_target_score5_" + i).val(""); } -function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem) { +function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem, role_code) { -$("#eva_evaluation_achievement_process2_id_" + i).val(data.id); -$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id); -$("#eva_evaluation_achievement_process2_achievement_" + i).text(data.achievement); -$("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight); + $("#eva_evaluation_achievement_process2_id_" + i).val(data.id); + $("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id); + $("#eva_evaluation_achievement_process2_achievement_" + i).text(data.achievement); + $("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight); + + //console.log(data); -$("#eva_evaluation_achievement_process2_score_" + i).text(data.score); -$("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary); -$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2); -$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2); -//$("#eva_evaluation_achievement_process2_target_score1_" + i).val(data.target_score1); -//$("#eva_evaluation_achievement_process2_target_score2_" + i).val(data.target_score2); -//$("#eva_evaluation_achievement_process2_target_score3_" + i).val(data.target_score3); -//$("#eva_evaluation_achievement_process2_target_score4_" + i).val(data.target_score4); -//$("#eva_evaluation_achievement_process2_target_score5_" + i).val(data.target_score5); + if(role_code === "2"){ + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2); + } + else if(role_code === "3"){ + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score2); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary2); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score3); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary3); + } + else if(role_code === "4"){ + $("#eva_evaluation_achievement_process2_score_" + i).text(data.score3); + $("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary3); + $("#eva_evaluation_achievement_process2_score2_" + i).val(data.score4); + $("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary4); + } + + //$("#eva_evaluation_achievement_process2_target_score1_" + i).val(data.target_score1); + //$("#eva_evaluation_achievement_process2_target_score2_" + i).val(data.target_score2); + //$("#eva_evaluation_achievement_process2_target_score3_" + i).val(data.target_score3); + //$("#eva_evaluation_achievement_process2_target_score4_" + i).val(data.target_score4); + //$("#eva_evaluation_achievement_process2_target_score5_" + i).val(data.target_score5); } function eva_evaluation_achievement_process2_GetFromForm(obj, i) { var eva_evaluation_achievement_process2Object = new Object(); -eva_evaluation_achievement_process2Object.id = obj.find("#eva_evaluation_achievement_process2_id_" + i).val(); -eva_evaluation_achievement_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(); -eva_evaluation_achievement_process2Object.achievement = obj.find("#eva_evaluation_achievement_process2_achievement_" + i).text(); -eva_evaluation_achievement_process2Object.weight = obj.find("#eva_evaluation_achievement_process2_weight_" + i).text(); + eva_evaluation_achievement_process2Object.id = obj.find("#eva_evaluation_achievement_process2_id_" + i).val(); + eva_evaluation_achievement_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(); + eva_evaluation_achievement_process2Object.achievement = obj.find("#eva_evaluation_achievement_process2_achievement_" + i).text(); + eva_evaluation_achievement_process2Object.weight = obj.find("#eva_evaluation_achievement_process2_weight_" + i).text(); -eva_evaluation_achievement_process2Object.score = obj.find("#eva_evaluation_achievement_process2_score_" + i).text(); -eva_evaluation_achievement_process2Object.score2 = obj.find("#eva_evaluation_achievement_process2_score2_" + i).val(); -eva_evaluation_achievement_process2Object.sumary2 = obj.find("#eva_evaluation_achievement_process2_sumary2_" + i).text(); -//eva_evaluation_achievement_process2Object.target_score1 = obj.find("#eva_evaluation_achievement_process2_target_score1_" + i).val(); -//eva_evaluation_achievement_process2Object.target_score2 = obj.find("#eva_evaluation_achievement_process2_target_score2_" + i).val(); -//eva_evaluation_achievement_process2Object.target_score3 = obj.find("#eva_evaluation_achievement_process2_target_score3_" + i).val(); -//eva_evaluation_achievement_process2Object.target_score4 = obj.find("#eva_evaluation_achievement_process2_target_score4_" + i).val(); -//eva_evaluation_achievement_process2Object.target_score5 = obj.find("#eva_evaluation_achievement_process2_target_score5_" + i).val(); + eva_evaluation_achievement_process2Object.score = obj.find("#eva_evaluation_achievement_process2_score_" + i).text(); + eva_evaluation_achievement_process2Object.score2 = obj.find("#eva_evaluation_achievement_process2_score2_" + i).val(); + eva_evaluation_achievement_process2Object.sumary2 = obj.find("#eva_evaluation_achievement_process2_sumary2_" + i).text(); + //eva_evaluation_achievement_process2Object.target_score1 = obj.find("#eva_evaluation_achievement_process2_target_score1_" + i).val(); + //eva_evaluation_achievement_process2Object.target_score2 = obj.find("#eva_evaluation_achievement_process2_target_score2_" + i).val(); + //eva_evaluation_achievement_process2Object.target_score3 = obj.find("#eva_evaluation_achievement_process2_target_score3_" + i).val(); + //eva_evaluation_achievement_process2Object.target_score4 = obj.find("#eva_evaluation_achievement_process2_target_score4_" + i).val(); + //eva_evaluation_achievement_process2Object.target_score5 = obj.find("#eva_evaluation_achievement_process2_target_score5_" + i).val(); + + eva_evaluation_achievement_process2Object.who_update = the_role_code; eva_evaluation_achievement_process2Object.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_achievement_process2").val(); return eva_evaluation_achievement_process2Object; @@ -69,16 +87,16 @@ function eva_evaluation_achievement_process2_Save(id) { endLoad(); }; startLoad(); -console.log(eva_evaluation_achievement_process2); +//console.log(eva_evaluation_achievement_process2); AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process2/UpdateMultiple', eva_evaluation_achievement_process2, successFunc, AlertDanger); } -function eva_evaluation_achievement_process2_Get(a, blankItem) { +function eva_evaluation_achievement_process2_Get(a, blankItem, role_code) { $('#eva_evaluation_achievement_process2Body').empty(); var successFunc = function (response) { - console.log(response); + //console.log(response); $.each(response, function (i, data) { var tag = ''; tag += ''; @@ -91,11 +109,11 @@ function eva_evaluation_achievement_process2_Get(a, blankItem) { //tag += ''; tag += '

'; tag += '

'; - tag += ''; + tag += ''; tag += '

'; tag += ''; $('#eva_evaluation_achievement_process2Body').append($(tag)); - eva_evaluation_achievement_process2_FeedDataToForm(data, (i + 1), blankItem); + eva_evaluation_achievement_process2_FeedDataToForm(data, (i + 1), blankItem, role_code); }); eva_evaluation_achievement_process2_Summary(); Oneva_evaluation_achievement_process2_scoreChange(); @@ -162,9 +180,9 @@ function eva_evaluation_achievement_process2_Summary() { $("#score_label").text("ผลรวม: " + sum); } -function eva_evaluation_achievement_process2_InitialForm(id) { +function eva_evaluation_achievement_process2_InitialForm(id, role_code) { var successFunc = function (result) { - eva_evaluation_achievement_process2_Get(id, result); + eva_evaluation_achievement_process2_Get(id, result, role_code); endLoad(); }; startLoad(); diff --git a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js index 82281ea..720c8f2 100644 --- a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js +++ b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js @@ -1,57 +1,72 @@ function eva_evaluation_behavior_process2_ClearForm(i, blankItem) { var data = blankItem; -$("#eva_evaluation_behavior_process2_id_" + i).val(""); -$("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(""); -$("#eva_evaluation_behavior_process2_behavior_" + i).text(""); -$("#eva_evaluation_behavior_process2_weight_" + i).val(""); -$("#eva_evaluation_behavior_process2_score_" + i).text(""); -$("#eva_evaluation_behavior_process2_score2_" + i).val(""); -$("#eva_evaluation_behavior_process2_sumary2_" + i).text(""); -//$("#eva_evaluation_behavior_process2_target_score1_" + i).val(""); -//$("#eva_evaluation_behavior_process2_target_score2_" + i).val(""); -//$("#eva_evaluation_behavior_process2_target_score3_" + i).val(""); -//$("#eva_evaluation_behavior_process2_target_score4_" + i).val(""); -//$("#eva_evaluation_behavior_process2_target_score5_" + i).val(""); - + $("#eva_evaluation_behavior_process2_id_" + i).val(""); + $("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(""); + $("#eva_evaluation_behavior_process2_behavior_" + i).text(""); + $("#eva_evaluation_behavior_process2_weight_" + i).val(""); + $("#eva_evaluation_behavior_process2_score_" + i).text(""); + $("#eva_evaluation_behavior_process2_score2_" + i).val(""); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(""); + //$("#eva_evaluation_behavior_process2_target_score1_" + i).val(""); + //$("#eva_evaluation_behavior_process2_target_score2_" + i).val(""); + //$("#eva_evaluation_behavior_process2_target_score3_" + i).val(""); + //$("#eva_evaluation_behavior_process2_target_score4_" + i).val(""); + //$("#eva_evaluation_behavior_process2_target_score5_" + i).val(""); } -function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem) { -$("#eva_evaluation_behavior_process2_id_" + i).val(data.id); -$("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id); -$("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior); -$("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight); -$("#eva_evaluation_behavior_process2_score_" + i).text(data.score); -$("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary); -$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2); -$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2); -//$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1); -//$("#eva_evaluation_behavior_process2_target_score2_" + i).val(data.target_score2); -//$("#eva_evaluation_behavior_process2_target_score3_" + i).val(data.target_score3); -//$("#eva_evaluation_behavior_process2_target_score4_" + i).val(data.target_score4); -//$("#eva_evaluation_behavior_process2_target_score5_" + i).val(data.target_score5); +function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem, role_code) { + $("#eva_evaluation_behavior_process2_id_" + i).val(data.id); + $("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id); + $("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior); + $("#eva_evaluation_behavior_process2_weight_" + i).val(data.weight); + + if(role_code === "2"){ + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2); + } + else if(role_code === "3"){ + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score2); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary2); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score3); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary3); + } + else if(role_code === "4"){ + $("#eva_evaluation_behavior_process2_score_" + i).text(data.score3); + $("#eva_evaluation_behavior_process2_sumary_" + i).text(data.sumary3); + $("#eva_evaluation_behavior_process2_score2_" + i).val(data.score4); + $("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary4); + } + + //$("#eva_evaluation_behavior_process2_target_score1_" + i).val(data.target_score1); + //$("#eva_evaluation_behavior_process2_target_score2_" + i).val(data.target_score2); + //$("#eva_evaluation_behavior_process2_target_score3_" + i).val(data.target_score3); + //$("#eva_evaluation_behavior_process2_target_score4_" + i).val(data.target_score4); + //$("#eva_evaluation_behavior_process2_target_score5_" + i).val(data.target_score5); } function eva_evaluation_behavior_process2_GetFromForm(obj, i) { var eva_evaluation_behavior_process2Object = new Object(); -eva_evaluation_behavior_process2Object.id = obj.find("#eva_evaluation_behavior_process2_id_" + i).val(); -eva_evaluation_behavior_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(); -eva_evaluation_behavior_process2Object.behavior = obj.find("#eva_evaluation_behavior_process2_behavior_" + i).text(); -eva_evaluation_behavior_process2Object.weight = obj.find("#eva_evaluation_behavior_process2_weight_" + i).val(); -eva_evaluation_behavior_process2Object.score = obj.find("#eva_evaluation_behavior_process2_score_" + i).text(); -eva_evaluation_behavior_process2Object.sumary = obj.find("#eva_evaluation_behavior_process2_sumary_" + i).text(); -eva_evaluation_behavior_process2Object.score2 = obj.find("#eva_evaluation_behavior_process2_score2_" + i).val(); -eva_evaluation_behavior_process2Object.sumary2 = obj.find("#eva_evaluation_behavior_process2_sumary2_" + i).text(); -//eva_evaluation_behavior_process2Object.target_score1 = obj.find("#eva_evaluation_behavior_process2_target_score1_" + i).val(); -//eva_evaluation_behavior_process2Object.target_score2 = obj.find("#eva_evaluation_behavior_process2_target_score2_" + i).val(); -//eva_evaluation_behavior_process2Object.target_score3 = obj.find("#eva_evaluation_behavior_process2_target_score3_" + i).val(); -//eva_evaluation_behavior_process2Object.target_score4 = obj.find("#eva_evaluation_behavior_process2_target_score4_" + i).val(); -//eva_evaluation_behavior_process2Object.target_score5 = obj.find("#eva_evaluation_behavior_process2_target_score5_" + i).val(); + eva_evaluation_behavior_process2Object.id = obj.find("#eva_evaluation_behavior_process2_id_" + i).val(); + eva_evaluation_behavior_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(); + eva_evaluation_behavior_process2Object.behavior = obj.find("#eva_evaluation_behavior_process2_behavior_" + i).text(); + eva_evaluation_behavior_process2Object.weight = obj.find("#eva_evaluation_behavior_process2_weight_" + i).val(); + eva_evaluation_behavior_process2Object.score = obj.find("#eva_evaluation_behavior_process2_score_" + i).text(); + eva_evaluation_behavior_process2Object.sumary = obj.find("#eva_evaluation_behavior_process2_sumary_" + i).text(); + eva_evaluation_behavior_process2Object.score2 = obj.find("#eva_evaluation_behavior_process2_score2_" + i).val(); + eva_evaluation_behavior_process2Object.sumary2 = obj.find("#eva_evaluation_behavior_process2_sumary2_" + i).text(); + //eva_evaluation_behavior_process2Object.target_score1 = obj.find("#eva_evaluation_behavior_process2_target_score1_" + i).val(); + //eva_evaluation_behavior_process2Object.target_score2 = obj.find("#eva_evaluation_behavior_process2_target_score2_" + i).val(); + //eva_evaluation_behavior_process2Object.target_score3 = obj.find("#eva_evaluation_behavior_process2_target_score3_" + i).val(); + //eva_evaluation_behavior_process2Object.target_score4 = obj.find("#eva_evaluation_behavior_process2_target_score4_" + i).val(); + //eva_evaluation_behavior_process2Object.target_score5 = obj.find("#eva_evaluation_behavior_process2_target_score5_" + i).val(); + + eva_evaluation_behavior_process2Object.who_update = the_role_code; eva_evaluation_behavior_process2Object.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior_process2").val(); -console.log(eva_evaluation_behavior_process2Object); - return eva_evaluation_behavior_process2Object; } @@ -78,12 +93,12 @@ function eva_evaluation_behavior_process2_Save(id) { AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger); } -function eva_evaluation_behavior_process2_Get(a, blankItem) { +function eva_evaluation_behavior_process2_Get(a, blankItem, role_code) { $('#eva_evaluation_behavior_process2Body').empty(); var successFunc = function (response) { - console.log(response); + //console.log(response); $.each(response, function (i, data) { var tag = ''; tag += ''; @@ -102,7 +117,7 @@ tag += '