ปรับปรุงให้รองรับ การไปช่วยปฏิบัติงาน

This commit is contained in:
Nakorn Rientrakrunchai
2021-03-11 08:03:52 +07:00
parent b5e24a048d
commit 1540543f1f
17 changed files with 1066 additions and 446 deletions

View File

@@ -0,0 +1,930 @@
// <auto-generated />
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("25640311001105_UpdateLimitFrame")]
partial class UpdateLimitFrame
{
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<int>("id");
b.Property<string>("command_no")
.HasMaxLength(4000);
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<DateTime?>("imported_date");
b.Property<string>("imported_file")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("limit");
b.Property<decimal?>("limit_frame");
b.Property<decimal?>("limit_frame_quota");
b.Property<decimal?>("limit_quota");
b.Property<int?>("managed_by");
b.Property<decimal?>("percentage");
b.Property<string>("report_type")
.HasMaxLength(1000);
b.Property<DateTime?>("theDate");
b.Property<int?>("theRound");
b.Property<DateTime>("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<int>("id");
b.Property<int?>("adjust_postponement_id");
b.Property<int?>("adjust_postponement_quota_id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("middle");
b.Property<string>("migration_eva_result")
.HasMaxLength(1000);
b.Property<decimal?>("migration_total_score");
b.Property<decimal?>("new_cost_living");
b.Property<decimal?>("new_sarary");
b.Property<decimal?>("new_sarary_with_quota");
b.Property<int?>("order_at_this_time");
b.Property<int?>("org_at_this_time");
b.Property<decimal?>("other_money_at_this_time");
b.Property<decimal?>("position_allowance_at_this_time");
b.Property<string>("position_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("promoted_percentage");
b.Property<decimal?>("receive_quota");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<decimal?>("sarary");
b.Property<decimal?>("total_promote");
b.Property<DateTime>("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<int>("id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<Guid?>("performance_plan_id");
b.Property<decimal?>("score1");
b.Property<decimal?>("score2");
b.Property<int?>("supervisor1_id");
b.Property<int?>("supervisor2_id");
b.Property<DateTime>("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<int>("id");
b.Property<decimal?>("Final_summary_chief");
b.Property<decimal?>("Final_summary_competency_chief");
b.Property<decimal?>("Final_summary_competency_supervisor");
b.Property<decimal?>("Final_summary_competency_supervisor1A");
b.Property<decimal?>("Final_summary_competency_supervisor2A");
b.Property<decimal?>("Final_summary_supervisor");
b.Property<decimal?>("Final_summary_supervisor1A");
b.Property<decimal?>("Final_summary_supervisor2A");
b.Property<decimal?>("achievement_chief");
b.Property<decimal?>("achievement_supervisor");
b.Property<decimal?>("achievement_supervisor1A");
b.Property<decimal?>("achievement_supervisor2A");
b.Property<int?>("chief");
b.Property<int?>("chief_a");
b.Property<DateTime?>("chief_a_date");
b.Property<string>("chief_a_reject_reason")
.HasMaxLength(1000);
b.Property<string>("chief_a_remark")
.HasMaxLength(1000);
b.Property<string>("chief_a_result")
.HasMaxLength(1);
b.Property<decimal?>("competency_chief");
b.Property<decimal?>("competency_supervisor");
b.Property<decimal?>("competency_supervisor1A");
b.Property<decimal?>("competency_supervisor2A");
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_score_chief")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor1A")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor2A")
.HasMaxLength(255);
b.Property<decimal?>("score_chief");
b.Property<decimal?>("score_supervisor");
b.Property<decimal?>("score_supervisor1A");
b.Property<decimal?>("score_supervisor2A");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<string>("status_chief_a")
.HasMaxLength(1);
b.Property<DateTime?>("status_chief_a_click_date");
b.Property<DateTime?>("status_chief_click_date");
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<string>("status_self_a")
.HasMaxLength(1);
b.Property<DateTime?>("status_self_a_click_date");
b.Property<DateTime?>("status_self_click_date");
b.Property<string>("status_supervisor")
.HasMaxLength(1);
b.Property<string>("status_supervisor1A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor1A_click_date");
b.Property<string>("status_supervisor2A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor2A_click_date");
b.Property<DateTime?>("status_supervisor_click_date");
b.Property<int?>("supervisor1");
b.Property<int?>("supervisor1A");
b.Property<DateTime?>("supervisor1A_date");
b.Property<string>("supervisor1A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor1_date");
b.Property<string>("supervisor1_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1_result")
.HasMaxLength(1);
b.Property<int?>("supervisor2");
b.Property<int?>("supervisor2A");
b.Property<DateTime?>("supervisor2A_date");
b.Property<string>("supervisor2A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor2_date");
b.Property<string>("supervisor2_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2_result")
.HasMaxLength(1);
b.Property<decimal?>("total_summary_chief");
b.Property<decimal?>("total_summary_competency_chief");
b.Property<decimal?>("total_summary_competency_supervisor");
b.Property<decimal?>("total_summary_competency_supervisor1A");
b.Property<decimal?>("total_summary_competency_supervisor2A");
b.Property<decimal?>("total_summary_supervisor");
b.Property<decimal?>("total_summary_supervisor1A");
b.Property<decimal?>("total_summary_supervisor2A");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_create_evaluation_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.Property<int>("id");
b.Property<string>("achievement")
.HasMaxLength(3000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<string>("thefile")
.HasMaxLength(1000);
b.Property<DateTime>("updated");
b.Property<decimal?>("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<int>("id");
b.Property<string>("behavior")
.HasMaxLength(1000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.Property<decimal?>("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<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<int?>("main_dept_id");
b.Property<decimal?>("percentage");
b.Property<string>("thegroup")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_evaluation_group");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("evaluation_group_id");
b.ToTable("eva_evaluation_group_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("indicators")
.HasMaxLength(4000);
b.Property<bool>("isActive");
b.Property<string>("mission_detail")
.HasMaxLength(4000);
b.Property<int?>("mission_no");
b.Property<string>("target")
.HasMaxLength(4000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_operating_agreement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("develop")
.HasMaxLength(1000);
b.Property<string>("development_method")
.HasMaxLength(1000);
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<string>("period_text")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_idp_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_level_score");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
{
b.Property<Guid>("id");
b.Property<decimal?>("cost_of_living");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("frame_group_guid");
b.Property<int?>("help_org_id");
b.Property<bool>("isActive");
b.Property<string>("level_text")
.HasMaxLength(1000);
b.Property<decimal?>("monthly_remuneration");
b.Property<int?>("order_of_data");
b.Property<int?>("org_id");
b.Property<decimal?>("position_allowance");
b.Property<string>("position_text")
.HasMaxLength(1000);
b.Property<decimal?>("salary");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("frame_group_guid");
b.ToTable("eva_limit_frame_employee");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
{
b.Property<Guid>("id");
b.Property<DateTime>("created");
b.Property<Guid?>("frame_plan_guid");
b.Property<Guid?>("group_guid");
b.Property<bool>("isActive");
b.Property<decimal?>("limit_frame_295");
b.Property<int?>("main_dept_id");
b.Property<string>("remark")
.HasMaxLength(4000);
b.Property<decimal?>("total_salary");
b.Property<decimal?>("total_salary_limit");
b.Property<decimal?>("total_salary_limit_rounded");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("frame_plan_guid");
b.HasIndex("group_guid");
b.ToTable("eva_limit_frame_group");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
{
b.Property<Guid>("id");
b.Property<DateTime>("created");
b.Property<DateTime?>("executed_date");
b.Property<bool>("isActive");
b.Property<decimal?>("limit_frame_005");
b.Property<decimal?>("limit_frame_005_total");
b.Property<decimal?>("limit_frame_005_total_rounded");
b.Property<Guid?>("plan_guid");
b.Property<DateTime?>("salary_adjustment_date");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<int?>("supervisor1");
b.Property<DateTime?>("supervisor1_date");
b.Property<string>("supervisor1_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1_result")
.HasMaxLength(1);
b.Property<decimal?>("total_salary");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("plan_guid");
b.ToTable("eva_limit_frame_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<bool>("isActive");
b.Property<int?>("theTime");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_performance_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<int?>("list_no");
b.Property<Guid?>("performance_plan_id");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<string>("step")
.HasMaxLength(1000);
b.Property<DateTime>("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<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<Guid?>("level_score_id");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<decimal?>("promoted_percentage");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("level_score_id");
b.ToTable("eva_promoted_percentage");
});
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
{
b.Property<int>("id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("middle");
b.Property<int?>("position_level");
b.Property<int?>("position_type");
b.Property<decimal?>("temporary_min");
b.Property<decimal?>("themax");
b.Property<decimal?>("themin");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_salary_cylinder");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
.WithMany()
.HasForeignKey("create_evaluation_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
.WithMany()
.HasForeignKey("adjust_postponement_id");
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
.WithMany()
.HasForeignKey("adjust_postponement_quota_id")
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid")
.WithMany()
.HasForeignKey("frame_group_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_limit_frame_planEntity", "eva_limit_frame_plan_frame_plan_guid")
.WithMany()
.HasForeignKey("frame_plan_guid");
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid")
.WithMany()
.HasForeignKey("group_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan_plan_guid")
.WithMany()
.HasForeignKey("plan_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
.WithMany()
.HasForeignKey("level_score_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class UpdateLimitFrame : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "main_dept_id",
table: "eva_limit_frame_group",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "main_dept_id",
table: "eva_limit_frame_group");
}
}
}

View File

@@ -644,6 +644,8 @@ namespace tb320eva.Migrations
b.Property<decimal?>("limit_frame_295"); b.Property<decimal?>("limit_frame_295");
b.Property<int?>("main_dept_id");
b.Property<string>("remark") b.Property<string>("remark")
.HasMaxLength(4000); .HasMaxLength(4000);

View File

@@ -35,8 +35,8 @@ namespace TodoAPI2.Models
[MaxLength(4000)] [MaxLength(4000)]
public string remark { get; set; } public string remark { get; set; }
public int? main_dept_id { get; set; }
public void SetAutoField(DataContext context) public void SetAutoField(DataContext context)
{ {
} }

View File

@@ -31,5 +31,12 @@ namespace TodoAPI2.Models
public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; } public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; }
public string group_guid_eva_evaluation_group_code { get; set; } public string group_guid_eva_evaluation_group_code { get; set; }
public string remark_formatted {
get
{
if (remark == null) remark = "";
return remark.Replace("\n", "<br/>");
}
}
} }
} }

View File

@@ -22,6 +22,7 @@ namespace TodoAPI2.Models
List<external_menu> GetMenuByUser(int? userid); List<external_menu> GetMenuByUser(int? userid);
List<external_user> GetAllUser(); List<external_user> GetAllUser();
List<dept_mappingViewModel> GetDeptMapping(); List<dept_mappingViewModel> GetDeptMapping();
List<working_records> GetWorkingRecord();
} }
} }

View File

@@ -643,6 +643,41 @@ else orgdata.department_code::int*100000 end
} }
return result; return result;
} }
public List<working_records> GetWorkingRecord()
{
var sql = string.Format(@"
select * FROM hrm_working_records where deleted_at is null
", '"'.ToString());
var para = db.GetParameterListNpgsql();
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
var result = new List<working_records>();
foreach (DataRow dr in dt.Rows)
{
var i = new working_records();
if (dr["id"] != DBNull.Value) i.id = Convert.ToInt32(dr["id"]);
if (dr["employee_id"] != DBNull.Value) i.employee_id = Convert.ToInt32(dr["employee_id"]);
if (dr["place"] != DBNull.Value) i.place = Convert.ToInt32(dr["place"]);
if (dr["start_date"] != DBNull.Value) i.start_date = Convert.ToDateTime(dr["start_date"]);
if (dr["end_date"] != DBNull.Value) i.end_date = Convert.ToDateTime(dr["end_date"]);
if (dr["subject"] != DBNull.Value) i.subject = dr["subject"].ToString();
if (dr["detail"] != DBNull.Value) i.detail = dr["detail"].ToString();
result.Add(i);
}
return result;
}
}
public class working_records
{
public int? id { get; set; }
public int? employee_id { get; set; }
public int? place { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { get; set; }
public string subject { get; set; }
public string detail { get; set; }
} }
public class external_menu public class external_menu

View File

@@ -150,6 +150,16 @@ namespace TodoAPI2.Models
entity.id = Guid.NewGuid(); entity.id = Guid.NewGuid();
entity.limit_frame_005 = (decimal?)0.05; entity.limit_frame_005 = (decimal?)0.05;
var all_all_emp = emp.GetAllEmployee();
var mapping_dept = emp.GetDeptMapping();
var working_record = from i in emp.GetWorkingRecord() where
model.executed_date.HasValue
&& i.start_date <= model.executed_date
&& i.end_date >= model.executed_date
select i;
var result_frame_group = new List<eva_limit_frame_groupEntity>();
var result_frame_employee = new List<eva_limit_frame_employeeEntity>();
var all_group = (from i in _repository.Context.eva_evaluation_group var all_group = (from i in _repository.Context.eva_evaluation_group
select i); select i);
foreach (var x in all_group) foreach (var x in all_group)
@@ -172,7 +182,9 @@ namespace TodoAPI2.Models
new_frame_group.total_salary = all_emp.Sum(z => z.salary); new_frame_group.total_salary = all_emp.Sum(z => z.salary);
new_frame_group.total_salary_limit = (new_frame_group.total_salary * new_frame_group.limit_frame_295 / 100); new_frame_group.total_salary_limit = (new_frame_group.total_salary * new_frame_group.limit_frame_295 / 100);
new_frame_group.total_salary_limit_rounded = MyHelper.RoundOff(new_frame_group.total_salary_limit.Value, 10); new_frame_group.total_salary_limit_rounded = MyHelper.RoundOff(new_frame_group.total_salary_limit.Value, 10);
_repository.Context.Add(new_frame_group); new_frame_group.main_dept_id = x.main_dept_id;
//_repository.Context.Add(new_frame_group);
result_frame_group.Add(new_frame_group);
int i = 1; int i = 1;
foreach (var y in all_emp) foreach (var y in all_emp)
@@ -190,10 +202,60 @@ namespace TodoAPI2.Models
new_emp.cost_of_living = y.cost_of_living; new_emp.cost_of_living = y.cost_of_living;
new_emp.order_of_data = i; new_emp.order_of_data = i;
i++; i++;
_repository.Context.Add(new_emp); //_repository.Context.Add(new_emp);
result_frame_employee.Add(new_emp);
} }
} }
var help_other_org = from i in result_frame_employee
where
(from j in working_record select j.employee_id).Contains(i.employee_id)
select i;
foreach(var em in help_other_org)
{
var w = (from i in working_record where i.employee_id == em.employee_id select i).FirstOrDefault();
if(w != null)
{
int? main_dept = (from i in mapping_dept where i.id == w.place select i.id2.HasValue?i.id2:i.id).FirstOrDefault();
var s = (from i in result_frame_group where i.main_dept_id == main_dept select i).FirstOrDefault();
if(s != null)
{
em.help_org_id = main_dept;
em.frame_group_guid = s.id;
em.order_of_data += 1000;
}
}
}
foreach(var x in result_frame_group)
{
x.remark = "";
int i = 1;
int j = 1;
foreach(var y in from z in result_frame_employee where z.frame_group_guid==x.id orderby z.order_of_data select z)
{
y.order_of_data = i;
i++;
if (y.help_org_id.HasValue)
{
var theemp = (from q in all_all_emp where q.id == y.employee_id select q).FirstOrDefault();
var thedetail = (from r in working_record where r.employee_id == y.employee_id select r).FirstOrDefault();
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
if(theemp != null && thedetail != null && help_at != null)
{
if (x.remark != "") x.remark += "\n";
x.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
}
j++;
}
}
}
_repository.Context.AddRange(result_frame_group);
_repository.Context.AddRange(result_frame_employee);
entity.SetAutoField(_repository.Context); entity.SetAutoField(_repository.Context);
if (is_force_save) if (is_force_save)

View File

@@ -1,70 +0,0 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewData["Title"] = "eva_limit_frame_plan";
}
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>จัดการ eva_limit_frame_plan</div>
<div class="tools">
<div class="row">
<div class="col-md-12">
<button type="button" class="btn btn-submit" onclick="javascript:eva_limit_frame_plan_Add()">
<i class="fa fa-plus"></i> เพิ่มรายการ
</button>
</div>
</div>
</div>
<table id="eva_limit_frame_planTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>ลำดับ</th>
<th><label id='h_eva_limit_frame_plan_plan_guid'>แผนการประเมิน</label></th>
<th><label id='h_eva_limit_frame_plan_executed_date'>วันที่ตั้งกรอบวงเงิน</label></th>
<th><label id='h_eva_limit_frame_plan_limit_frame_005'>กรอบวงเงินที่กันไว้</label></th>
<th><label id='h_eva_limit_frame_plan_supervisor1_result'>ผลการตรวจ</label></th>
<th><label id='h_eva_limit_frame_plan_supervisor1_remark'>ความเห็นผู้ประเมิน</label></th>
<th><label id='h_eva_limit_frame_plan_supervisor1_date'>วันที่ประเมิน</label></th>
<th><label id='h_eva_limit_frame_plan_salary_adjustment_date'>เลื่อนเงินเดือนวันที่</label></th>
<th><label id='h_eva_limit_frame_plan_limit_frame_005_total'>กันวงเงินไว้</label></th>
<th><label id='h_eva_limit_frame_plan_limit_frame_005_total_rounded'>กันวงเงินใช้จริง</label></th>
<th>กิจกรรม</th>
</tr>
</thead>
<tbody class="thin-border-bottom" id="eva_limit_frame_planBody"></tbody>
</table>
<div class="tools">
<div class="row">
<div class="col-md-12">
<button type="button" class="btn btn-outline" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-submit" onclick="javascript:eva_limit_frame_plan_Save(getUrlParameter('id'))">บันทึก</button>
</div>
</div>
</div>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_limit_frame_plan/eva_limit_frame_plan_inline.js"></script>
<script>
$(document).ready(function () {
//var id = getUrlParameter("id");
//if (id) {
// eva_limit_frame_plan_InitialForm(id);
//}
eva_limit_frame_plan_InitialForm('');
});
$(document).on("change", ".input_score", function () {
eva_limit_frame_plan_Summary();
});
</script>
}

View File

@@ -1,55 +0,0 @@
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@{
ViewData["Title"] = "eva_limit_frame_plan";
}
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@Configuration["SiteInformation:modulename"]
</div>
</div>
<div class="col-md-7">
<ol class="breadcrumb" style="">
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:mainsite"]');">หน้าแรก</a></li>
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:modulesite"]');">@Configuration["SiteInformation:modulename"]</a></li>
<li class="breadcrumb-item active">รายงาน eva_limit_frame_plan</li>
</ol>
</div>
</div>
<section class="wrapper">
<div class="title"><div class="line"></div>รายงาน eva_limit_frame_plan</div>
<div class="tools">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group col-md-3">
<label id='lab_s_eva_limit_frame_plan_executed_date' for='s_eva_limit_frame_plan_executed_date'>วันที่ตั้งกรอบวงเงิน</label>
<input class="form-control" type="text" id="s_eva_limit_frame_plan_executed_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่ตั้งกรอบวงเงิน" iRequire="true" iGroup="s_eva_limit_frame_plan" title='วันที่ตั้งกรอบวงเงิน' placeholder='วันที่ตั้งกรอบวงเงิน' />
</div>
</div>
</div>
<div class="col-md-12">
<button class="btn btn-info" onclick="javascript:eva_limit_frame_plan_DoSearch('pdf');">แสดงรายงาน</button>
<button class="btn btn-info" onclick="javascript:eva_limit_frame_plan_DoSearch('xlsx');">ดาวน์โหลดเป็น Excel</button>
</div>
</div>
</div>
</section>
<br/>
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
@section FooterPlaceHolder{
<script src="~/js/eva_limit_frame_plan/eva_limit_frame_plan_report.js"></script>
<script>
$(document).ready(function () {
eva_limit_frame_plan_InitialForm();
SetupValidationRemark("s_eva_limit_frame_plan");
});
</script>
}

View File

@@ -1,92 +0,0 @@
<input class="inpt-control" type="hidden" id="eva_limit_frame_plan_id" />
<input class="inpt-control" type="hidden" id="eva_limit_frame_plan_status_self" />
<input class="inpt-control" type="hidden" id="eva_limit_frame_plan_status_chief" />
<input class="inpt-control" type="hidden" id="eva_limit_frame_plan_supervisor1" />
<div class='row'></div>
<div class='row'>
<div class="col-md-8">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_plan_guid" for="eva_limit_frame_plan_plan_guid">แผนการประเมิน</label>
<div class="inpt-group">
<select class="inpt-control" id="eva_limit_frame_plan_plan_guid" iLabel="แผนการประเมิน" iRequire="true" iGroup="eva_limit_frame_plan" ></select>
</div>
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_executed_date" for="eva_limit_frame_plan_executed_date">วันที่ตั้งกรอบวงเงิน</label>
<div class="inpt-group">
<input class="inpt-control" type="text" id="eva_limit_frame_plan_executed_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่ตั้งกรอบวงเงิน" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_limit_frame_005" for="eva_limit_frame_plan_limit_frame_005">กรอบวงเงินที่กันไว้</label>
<div class="inpt-group">
<input class="inpt-control" type="number" id="eva_limit_frame_plan_limit_frame_005" iLabel="กรอบวงเงินที่กันไว้" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_supervisor1_result" for="eva_limit_frame_plan_supervisor1_result">ผลการตรวจ</label>
<div class="inpt-group">
<select class="inpt-control" id="eva_limit_frame_plan_supervisor1_result" iLabel="ผลการตรวจ" iRequire="true" iGroup="eva_limit_frame_plan" ></select>
</div>
</div>
</div>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_supervisor1_date" for="eva_limit_frame_plan_supervisor1_date">วันที่ประเมิน</label>
<div class="inpt-group">
<input class="inpt-control" type="text" id="eva_limit_frame_plan_supervisor1_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่ประเมิน" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
</div>
<div class='row'>
<div class="col-md-12">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_supervisor1_remark" for="eva_limit_frame_plan_supervisor1_remark">ความเห็นผู้ประเมิน</label>
<div class="inpt-group">
<textarea class="inpt-control" rows="4" cols="50" id="eva_limit_frame_plan_supervisor1_remark" iLabel="ความเห็นผู้ประเมิน" iRequire="true" iGroup="eva_limit_frame_plan" ></textarea>
</div>
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_salary_adjustment_date" for="eva_limit_frame_plan_salary_adjustment_date">เลื่อนเงินเดือนวันที่</label>
<div class="inpt-group">
<input class="inpt-control" type="text" id="eva_limit_frame_plan_salary_adjustment_date" data-provide="datepicker" data-date-language="th-th" iLabel="เลื่อนเงินเดือนวันที่" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_limit_frame_005_total" for="eva_limit_frame_plan_limit_frame_005_total">กันวงเงินไว้</label>
<div class="inpt-group">
<input class="inpt-control" type="number" id="eva_limit_frame_plan_limit_frame_005_total" iLabel="กันวงเงินไว้" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
<div class="col-md-4">
<div class="inpt-form-group">
<label id="lab_eva_limit_frame_plan_limit_frame_005_total_rounded" for="eva_limit_frame_plan_limit_frame_005_total_rounded">กันวงเงินใช้จริง</label>
<div class="inpt-group">
<input class="inpt-control" type="number" id="eva_limit_frame_plan_limit_frame_005_total_rounded" iLabel="กันวงเงินใช้จริง" iRequire="true" iGroup="eva_limit_frame_plan" />
</div>
</div>
</div>
</div>

View File

@@ -126,7 +126,7 @@
<th><label id='h_eva_limit_frame_group_total_salary'>อัตราเงินเดือนรวม</label></th> <th><label id='h_eva_limit_frame_group_total_salary'>อัตราเงินเดือนรวม</label></th>
<th><label id='h_eva_limit_frame_group_total_salary_limit'>วงเงินในการเลื่อนเงินเดือน</label></th> <th><label id='h_eva_limit_frame_group_total_salary_limit'>วงเงินในการเลื่อนเงินเดือน</label></th>
<th><label id='h_eva_limit_frame_group_total_salary_limit_rounded'>วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง</label></th> <th><label id='h_eva_limit_frame_group_total_salary_limit_rounded'>วงเงินในการเลื่อนเงินเดือน ที่ใช้จริง</label></th>
<th><label id='h_eva_limit_frame_group_remark'>หมายเหตุ</label></th> <th width="40%"><label id='h_eva_limit_frame_group_remark'>หมายเหตุ</label></th>
</tr> </tr>
</thead> </thead>
<tbody></tbody> <tbody></tbody>

View File

@@ -74,9 +74,6 @@
<None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group_d.cshtml" /> <None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group_d.cshtml" />
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan.cshtml" /> <None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan.cshtml" />
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_d.cshtml" /> <None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_d.cshtml" />
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_inline.cshtml" />
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_report.cshtml" />
<None Include="Views\eva_limit_frame_planView\eva_limit_frame_plan_wizardform.cshtml" />
<None Include="Views\rep_eva_limit_frame_planView\rep_eva_limit_frame_plan_report.cshtml" /> <None Include="Views\rep_eva_limit_frame_planView\rep_eva_limit_frame_plan_report.cshtml" />
<None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan.cshtml" /> <None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan.cshtml" />
<None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan_d.cshtml" /> <None Include="Views\vw_limit_frame_planView\vw_limit_frame_plan_d.cshtml" />
@@ -90,8 +87,6 @@
<None Include="wwwroot\js\eva_limit_frame_employee\eva_limit_frame_employee.js" /> <None Include="wwwroot\js\eva_limit_frame_employee\eva_limit_frame_employee.js" />
<None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group.js" /> <None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group.js" />
<None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group_d.js" /> <None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group_d.js" />
<None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group_inline.js" />
<None Include="wwwroot\js\eva_limit_frame_group\eva_limit_frame_group_report.js" />
<None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan.js" /> <None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan.js" />
<None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan_d.js" /> <None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan_d.js" />
<None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan_inline.js" /> <None Include="wwwroot\js\eva_limit_frame_plan\eva_limit_frame_plan_inline.js" />

View File

@@ -208,7 +208,7 @@ var eva_limit_frame_employee_setupTable = function (result) {
"language": { "language": {
"url": appsite + "/DataTables-1.10.16/thai.json" "url": appsite + "/DataTables-1.10.16/thai.json"
}, },
"paging": true, "paging": false,
"searching": false, "searching": false,
"drawCallback": function (settings) { "drawCallback": function (settings) {
var api = this.api(); var api = this.api();

View File

@@ -173,7 +173,7 @@ var eva_limit_frame_group_setupTable = function (result) {
{ "data": "total_salary" }, { "data": "total_salary" },
{ "data": "total_salary_limit" }, { "data": "total_salary_limit" },
{ "data": "total_salary_limit_rounded" }, { "data": "total_salary_limit_rounded" },
{ "data": "remark" }, { "data": "remark_formatted" },
], ],
"columnDefs": [ "columnDefs": [
{ {

View File

@@ -1,157 +0,0 @@
function eva_limit_frame_group_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_limit_frame_group_id_" + i).val("");
$("#eva_limit_frame_group_frame_plan_guid_" + i).val("");
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid_" + i), blankItem, "id", "code", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295_" + i).val("");
$("#eva_limit_frame_group_total_salary_" + i).val("");
$("#eva_limit_frame_group_total_salary_limit_" + i).val("");
$("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val("");
$("#eva_limit_frame_group_remark_" + i).val("");
}
function eva_limit_frame_group_FeedDataToForm(data, i, blankItem) {
$("#eva_limit_frame_group_id_" + i).val(data.id);
$("#eva_limit_frame_group_frame_plan_guid_" + i).val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#eva_limit_frame_group_group_guid_" + i), blankItem, "id", "code", "item_group_guid", data.group_guid);
$("#eva_limit_frame_group_limit_frame_295_" + i).val(data.limit_frame_295);
$("#eva_limit_frame_group_total_salary_" + i).val(data.total_salary);
$("#eva_limit_frame_group_total_salary_limit_" + i).val(data.total_salary_limit);
$("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val(data.total_salary_limit_rounded);
$("#eva_limit_frame_group_remark_" + i).val(data.remark);
}
function eva_limit_frame_group_GetFromForm(obj, i) {
var eva_limit_frame_groupObject = new Object();
eva_limit_frame_groupObject.id = obj.find("#eva_limit_frame_group_id_" + i).val();
eva_limit_frame_groupObject.frame_plan_guid = obj.find("#eva_limit_frame_group_frame_plan_guid_" + i).val();
eva_limit_frame_groupObject.group_guid = obj.find("#eva_limit_frame_group_group_guid_" + i).val();
eva_limit_frame_groupObject.limit_frame_295 = obj.find("#eva_limit_frame_group_limit_frame_295_" + i).val();
eva_limit_frame_groupObject.total_salary = obj.find("#eva_limit_frame_group_total_salary_" + i).val();
eva_limit_frame_groupObject.total_salary_limit = obj.find("#eva_limit_frame_group_total_salary_limit_" + i).val();
eva_limit_frame_groupObject.total_salary_limit_rounded = obj.find("#eva_limit_frame_group_total_salary_limit_rounded_" + i).val();
eva_limit_frame_groupObject.remark = obj.find("#eva_limit_frame_group_remark_" + i).val();
eva_limit_frame_groupObject.active_mode = obj.find("#isActive_" + i + "_eva_limit_frame_group").val();
return eva_limit_frame_groupObject;
}
function eva_limit_frame_group_GetAllData() {
//Insert eva_limit_frame_group List
var eva_limit_frame_group = [];
$('#eva_limit_frame_groupBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_limit_frame_group = eva_limit_frame_group_GetFromForm($(this), i);
eva_limit_frame_group.push(eacheva_limit_frame_group);
});
return eva_limit_frame_group;
}
function eva_limit_frame_group_Save(id) {
//Insert eva_limit_frame_group List
var eva_limit_frame_group = eva_limit_frame_group_GetAllData();
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_limit_frame_group/UpdateMultiple', eva_limit_frame_group, successFunc, AlertDanger);
}
function eva_limit_frame_group_Get(id, blankItem) {
$('#eva_limit_frame_groupBody').empty();
var successFunc = function (response) {
//console.log(response);
$.each(response, function (i, data) {
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_limit_frame_group" value="1" /><input class="form-control" type="hidden" id="eva_limit_frame_group_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_limit_frame_group_frame_plan_guid_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_limit_frame_group_group_guid_' + (i + 1) +'"></select></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_limit_frame_295_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit_rounded_' + (i + 1)+'" /></td>';
tag += '<td><textarea class="form-control" rows="2" cols="25" id="eva_limit_frame_group_remark_' + (i + 1)+'" ></textarea></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_limit_frame_group_Removeeva_limit_frame_group(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_limit_frame_group_Restoreeva_limit_frame_group(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_limit_frame_groupBody').append($(tag));
eva_limit_frame_group_FeedDataToForm(data, (i + 1), blankItem);
});
eva_limit_frame_group_Summary();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_group", successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_limit_frame_group/GetListByframe_plan_guid/' + a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_limit_frame_group/GetListBygroup_guid/' + a, successFunc, AlertDanger);
}
function eva_limit_frame_group_Add() {
var successFunc = function (result) {
var i = $("#eva_limit_frame_groupBody tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_limit_frame_group" value="1" /><input class="form-control" type="hidden" id="eva_limit_frame_group_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_limit_frame_group_frame_plan_guid_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_limit_frame_group_group_guid_' + (i + 1) +'"></select></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_limit_frame_295_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_limit_frame_group_total_salary_limit_rounded_' + (i + 1)+'" /></td>';
tag += '<td><textarea class="form-control" rows="2" cols="25" id="eva_limit_frame_group_remark_' + (i + 1)+'" ></textarea></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_limit_frame_group_Removeeva_limit_frame_group(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_limit_frame_group_Restoreeva_limit_frame_group(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_limit_frame_groupBody').append($(tag));
eva_limit_frame_group_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/" + "GetBlankItem", successFunc, AlertDanger);
}
function eva_limit_frame_group_Removeeva_limit_frame_group(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
eva_limit_frame_group_Summary();
}
}
function eva_limit_frame_group_Restoreeva_limit_frame_group(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
eva_limit_frame_group_Summary();
}
}
function eva_limit_frame_group_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_limit_frame_group_InitialForm(id) {
var successFunc = function (result) {
eva_limit_frame_group_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_limit_frame_group/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -1,60 +0,0 @@
var eva_limit_frame_group_API = "/api/eva_limit_frame_group/";
//================= Search Customizaiton =========================================
function eva_limit_frame_group_GetSearchParameter(fileType) {
var eva_limit_frame_groupSearchObject = new Object();
eva_limit_frame_groupSearchObject.frame_plan_guid = $("#s_eva_limit_frame_group_frame_plan_guid").val();
eva_limit_frame_groupSearchObject.group_guid = $("#s_eva_limit_frame_group_group_guid").val();
eva_limit_frame_groupSearchObject.fileType = fileType;
console.log(eva_limit_frame_groupSearchObject);
return eva_limit_frame_groupSearchObject;
}
function eva_limit_frame_group_FeedDataToSearchForm(data) {
$("#s_eva_limit_frame_group_frame_plan_guid").val(data.frame_plan_guid);
DropDownClearFormAndFeedWithData($("#s_eva_limit_frame_group_group_guid"), data, "id", "code", "item_group_guid", data.group_guid);
}
//================= Form Data Customizaiton =========================================
function eva_limit_frame_group_InitialForm(s) {
var successFunc = function (result) {
eva_limit_frame_group_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_limit_frame_group_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_eva_limit_frame_group_customValidation = function (group) {
return "";
};
function eva_limit_frame_group_DoSearch(fileType) {
if (!ValidateForm('s_eva_limit_frame_group', s_eva_limit_frame_group_customValidation)) {
return;
}
var p = $.param(eva_limit_frame_group_GetSearchParameter(fileType));
var report_url = apisite + "/api/eva_limit_frame_group/eva_limit_frame_group_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}