ปรับโครงสร้างระบบ ให้รองรับ การไปช่วยปฏิบัติงาน
This commit is contained in:
@@ -40,8 +40,10 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? order_of_data { get; set; }
|
||||
|
||||
public int? help_org_id { get; set; }
|
||||
|
||||
public void SetAutoField(DataContext context)
|
||||
|
||||
public void SetAutoField(DataContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? order_of_data { get; set; }
|
||||
|
||||
public int? help_org_id { get; set; }
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,18 +79,27 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_limit_frame_employeeWithSelectionViewModel>(entity);
|
||||
i.item_frame_group_guid = (from x in _repository.Context.eva_limit_frame_group
|
||||
join j in _repository.Context.eva_evaluation_group
|
||||
on x.group_guid equals j.id
|
||||
where (from q in _repository.Context.eva_limit_frame_group where q.id == entity.frame_group_guid select q.frame_plan_guid).Contains(x.frame_plan_guid)
|
||||
select new external_linkageViewModel { id_guid=x.id,external_name=j.thegroup }).ToList();
|
||||
i.item_employee_id = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.item_org_id = (from x in ext.GetDepartmentData() select x).ToList();
|
||||
|
||||
i.item_help_org_id = (from x in ext.GetDepartmentData() select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_limit_frame_employeeWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_limit_frame_employeeWithSelectionViewModel();
|
||||
i.item_frame_group_guid = (from x in _repository.Context.eva_limit_frame_group
|
||||
join j in _repository.Context.eva_evaluation_group
|
||||
on x.group_guid equals j.id
|
||||
select new external_linkageViewModel { id_guid = x.id, external_name = j.thegroup }).ToList();
|
||||
i.item_employee_id = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.item_org_id = (from x in ext.GetDepartmentData() select x).ToList();
|
||||
|
||||
i.item_help_org_id = (from x in ext.GetDepartmentData() select x).ToList();
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -119,6 +128,9 @@ namespace TodoAPI2.Models
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage11 in ext.GetDepartmentData() on m_eva_limit_frame_employee.help_org_id equals fk_external_linkage11.id
|
||||
into external_linkageResult11
|
||||
from fk_external_linkageResult11 in external_linkageResult11.DefaultIfEmpty()
|
||||
|
||||
where
|
||||
1 == 1
|
||||
@@ -140,10 +152,12 @@ namespace TodoAPI2.Models
|
||||
monthly_remuneration = m_eva_limit_frame_employee.monthly_remuneration,
|
||||
cost_of_living = m_eva_limit_frame_employee.cost_of_living,
|
||||
order_of_data = m_eva_limit_frame_employee.order_of_data,
|
||||
help_org_id = m_eva_limit_frame_employee.help_org_id,
|
||||
|
||||
frame_group_guid_eva_limit_frame_group_group_guid = fk_eva_limit_frame_groupResult1.group_guid,
|
||||
employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname,
|
||||
org_id_external_linkage_external_name = fk_external_linkageResult3.external_name,
|
||||
help_org_id_external_linkage_external_name = fk_external_linkageResult11.external_name,
|
||||
|
||||
isActive = m_eva_limit_frame_employee.isActive,
|
||||
Created = m_eva_limit_frame_employee.created,
|
||||
@@ -197,6 +211,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.monthly_remuneration = model.monthly_remuneration;
|
||||
existingEntity.cost_of_living = model.cost_of_living;
|
||||
existingEntity.order_of_data = model.order_of_data;
|
||||
existingEntity.help_org_id = model.help_org_id;
|
||||
|
||||
existingEntity.SetAutoField(_repository.Context);
|
||||
|
||||
@@ -236,6 +251,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.monthly_remuneration = i.monthly_remuneration;
|
||||
existingEntity.cost_of_living = i.cost_of_living;
|
||||
existingEntity.order_of_data = i.order_of_data;
|
||||
existingEntity.help_org_id = i.help_org_id;
|
||||
|
||||
existingEntity.SetAutoField(_repository.Context);
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
|
||||
@@ -34,9 +34,11 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? order_of_data { get; set; }
|
||||
|
||||
public int? help_org_id { get; set; }
|
||||
|
||||
public Guid? frame_group_guid_eva_limit_frame_group_group_guid { get; set; }
|
||||
public string employee_id_external_linkage_external_name { get; set; }
|
||||
public string org_id_external_linkage_external_name { get; set; }
|
||||
|
||||
public string help_org_id_external_linkage_external_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,10 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_limit_frame_employeeWithSelectionViewModel: eva_limit_frame_employeeViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_frame_group_guid { get; set; }
|
||||
public List<external_employeeViewModel> item_employee_id { get; set; }
|
||||
public List<external_linkageViewModel> item_org_id { get; set; }
|
||||
|
||||
public List<external_linkageViewModel> item_help_org_id { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user