เพิ่มช่อง วันที่เริ่มลา / สิ้นสุด ลา

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-08-27 10:20:02 +07:00
parent 910ef472ec
commit 8735c12bd7
13 changed files with 1186 additions and 13 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class EnhancePlan : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "end_leave",
table: "eva_performance_plan",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "start_leave",
table: "eva_performance_plan",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "end_leave",
table: "eva_performance_plan");
migrationBuilder.DropColumn(
name: "start_leave",
table: "eva_performance_plan");
}
}
}

View File

@@ -838,12 +838,16 @@ namespace tb320eva.Migrations
b.Property<DateTime>("created"); b.Property<DateTime>("created");
b.Property<DateTime?>("end_leave");
b.Property<int?>("fiscal_year"); b.Property<int?>("fiscal_year");
b.Property<bool>("isActive"); b.Property<bool>("isActive");
b.Property<decimal?>("percent"); b.Property<decimal?>("percent");
b.Property<DateTime?>("start_leave");
b.Property<int?>("theTime"); b.Property<int?>("theTime");
b.Property<DateTime>("updated"); b.Property<DateTime>("updated");

View File

@@ -15,26 +15,30 @@ namespace TodoAPI2.Models
public class eva_performance_planEntity : BaseEntity<Guid> public class eva_performance_planEntity : BaseEntity<Guid>
{ {
public int? fiscal_year { get; set; } public int? fiscal_year { get; set; }
public int? theTime { get; set; } public int? theTime { get; set; }
public decimal? percent { get; set; } public decimal? percent { get; set; }
public DateTime? start_leave { get; set; }
public DateTime? end_leave { get; set; }
[NotMapped] [NotMapped]
public string display_text public string display_text { get; set; }
public void SetAutoField(DataContext context)
{ {
get
}
public void DoAfterInsertUpdate(DataContext context)
{ {
if(!theTime.HasValue || !fiscal_year.HasValue)
{
return "";
}
else
{
return theTime.ToString() + "/" + fiscal_year.ToString();
}
}
} }
} }
} }

View File

@@ -22,6 +22,10 @@ namespace TodoAPI2.Models
public decimal? percent { get; set; } public decimal? percent { get; set; }
public DateTime? start_leave { get; set; }
public DateTime? end_leave { get; set; }
public string active_mode { get; set; } public string active_mode { get; set; }
} }
} }

View File

@@ -14,6 +14,8 @@ namespace TodoAPI2.Models
public class eva_performance_planSearchModel public class eva_performance_planSearchModel
{ {
public Guid id { get; set; }
public int? fiscal_year { get; set; } public int? fiscal_year { get; set; }
public int? theTime { get; set; } public int? theTime { get; set; }

View File

@@ -99,6 +99,8 @@ namespace TodoAPI2.Models
fiscal_year = m_eva_performance_plan.fiscal_year, fiscal_year = m_eva_performance_plan.fiscal_year,
theTime = m_eva_performance_plan.theTime, theTime = m_eva_performance_plan.theTime,
percent = m_eva_performance_plan.percent, percent = m_eva_performance_plan.percent,
start_leave = m_eva_performance_plan.start_leave,
end_leave = m_eva_performance_plan.end_leave,
isActive = m_eva_performance_plan.isActive, isActive = m_eva_performance_plan.isActive,
Created = m_eva_performance_plan.created, Created = m_eva_performance_plan.created,
@@ -124,6 +126,8 @@ namespace TodoAPI2.Models
fiscal_year = m_eva_performance_plan.fiscal_year, fiscal_year = m_eva_performance_plan.fiscal_year,
theTime = m_eva_performance_plan.theTime, theTime = m_eva_performance_plan.theTime,
percent = m_eva_performance_plan.percent, percent = m_eva_performance_plan.percent,
start_leave = m_eva_performance_plan.start_leave,
end_leave = m_eva_performance_plan.end_leave,
isActive = m_eva_performance_plan.isActive, isActive = m_eva_performance_plan.isActive,
Created = m_eva_performance_plan.created, Created = m_eva_performance_plan.created,
@@ -152,6 +156,8 @@ namespace TodoAPI2.Models
fiscal_year = m_eva_performance_plan.fiscal_year, fiscal_year = m_eva_performance_plan.fiscal_year,
theTime = m_eva_performance_plan.theTime, theTime = m_eva_performance_plan.theTime,
percent = m_eva_performance_plan.percent, percent = m_eva_performance_plan.percent,
start_leave = m_eva_performance_plan.start_leave,
end_leave = m_eva_performance_plan.end_leave,
isActive = m_eva_performance_plan.isActive, isActive = m_eva_performance_plan.isActive,
Created = m_eva_performance_plan.created, Created = m_eva_performance_plan.created,
@@ -185,6 +191,8 @@ namespace TodoAPI2.Models
existingEntity.fiscal_year = model.fiscal_year; existingEntity.fiscal_year = model.fiscal_year;
existingEntity.theTime = model.theTime; existingEntity.theTime = model.theTime;
existingEntity.percent = model.percent; existingEntity.percent = model.percent;
existingEntity.start_leave = model.start_leave;
existingEntity.end_leave = model.end_leave;
var updated = _repository.Update(id, existingEntity); var updated = _repository.Update(id, existingEntity);
return Get(updated.id); return Get(updated.id);
@@ -205,6 +213,8 @@ namespace TodoAPI2.Models
existingEntity.fiscal_year = i.fiscal_year; existingEntity.fiscal_year = i.fiscal_year;
existingEntity.theTime = i.theTime; existingEntity.theTime = i.theTime;
existingEntity.percent = i.percent; existingEntity.percent = i.percent;
existingEntity.start_leave = i.start_leave;
existingEntity.end_leave = i.end_leave;
_repository.UpdateWithoutCommit(i.id.Value, existingEntity); _repository.UpdateWithoutCommit(i.id.Value, existingEntity);
} }

View File

@@ -11,7 +11,7 @@ using TTSW.Common;
namespace TodoAPI2.Models namespace TodoAPI2.Models
{ {
public class eva_performance_planViewModel : BaseViewModel<Guid> public class eva_performance_planViewModel : BaseViewModel2<Guid>
{ {
public int? fiscal_year { get; set; } public int? fiscal_year { get; set; }
@@ -19,5 +19,15 @@ namespace TodoAPI2.Models
public int? theTime { get; set; } public int? theTime { get; set; }
public decimal? percent { get; set; } public decimal? percent { get; set; }
public DateTime? start_leave { get; set; }
public string txt_start_leave { get { return MyHelper.GetDateStringForReport(this.start_leave); } }
public DateTime? end_leave { get; set; }
public string txt_end_leave { get { return MyHelper.GetDateStringForReport(this.end_leave); } }
} }
} }

View File

@@ -34,6 +34,15 @@
<label id="lab_eva_performance_plan_percent" for="eva_performance_plan_percent">กรอบวงเงินในส่วนที่กันไว้</label> <label id="lab_eva_performance_plan_percent" for="eva_performance_plan_percent">กรอบวงเงินในส่วนที่กันไว้</label>
<input class="form-control" type="number" id="eva_performance_plan_percent" iLabel="กรอบวงเงินในส่วนที่กันไว้" iRequire="true" iGroup="eva_performance_plan" /> <input class="form-control" type="number" id="eva_performance_plan_percent" iLabel="กรอบวงเงินในส่วนที่กันไว้" iRequire="true" iGroup="eva_performance_plan" />
</div> </div>
<div class="form-group col-md-3">
<label id="lab_eva_performance_plan_start_leave" for="eva_performance_plan_start_leave">ข้อมูลการลาเริ่มต้น</label>
<input class="form-control" type="text" id="eva_performance_plan_start_leave" data-provide="datepicker" data-date-language="th-th" iLabel="ข้อมูลการลาเริ่มต้น" iRequire="true" iGroup="eva_performance_plan" />
</div>
<div class="form-group col-md-3">
<label id="lab_eva_performance_plan_end_leave" for="eva_performance_plan_end_leave">ข้อมูลการลาสิ้นสุด</label>
<input class="form-control" type="text" id="eva_performance_plan_end_leave" data-provide="datepicker" data-date-language="th-th" iLabel="ข้อมูลการลาสิ้นสุด" iRequire="true" iGroup="eva_performance_plan" />
</div>
</div> </div>

View File

@@ -105,6 +105,15 @@
<label id="lab_eva_performance_plan_percent" for="eva_performance_plan_percent">กรอบวงเงินในส่วนที่กันไว้</label> <label id="lab_eva_performance_plan_percent" for="eva_performance_plan_percent">กรอบวงเงินในส่วนที่กันไว้</label>
<input class="form-control" type="number" id="eva_performance_plan_percent" iLabel="กรอบวงเงินในส่วนที่กันไว้" iRequire="true" iGroup="eva_performance_plan" /> <input class="form-control" type="number" id="eva_performance_plan_percent" iLabel="กรอบวงเงินในส่วนที่กันไว้" iRequire="true" iGroup="eva_performance_plan" />
</div> </div>
<div class="form-group col-md-3">
<label id="lab_eva_performance_plan_start_leave" for="eva_performance_plan_start_leave">ข้อมูลการลาเริ่มต้น</label>
<input class="form-control" type="text" id="eva_performance_plan_start_leave" data-provide="datepicker" data-date-language="th-th" iLabel="ข้อมูลการลาเริ่มต้น" iRequire="true" iGroup="eva_performance_plan" />
</div>
<div class="form-group col-md-3">
<label id="lab_eva_performance_plan_end_leave" for="eva_performance_plan_end_leave">ข้อมูลการลาสิ้นสุด</label>
<input class="form-control" type="text" id="eva_performance_plan_end_leave" data-provide="datepicker" data-date-language="th-th" iLabel="ข้อมูลการลาสิ้นสุด" iRequire="true" iGroup="eva_performance_plan" />
</div>
</div> </div>
</div> </div>

View File

@@ -24,6 +24,8 @@ function eva_performance_plan_FeedDataToForm(data) {
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year); $("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#eva_performance_plan_theTime").val(data.theTime); $("#eva_performance_plan_theTime").val(data.theTime);
$("#eva_performance_plan_percent").val(data.percent); $("#eva_performance_plan_percent").val(data.percent);
$("#eva_performance_plan_start_leave").val(formatDate(data.start_leave));
$("#eva_performance_plan_end_leave").val(formatDate(data.end_leave));
} }
function eva_performance_plan_GetFromForm() { function eva_performance_plan_GetFromForm() {
@@ -32,6 +34,8 @@ function eva_performance_plan_GetFromForm() {
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val(); eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val(); eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
eva_performance_planObject.percent = $("#eva_performance_plan_percent").val(); eva_performance_planObject.percent = $("#eva_performance_plan_percent").val();
eva_performance_planObject.start_leave = getDate($("#eva_performance_plan_start_leave").val());
eva_performance_planObject.end_leave = getDate($("#eva_performance_plan_end_leave").val());
return eva_performance_planObject; return eva_performance_planObject;
} }

View File

@@ -8,6 +8,8 @@ function eva_performance_plan_FeedDataToForm(data) {
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year); $("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#eva_performance_plan_theTime").val(data.theTime); $("#eva_performance_plan_theTime").val(data.theTime);
$("#eva_performance_plan_percent").val(data.percent); $("#eva_performance_plan_percent").val(data.percent);
$("#eva_performance_plan_start_leave").val(formatDate(data.start_leave));
$("#eva_performance_plan_end_leave").val(formatDate(data.end_leave));
} }
function eva_performance_plan_GetFromForm() { function eva_performance_plan_GetFromForm() {
@@ -16,6 +18,8 @@ function eva_performance_plan_GetFromForm() {
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val(); eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val(); eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
eva_performance_planObject.percent = $("#eva_performance_plan_percent").val(); eva_performance_planObject.percent = $("#eva_performance_plan_percent").val();
eva_performance_planObject.start_leave = getDate($("#eva_performance_plan_start_leave").val());
eva_performance_planObject.end_leave = getDate($("#eva_performance_plan_end_leave").val());
return eva_performance_planObject; return eva_performance_planObject;
} }