ปรับปรุงหน้า migration ให้ดูง่ายขึ้น และอื่นๆ อีกหลายจุด
This commit is contained in:
@@ -14,7 +14,6 @@ using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
@@ -81,9 +80,18 @@ namespace TodoAPI2.Models
|
||||
public eva_adjust_postponement_migrationWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_postponement_migrationWithSelectionViewModel>(entity);
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation select x).ToList();
|
||||
var all_emp = emp.GetAllEmployee();
|
||||
|
||||
var i = Mapper.Map<eva_adjust_postponement_migrationWithSelectionViewModel>(entity);
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation
|
||||
join y in _repository.Context.eva_performance_plan on x.performance_plan_id equals y.id
|
||||
join z in all_emp on x.employee_id equals z.id
|
||||
join g in _repository.Context.eva_evaluation_group on x.evaluation_group_id equals g.id
|
||||
select new external_linkageViewModel {
|
||||
external_id = x.id,
|
||||
external_name = y.theTime.ToString() + "/" + y.fiscal_year.ToString() + " " + g.thegroup + " " + z.fullname
|
||||
}).ToList();
|
||||
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
i.item_report_type = (from x in ext.GetSalaryReportType() select x).ToList();
|
||||
|
||||
@@ -92,8 +100,18 @@ namespace TodoAPI2.Models
|
||||
public eva_adjust_postponement_migrationWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_postponement_migrationWithSelectionViewModel();
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation select x).ToList();
|
||||
var all_emp = emp.GetAllEmployee();
|
||||
|
||||
i.item_create_evaluation_id = (from x in _repository.Context.eva_create_evaluation
|
||||
join y in _repository.Context.eva_performance_plan on x.performance_plan_id equals y.id
|
||||
join z in all_emp on x.employee_id equals z.id
|
||||
join g in _repository.Context.eva_evaluation_group on x.evaluation_group_id equals g.id
|
||||
select new external_linkageViewModel
|
||||
{
|
||||
external_id = x.id,
|
||||
external_name = y.theTime.ToString() + "/" + y.fiscal_year.ToString() + " " + g.thegroup + " " + z.fullname
|
||||
}).ToList();
|
||||
|
||||
i.item_managed_by = all_emp.ToList();
|
||||
i.item_report_type = (from x in ext.GetSalaryReportType() select x).ToList();
|
||||
|
||||
@@ -145,6 +163,7 @@ namespace TodoAPI2.Models
|
||||
imported_file = m_eva_adjust_postponement_migration.imported_file,
|
||||
imported_fileDisplay = m_eva_adjust_postponement_migration.imported_fileDisplay,
|
||||
report_type = m_eva_adjust_postponement_migration.report_type,
|
||||
workingstatus = fk_external_linkageResult11.workingstatus,
|
||||
|
||||
create_evaluation_id_eva_create_evaluation_performance_plan_id = fk_eva_create_evaluationResult4.performance_plan_id,
|
||||
managed_by_external_linkage_external_name = fk_external_linkageResult11.fullname,
|
||||
@@ -322,6 +341,8 @@ namespace TodoAPI2.Models
|
||||
existingEntity.percentage = model.percentage;
|
||||
existingEntity.command_no = model.command_no;
|
||||
existingEntity.managed_by = model.managed_by;
|
||||
existingEntity.report_type = model.report_type;
|
||||
|
||||
if (!string.IsNullOrEmpty(model.imported_file))
|
||||
{
|
||||
if (model.imported_file.StartsWith("Uploads"))
|
||||
|
||||
@@ -55,5 +55,9 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string report_type { get; set; }
|
||||
|
||||
public string workingstatus { get; set; }
|
||||
|
||||
public string txt_data_type { get { if (create_evaluation_id.HasValue) return "ปรับเลื่อนเงินเดือน"; else return "โควต้า"; } }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_migrationWithSelectionViewModel: eva_adjust_postponement_migrationViewModel
|
||||
{
|
||||
public List<eva_create_evaluationEntity> item_create_evaluation_id { get; set; }
|
||||
public List<external_linkageViewModel> item_create_evaluation_id { get; set; }
|
||||
public List<external_employeeViewModel> item_managed_by { get; set; }
|
||||
public List<external_linkageViewModel> item_report_type { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user