เพิ่มช่อง วันที่เริ่มลา / สิ้นสุด ลา
This commit is contained in:
Binary file not shown.
1081
Migrations/20210827031202_EnhancePlan.Designer.cs
generated
Normal file
1081
Migrations/20210827031202_EnhancePlan.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
Migrations/20210827031202_EnhancePlan.cs
Normal file
32
Migrations/20210827031202_EnhancePlan.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -838,12 +838,16 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<DateTime>("created");
|
||||
|
||||
b.Property<DateTime?>("end_leave");
|
||||
|
||||
b.Property<int?>("fiscal_year");
|
||||
|
||||
b.Property<bool>("isActive");
|
||||
|
||||
b.Property<decimal?>("percent");
|
||||
|
||||
b.Property<DateTime?>("start_leave");
|
||||
|
||||
b.Property<int?>("theTime");
|
||||
|
||||
b.Property<DateTime>("updated");
|
||||
|
||||
@@ -15,26 +15,30 @@ namespace TodoAPI2.Models
|
||||
public class eva_performance_planEntity : BaseEntity<Guid>
|
||||
{
|
||||
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
|
||||
public int? theTime { get; set; }
|
||||
|
||||
public decimal? percent { get; set; }
|
||||
|
||||
public DateTime? start_leave { get; set; }
|
||||
|
||||
public DateTime? end_leave { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string display_text
|
||||
public string display_text { get; set; }
|
||||
|
||||
|
||||
public void SetAutoField(DataContext context)
|
||||
{
|
||||
get
|
||||
{
|
||||
if(!theTime.HasValue || !fiscal_year.HasValue)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return theTime.ToString() + "/" + fiscal_year.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void DoAfterInsertUpdate(DataContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public decimal? percent { get; set; }
|
||||
|
||||
public DateTime? start_leave { get; set; }
|
||||
|
||||
public DateTime? end_leave { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace TodoAPI2.Models
|
||||
public class eva_performance_planSearchModel
|
||||
{
|
||||
|
||||
public Guid id { get; set; }
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
|
||||
public int? theTime { get; set; }
|
||||
|
||||
@@ -99,6 +99,8 @@ namespace TodoAPI2.Models
|
||||
fiscal_year = m_eva_performance_plan.fiscal_year,
|
||||
theTime = m_eva_performance_plan.theTime,
|
||||
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,
|
||||
Created = m_eva_performance_plan.created,
|
||||
@@ -124,6 +126,8 @@ namespace TodoAPI2.Models
|
||||
fiscal_year = m_eva_performance_plan.fiscal_year,
|
||||
theTime = m_eva_performance_plan.theTime,
|
||||
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,
|
||||
Created = m_eva_performance_plan.created,
|
||||
@@ -152,6 +156,8 @@ namespace TodoAPI2.Models
|
||||
fiscal_year = m_eva_performance_plan.fiscal_year,
|
||||
theTime = m_eva_performance_plan.theTime,
|
||||
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,
|
||||
Created = m_eva_performance_plan.created,
|
||||
@@ -185,6 +191,8 @@ namespace TodoAPI2.Models
|
||||
existingEntity.fiscal_year = model.fiscal_year;
|
||||
existingEntity.theTime = model.theTime;
|
||||
existingEntity.percent = model.percent;
|
||||
existingEntity.start_leave = model.start_leave;
|
||||
existingEntity.end_leave = model.end_leave;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
@@ -205,6 +213,8 @@ namespace TodoAPI2.Models
|
||||
existingEntity.fiscal_year = i.fiscal_year;
|
||||
existingEntity.theTime = i.theTime;
|
||||
existingEntity.percent = i.percent;
|
||||
existingEntity.start_leave = i.start_leave;
|
||||
existingEntity.end_leave = i.end_leave;
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_performance_planViewModel : BaseViewModel<Guid>
|
||||
public class eva_performance_planViewModel : BaseViewModel2<Guid>
|
||||
{
|
||||
|
||||
public int? fiscal_year { get; set; }
|
||||
@@ -19,5 +19,15 @@ namespace TodoAPI2.Models
|
||||
public int? theTime { 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); } }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,15 @@
|
||||
<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" />
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
@@ -105,6 +105,15 @@
|
||||
<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" />
|
||||
</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>
|
||||
|
||||
@@ -24,6 +24,8 @@ function eva_performance_plan_FeedDataToForm(data) {
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
$("#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() {
|
||||
@@ -32,6 +34,8 @@ function eva_performance_plan_GetFromForm() {
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").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;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ function eva_performance_plan_FeedDataToForm(data) {
|
||||
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
|
||||
$("#eva_performance_plan_theTime").val(data.theTime);
|
||||
$("#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() {
|
||||
@@ -16,6 +18,8 @@ function eva_performance_plan_GetFromForm() {
|
||||
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
|
||||
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user