ปรับปรุงส่วน ตารางกำหนดช่วงร้อยละที่ได้เลื่อน

This commit is contained in:
nakorn
2021-10-30 11:53:07 +07:00
parent 8e8596116f
commit 7baab53365
15 changed files with 1539 additions and 171 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,153 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class AddLevelScoreForGroup2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
table: "eva_level_score_detail");
migrationBuilder.AlterColumn<Guid>(
name: "level_score_id",
table: "eva_level_score_detail",
nullable: true,
oldClrType: typeof(Guid));
migrationBuilder.AddColumn<Guid>(
name: "group_guid",
table: "eva_level_score_detail",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "behavior",
table: "eva_evaluation_behavior",
maxLength: 16000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 1000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "achievement",
table: "eva_evaluation_achievement",
maxLength: 16000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 8000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "properties",
table: "activity_log_eva",
maxLength: 32000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 8000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "description",
table: "activity_log_eva",
maxLength: 32000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 4000,
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_eva_level_score_detail_group_guid",
table: "eva_level_score_detail",
column: "group_guid");
migrationBuilder.AddForeignKey(
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
table: "eva_level_score_detail",
column: "group_guid",
principalTable: "eva_evaluation_group",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
table: "eva_level_score_detail",
column: "level_score_id",
principalTable: "eva_level_score",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
table: "eva_level_score_detail");
migrationBuilder.DropForeignKey(
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
table: "eva_level_score_detail");
migrationBuilder.DropIndex(
name: "IX_eva_level_score_detail_group_guid",
table: "eva_level_score_detail");
migrationBuilder.DropColumn(
name: "group_guid",
table: "eva_level_score_detail");
migrationBuilder.AlterColumn<Guid>(
name: "level_score_id",
table: "eva_level_score_detail",
nullable: false,
oldClrType: typeof(Guid),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "behavior",
table: "eva_evaluation_behavior",
maxLength: 1000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 16000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "achievement",
table: "eva_evaluation_achievement",
maxLength: 8000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 16000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "properties",
table: "activity_log_eva",
maxLength: 8000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 32000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "description",
table: "activity_log_eva",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 32000,
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
table: "eva_level_score_detail",
column: "level_score_id",
principalTable: "eva_level_score",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -729,9 +729,11 @@ namespace tb320eva.Migrations
b.Property<DateTime>("created");
b.Property<Guid?>("group_guid");
b.Property<bool>("isActive");
b.Property<Guid>("level_score_id");
b.Property<Guid?>("level_score_id");
b.Property<decimal?>("max_percentage");
@@ -745,6 +747,8 @@ namespace tb320eva.Migrations
b.HasKey("id");
b.HasIndex("group_guid");
b.HasIndex("level_score_id");
b.ToTable("eva_level_score_detail");
@@ -1106,10 +1110,13 @@ namespace tb320eva.Migrations
modelBuilder.Entity("TodoAPI2.Models.eva_level_score_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid")
.WithMany()
.HasForeignKey("group_guid");
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score_level_score_id")
.WithMany()
.HasForeignKey("level_score_id")
.OnDelete(DeleteBehavior.Cascade);
.HasForeignKey("level_score_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>

View File

@@ -105,22 +105,22 @@ namespace TodoAPI2.Models
private void ReloadPostponement(int? adjust_postponement_id)
{
var rawData = from i in _repository.Context.eva_adjust_postponement_detail
where i.adjust_postponement_id == adjust_postponement_id
select i;
where i.adjust_postponement_id == adjust_postponement_id
select i;
var baseScore = from i in _repository.Context.eva_adjust_postponement_detail
join j in _repository.Context.eva_adjust_postponement on i.adjust_postponement_id equals j.id
join k in _repository.Context.eva_create_evaluation on j.create_evaluation_id equals k.id
join m in _repository.Context.eva_create_evaluation_detail on k.id equals m.create_evaluation_id
where i.adjust_postponement_id == adjust_postponement_id
&& m.employee_id == i.employee_id
select m;
join j in _repository.Context.eva_adjust_postponement on i.adjust_postponement_id equals j.id
join k in _repository.Context.eva_create_evaluation on j.create_evaluation_id equals k.id
join m in _repository.Context.eva_create_evaluation_detail on k.id equals m.create_evaluation_id
where i.adjust_postponement_id == adjust_postponement_id
&& m.employee_id == i.employee_id
select m;
foreach(var x in rawData)
foreach (var x in rawData)
{
var y = (from i in baseScore
where i.employee_id == x.employee_id
select getData(i)).FirstOrDefault();
where i.employee_id == x.employee_id
select getData(i)).FirstOrDefault();
x.level_score_final = y.Item2;
x.score_final = y.Item1;
}
@@ -154,7 +154,7 @@ namespace TodoAPI2.Models
var item = (from i in level_detail
where i.min_value <= score && i.max_value >= score
select i).FirstOrDefault();
if(item != null)
if (item != null)
{
return (item.min_percentage, item.max_percentage);
}
@@ -163,8 +163,14 @@ namespace TodoAPI2.Models
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel model)
{
var theGroup = (from i in _repository.Context.eva_adjust_postponement
join j in _repository.Context.eva_create_evaluation on i.create_evaluation_id equals j.id
where i.id == model.adjust_postponement_id
select j.evaluation_group_id).FirstOrDefault();
var level_detail = (from i in _repository.Context.eva_level_score_detail
select i).ToList();
where i.group_guid == theGroup
select i).ToList();
var all_emp = emp.GetListByemployee_type(null, null);
@@ -174,10 +180,10 @@ namespace TodoAPI2.Models
into eva_adjust_postponementResult1
from fk_eva_adjust_postponementResult1 in eva_adjust_postponementResult1.DefaultIfEmpty()
//join create_detail in _repository.Context.eva_create_evaluation_detail
// on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
// into create_detailResult
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
//join create_detail in _repository.Context.eva_create_evaluation_detail
// on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
// into create_detailResult
//from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
join create_data in _repository.Context.eva_create_evaluation
on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_data.id

View File

@@ -18,7 +18,7 @@ namespace TodoAPI2.Models
[ForeignKey("level_score_id")]
public eva_level_scoreEntity eva_level_score_level_score_id { get; set; }
public Guid level_score_id { get; set; }
public Guid? level_score_id { get; set; }
public decimal? min_value { get; set; }
@@ -28,8 +28,10 @@ namespace TodoAPI2.Models
public decimal? max_percentage { get; set; }
public void SetAutoField(DataContext context)
[ForeignKey("group_guid")]
public eva_evaluation_groupEntity eva_evaluation_group_group_guid { get; set; }
public Guid? group_guid { get; set; }
public void SetAutoField(DataContext context)
{
}

View File

@@ -16,7 +16,7 @@ namespace TodoAPI2.Models
public Guid? id { get; set; }
public Guid level_score_id { get; set; }
public Guid? level_score_id { get; set; }
public decimal? min_value { get; set; }
@@ -26,6 +26,8 @@ namespace TodoAPI2.Models
public decimal? max_percentage { get; set; }
public Guid? group_guid { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -16,7 +16,9 @@ namespace TodoAPI2.Models
public Guid id { get; set; }
public Guid level_score_id { get; set; }
public Guid? level_score_id { get; set; }
public Guid? group_guid { get; set; }
}
}

View File

@@ -20,14 +20,14 @@ namespace TodoAPI2.Models
public class eva_level_score_detailService : Ieva_level_score_detailService
{
private IBaseRepository2<eva_level_score_detailEntity, Guid> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
private IMyDatabase db;
private Iexternal_linkageService ext;
public eva_level_score_detailService(IBaseRepository2<eva_level_score_detailEntity, Guid> 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<List<eva_level_score_detailViewModel>>(entities);
}
#endregion
#region Public Functions
@@ -76,26 +76,26 @@ namespace TodoAPI2.Models
{
var entity = _repository.Get(id);
var i = Mapper.Map<eva_level_score_detailWithSelectionViewModel>(entity);
i.item_level_score_id = (from x in _repository.Context.eva_level_score select x).ToList();
return i;
}
public eva_level_score_detailWithSelectionViewModel GetBlankItem()
{
var i = new eva_level_score_detailWithSelectionViewModel();
i.item_level_score_id = (from x in _repository.Context.eva_level_score select x).ToList();
return i;
}
public List<eva_level_score_detailViewModel> GetListBylevel_score_id(Guid level_score_id)
{
var model = new eva_level_score_detailSearchModel();
var model = new eva_level_score_detailSearchModel();
model.level_score_id = level_score_id;
return GetListBySearch(model);
}
public List<eva_level_score_detailViewModel> GetListBySearch(eva_level_score_detailSearchModel model)
public List<eva_level_score_detailViewModel> GetListBySearch(eva_level_score_detailSearchModel model)
{
var data = (
from m_eva_level_score_detail in _repository.Context.eva_level_score_detail
@@ -104,11 +104,14 @@ namespace TodoAPI2.Models
into eva_level_scoreResult1
from fk_eva_level_scoreResult1 in eva_level_scoreResult1.DefaultIfEmpty()
join fk_eva_evaluation_group6 in _repository.Context.eva_evaluation_group on m_eva_level_score_detail.group_guid equals fk_eva_evaluation_group6.id
into eva_evaluation_groupResult6
from fk_eva_evaluation_groupResult6 in eva_evaluation_groupResult6.DefaultIfEmpty()
where
1 == 1
&& (m_eva_level_score_detail.level_score_id == model.level_score_id)
where
1 == 1
&& (!model.level_score_id.HasValue || m_eva_level_score_detail.level_score_id == model.level_score_id)
&& (m_eva_level_score_detail.group_guid == model.group_guid)
orderby m_eva_level_score_detail.min_value descending
select new eva_level_score_detailViewModel()
@@ -119,8 +122,10 @@ namespace TodoAPI2.Models
max_value = m_eva_level_score_detail.max_value,
min_percentage = m_eva_level_score_detail.min_percentage,
max_percentage = m_eva_level_score_detail.max_percentage,
group_guid = m_eva_level_score_detail.group_guid,
level_score_id_eva_level_score_code = fk_eva_level_scoreResult1.code,
level_score_id_eva_level_score_code = fk_eva_level_scoreResult1.detail,
group_guid_eva_evaluation_group_code = fk_eva_evaluation_groupResult6.thegroup,
isActive = m_eva_level_score_detail.isActive,
Created = m_eva_level_score_detail.created,
@@ -143,8 +148,8 @@ namespace TodoAPI2.Models
entity.id = Guid.NewGuid();
entity.SetAutoField(_repository.Context);
entity.SetAutoField(_repository.Context);
if (is_force_save)
{
var inserted = _repository.Insert(entity);
@@ -169,8 +174,9 @@ namespace TodoAPI2.Models
existingEntity.max_value = model.max_value;
existingEntity.min_percentage = model.min_percentage;
existingEntity.max_percentage = model.max_percentage;
existingEntity.group_guid = model.group_guid;
existingEntity.SetAutoField(_repository.Context);
existingEntity.SetAutoField(_repository.Context);
if (is_force_save)
{
@@ -186,25 +192,26 @@ namespace TodoAPI2.Models
}
}
else
throw new NotificationException("No data to update");
throw new NotificationException("No data to update");
}
public string UpdateMultiple(List<eva_level_score_detailInputModel> model, bool is_force_save)
public string UpdateMultiple(List<eva_level_score_detailInputModel> model, bool is_force_save)
{
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.level_score_id = i.level_score_id;
existingEntity.min_value = i.min_value;
existingEntity.max_value = i.max_value;
existingEntity.min_percentage = i.min_percentage;
existingEntity.max_percentage = i.max_percentage;
existingEntity.level_score_id = i.level_score_id;
existingEntity.min_value = i.min_value;
existingEntity.max_value = i.max_value;
existingEntity.min_percentage = i.min_percentage;
existingEntity.max_percentage = i.max_percentage;
existingEntity.group_guid = i.group_guid;
existingEntity.SetAutoField(_repository.Context);
existingEntity.SetAutoField(_repository.Context);
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
}
@@ -212,22 +219,22 @@ namespace TodoAPI2.Models
{
var entity = GetEntity(i);
entity.id = Guid.NewGuid();
entity.SetAutoField(_repository.Context);
entity.SetAutoField(_repository.Context);
_repository.InsertWithoutCommit(entity);
}
else if (i.active_mode == "0" && i.id.HasValue) // remove
{
{
_repository.DeleteWithoutCommit(i.id.Value);
}
else if (i.active_mode == "0" && !i.id.HasValue)
{
// nothing to do
}
}
}
if (is_force_save)
{
_repository.Context.SaveChanges();
}
}
return model.Count().ToString();
}
@@ -251,7 +258,7 @@ namespace TodoAPI2.Models
return;
}
public void RefreshAutoFieldOfAllData()
public void RefreshAutoFieldOfAllData()
{
var all_items = from i in _repository.Context.eva_level_score_detail
select i;
@@ -262,17 +269,18 @@ namespace TodoAPI2.Models
_repository.Context.SaveChanges();
}
private Dictionary<string,string> GetLookupForLog()
private Dictionary<string, string> GetLookupForLog()
{
var i = new Dictionary<string, string>();
i.Add("level_score_id", "level_score_id");
i.Add("level_score_id_eva_level_score_code", "level_score_id");
i.Add("min_value", "ช่วงคะแนนต่ำสุด");
i.Add("max_value", "ช่วงคะแนนสูงสุด");
i.Add("min_percentage", "ร้อยละที่ได้เลื่อนต่ำสุด");
i.Add("max_percentage", "ร้อยละที่ได้เลื่อนสูงสุด");
i.Add("max_percentage", "ร้อยละที่ได้เลื่อนสูงสุด");
i.Add("group_guid", "กลุ่มการประเมิน");
i.Add("group_guid_eva_evaluation_group_code", "กลุ่มการประเมิน");
return i;
}

View File

@@ -14,7 +14,7 @@ namespace TodoAPI2.Models
public class eva_level_score_detailViewModel : BaseViewModel2<Guid>
{
public Guid level_score_id { get; set; }
public Guid? level_score_id { get; set; }
public decimal? min_value { get; set; }
@@ -24,7 +24,10 @@ namespace TodoAPI2.Models
public decimal? max_percentage { get; set; }
public Guid? group_guid { get; set; }
public string level_score_id_eva_level_score_code { get; set; }
public string group_guid_eva_evaluation_group_code { get; set; }
}
}

View File

@@ -7,6 +7,6 @@ namespace TodoAPI2.Models
{
public class eva_level_score_detailWithSelectionViewModel: eva_level_score_detailViewModel
{
public List<eva_level_scoreEntity> item_level_score_id { get; set; }
}
}

View File

@@ -2,9 +2,67 @@
@inject IConfiguration Configuration
@{
ViewData["Title"] = "eva_evaluation_group";
Layout = "_LayoutDirect";
Layout = "_LayoutDirect";
}
<div class="modal fade" id="eva_level_score_detailModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_level_score_detailModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eva_level_score_detailModelLabel">บันทึกข้อมูล ช่วงร้อยละที่ได้เลื่อน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_level_score_detail_id" />
<input class="form-control" type="hidden" id="eva_level_score_detail_group_guid" />
<div class='row'></div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_level_score_id" for="eva_level_score_detail_level_score_id">ระดับคะแนน</label>
<select class="form-control" id="eva_level_score_detail_level_score_id" iLabel="ระดับคะแนน" iRequire="true" iGroup="eva_level_score_detail"></select>
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_min_value" for="eva_level_score_detail_min_value">ช่วงคะแนนต่ำสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_min_value" iLabel="ช่วงคะแนนต่ำสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_max_value" for="eva_level_score_detail_max_value">ช่วงคะแนนสูงสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_max_value" iLabel="ช่วงคะแนนสูงสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_min_percentage" for="eva_level_score_detail_min_percentage">ร้อยละที่ได้เลื่อนต่ำสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_min_percentage" iLabel="ร้อยละที่ได้เลื่อนต่ำสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_max_percentage" for="eva_level_score_detail_max_percentage">ร้อยละที่ได้เลื่อนสูงสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_max_percentage" iLabel="ร้อยละที่ได้เลื่อนสูงสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-primary" onclick="javascript:eva_level_score_detail_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@@ -16,7 +74,7 @@
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")">หน้าแรก</a></li>
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")@MyHelper.GetConfig(Configuration, "SiteInformation:appsite")">@Environment.GetEnvironmentVariable("SiteInformation_modulename")</a></li>
<li class="breadcrumb-item active">กำหนดกลุ่มการประเมิน</li>
</ol>
</ol>
</div>
</div>
@@ -24,12 +82,12 @@
<div class="title col-md-12"><div class="line"></div>กำหนดกลุ่มการประเมิน</div>
<section class="card no-border">
<header class="card-header">
<header class="card-header">
กรุณากรอกข้อมูลลงในแบบฟอร์ม
</header>
<div class="card-body" style="">
<div class="row">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_evaluation_group_id" />
@@ -57,20 +115,20 @@
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</section>
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
<button type="button" class="btn btn-submit" onclick="javascript:eva_evaluation_group_PutUpdate()">บันทึก</button>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
<button type="button" class="btn btn-submit" onclick="javascript:eva_evaluation_group_PutUpdate()">บันทึก</button>
</div>
</div>
</section>
<br/>
<br />
<section class="wrapper">
<div class="title"><div class="line"></div>รายชื่อบุคลากร</div>
@@ -100,19 +158,64 @@
</table>
</section>
<br />
<input class="form-control" type="hidden" id="s_eva_level_score_detail_group_guid" />
<section class="wrapper">
<div class="title"><div class="line"></div>ตารางกำหนดช่วงร้อยละที่ได้เลื่อน</div>
<div class="tools">
<div class="row">
<div class="form-group col-md-3">
<label id='lab_s_eva_level_score_detail_level_score_id' for='s_eva_level_score_detail_level_score_id'>ระดับคะแนน</label>
<select class="form-control" id="s_eva_level_score_detail_level_score_id" iLabel="ระดับคะแนน" iRequire="true" iGroup="s_eva_level_score_detail" title='ระดับคะแนน' placeholder='ระดับคะแนน'></select>
</div>
<div class="col-md-6">
<button class="btn btn-info" onclick="javascript:eva_level_score_detail_DoSearch();">ค้นหา</button>
<button class="btn btn-info" onclick="javascript:eva_level_score_detail_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
</div>
</div>
</div>
<table id="eva_level_score_detailTable" class="display table table-bordered table-striped">
<thead>
<tr>
<!--<th>เลือก</th>-->
<th>เครื่องมือ</th>
<th><label id='h_eva_level_score_detail_level_score_id'>ระดับคะแนน</label></th>
<th><label id='h_eva_level_score_detail_min_value'>ช่วงคะแนนต่ำสุด</label></th>
<th><label id='h_eva_level_score_detail_max_value'>ช่วงคะแนนสูงสุด</label></th>
<th><label id='h_eva_level_score_detail_min_percentage'>ร้อยละที่ได้เลื่อนต่ำสุด</label></th>
<th><label id='h_eva_level_score_detail_max_percentage'>ร้อยละที่ได้เลื่อนสูงสุด</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_evaluation_group/eva_evaluation_group_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_group_detail/eva_evaluation_group_detail.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_level_score_detail/eva_level_score_detail.js?version=@MyHelper.GetDummyText()"></script>
<script>
$(document).ready(function () {
var id = getUrlParameter("id");
if (id) {
eva_evaluation_group_SetEditForm(id);
eva_evaluation_group_detail_InitiateDataTable(id);
eva_evaluation_group_detail_InitiateDataTable(id);
eva_level_score_detail_InitiateDataTable();
eva_level_score_detail_InitialForm();
} else {
eva_evaluation_group_SetCreateForm();
}
SetupValidationRemark("eva_evaluation_group");
SetupValidationRemark("eva_level_score_detail");
});
</script>
}

View File

@@ -5,59 +5,6 @@
Layout = "_LayoutDirect";
}
<div class="modal fade" id="eva_level_score_detailModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_level_score_detailModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eva_level_score_detailModelLabel">บันทึกข้อมูล ช่วงร้อยละที่ได้เลื่อน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_level_score_detail_id" />
<input class="form-control" type="hidden" id="eva_level_score_detail_level_score_id" />
<div class='row'></div>
<div class='row'></div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_min_value" for="eva_level_score_detail_min_value">ช่วงคะแนนต่ำสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_min_value" iLabel="ช่วงคะแนนต่ำสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_max_value" for="eva_level_score_detail_max_value">ช่วงคะแนนสูงสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_max_value" iLabel="ช่วงคะแนนสูงสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_min_percentage" for="eva_level_score_detail_min_percentage">ร้อยละที่ได้เลื่อนต่ำสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_min_percentage" iLabel="ร้อยละที่ได้เลื่อนต่ำสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
<div class="form-group col-md-4">
<label id="lab_eva_level_score_detail_max_percentage" for="eva_level_score_detail_max_percentage">ร้อยละที่ได้เลื่อนสูงสุด</label>
<input class="form-control" type="number" id="eva_level_score_detail_max_percentage" iLabel="ร้อยละที่ได้เลื่อนสูงสุด" iRequire="true" iGroup="eva_level_score_detail" />
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-primary" onclick="javascript:eva_level_score_detail_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="eva_promoted_percentageModel" style="z-index:1500" role="dialog" aria-labelledby="eva_promoted_percentageModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
@@ -203,42 +150,11 @@
</table>
</section>
<br />
<section class="wrapper">
<div class="title"><div class="line"></div>ตารางกำหนดช่วงร้อยละที่ได้เลื่อน</div>
<div class="tools">
<div class="row">
<input class="form-control" type="hidden" id="s_eva_level_score_detail_level_score_id" />
<div class="col-md-6">
<button class="btn btn-info" onclick="javascript:eva_level_score_detail_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
</div>
</div>
</div>
<table id="eva_level_score_detailTable" class="display table table-bordered table-striped">
<thead>
<tr>
<!--<th>เลือก</th>-->
<th>เครื่องมือ</th>
<th><label id='h_eva_level_score_detail_min_value'>ช่วงคะแนนต่ำสุด</label></th>
<th><label id='h_eva_level_score_detail_max_value'>ช่วงคะแนนสูงสุด</label></th>
<th><label id='h_eva_level_score_detail_min_percentage'>ร้อยละที่ได้เลื่อนต่ำสุด</label></th>
<th><label id='h_eva_level_score_detail_max_percentage'>ร้อยละที่ได้เลื่อนสูงสุด</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_level_score/eva_level_score_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_promoted_percentage/eva_promoted_percentage.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_level_score_detail/eva_level_score_detail.js?version=@MyHelper.GetDummyText()"></script>
<script>
$(document).ready(function () {
var id = getUrlParameter("id");
@@ -246,14 +162,11 @@
eva_level_score_SetEditForm(id);
eva_promoted_percentage_InitiateDataTable(id);
eva_promoted_percentage_InitialForm();
eva_level_score_detail_InitiateDataTable();
eva_level_score_detail_InitialForm();
} else {
eva_level_score_SetCreateForm();
}
SetupValidationRemark("eva_level_score");
SetupValidationRemark("eva_promoted_percentage");
SetupValidationRemark("eva_level_score_detail");
});
</script>
}

View File

@@ -5,37 +5,40 @@ var eva_level_score_detail_API = "/api/eva_level_score_detail/";
function eva_level_score_detail_GetSearchParameter() {
var eva_level_score_detailSearchObject = new Object();
eva_level_score_detailSearchObject.level_score_id = getUrlParameter("id");
eva_level_score_detailSearchObject.level_score_id = $("#s_eva_level_score_detail_level_score_id").val();
eva_level_score_detailSearchObject.group_guid = getUrlParameter("id");
return eva_level_score_detailSearchObject;
}
function eva_level_score_detail_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_eva_level_score_detail_level_score_id"), data, "id", "detail", "item_level_score_id", data.level_score_id);
$("#s_eva_level_score_detail_level_score_id").val(data.level_score_id);
console.log(data.item_level_score_id);
}
//================= Form Data Customizaiton =========================================
function eva_level_score_detail_FeedDataToForm(data) {
$("#eva_level_score_detail_id").val(data.id);
$("#eva_level_score_detail_level_score_id").val(data.level_score_id);
DropDownClearFormAndFeedWithData($("#eva_level_score_detail_level_score_id"), data, "id", "detail", "item_level_score_id", data.level_score_id);
$("#eva_level_score_detail_min_value").val(data.min_value);
$("#eva_level_score_detail_max_value").val(data.max_value);
$("#eva_level_score_detail_min_percentage").val(data.min_percentage);
$("#eva_level_score_detail_max_percentage").val(data.max_percentage);
$("#eva_level_score_detail_group_guid").val(data.group_guid);
}
function eva_level_score_detail_GetFromForm() {
var eva_level_score_detailObject = new Object();
eva_level_score_detailObject.id = $("#eva_level_score_detail_id").val();
eva_level_score_detailObject.level_score_id = getUrlParameter("id");
eva_level_score_detailObject.level_score_id = $("#eva_level_score_detail_level_score_id").val();
eva_level_score_detailObject.min_value = $("#eva_level_score_detail_min_value").val();
eva_level_score_detailObject.max_value = $("#eva_level_score_detail_max_value").val();
eva_level_score_detailObject.min_percentage = $("#eva_level_score_detail_min_percentage").val();
eva_level_score_detailObject.max_percentage = $("#eva_level_score_detail_max_percentage").val();
eva_level_score_detailObject.group_guid = getUrlParameter("id");
return eva_level_score_detailObject;
}
@@ -162,10 +165,11 @@ var eva_level_score_detail_setupTable = function (result) {
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "level_score_id_eva_level_score_code" },
{ "data": "min_value" },
{ "data": "max_value" },
{ "data": "min_percentage" },
{ "data": "max_percentage" },
{ "data": "max_percentage" },
],
"columnDefs": [
{
@@ -186,7 +190,7 @@ var eva_level_score_detail_setupTable = function (result) {
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"paging": false,
"searching": false
});
endLoad();