/// <summary> /// </summary> /// <param name="id"></param> /// <returns></returns> public Tra_RequirementTrainModel GetById(Guid id) { string status = string.Empty; var model = new Tra_RequirementTrainModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Tra_RequirementTrainEntity>(id, ConstantSql.hrm_tra_sp_get_RequirementTrainIds, ref status); if (entity!=null) { model = entity.CopyData<Tra_RequirementTrainModel>(); if (entity.PersonRequirement != null) { Guid profileid = Guid.Parse(entity.PersonRequirement); var entityprofile = service.GetByIdUseStore<Tra_RequirementTrainEntity>(profileid, ConstantSql.hrm_hr_sp_get_ProfileById, ref status); if (entityprofile != null && entityprofile.ProfileID != null && entityprofile.ProfileName != null) { model.ProfileID = entityprofile.ID; model.ProfileName = entityprofile.ProfileName; model.CodeEmp = entityprofile.CodeEmp; } } } if (model.IsTrainingOutside != null && model.IsTrainingOutside == false) model.IsTrainingInside = true; model.ActionStatus = status; return model; }
public Att_LeaveDayModel GetById(Guid id) { string status = string.Empty; var model = new Att_LeaveDayModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Att_LeaveDayEntity>(id, ConstantSql.hrm_att_sp_get_LeaveDayById, ref status); if (entity != null) { model = entity.CopyData<Att_LeaveDayModel>(); if (model.LeaveHours != null && model.LeaveHours > 0) { if (model.DurationType == LeaveDayDurationType.E_FIRSTHALFSHIFT.ToString() || model.DurationType == LeaveDayDurationType.E_LASTHALFSHIFT.ToString()) { var guiId = model.ProfileID; var start = model.DateStart; var end = model.DateEnd; if (guiId != null && guiId != Guid.Empty && start != null && end != null) { var listRoster = service.GetData<Att_RosterEntity>(guiId, ConstantSql.hrm_att_sp_get_RosterByProfileId, ref status); if (listRoster != null) { for (DateTime i = start; i <= end; i = i.AddDays(1)) { var roster = listRoster.Where(d => d.DateStart <= i && d.DateEnd >= i).FirstOrDefault(); if (roster != null) { var shift = SearchShift(roster, i); if (shift != null && shift != Guid.Empty) { var catShift = service.GetByIdUseStore<Cat_ShiftEntity>((Guid)shift, ConstantSql.hrm_cat_sp_get_ShiftById, ref status); if (catShift != null) { if (model.DurationType == LeaveDayDurationType.E_FIRSTHALFSHIFT.ToString()) { model.HoursFrom = catShift.InTime; model.HoursTo = catShift.InTime.AddHours(catShift.CoBreakOut); break; } else { model.HoursFrom = catShift.InTime.AddHours(catShift.CoBreakIn); model.HoursTo = catShift.InTime.AddHours(catShift.CoOut); break; } } } } } } } } } } model.ActionStatus = status; return model; }
/// <summary> /// </summary> /// <param name="id"></param> /// <returns></returns> public Tra_ClassModel GetById(Guid id) { string status = string.Empty; var model = new Tra_ClassModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Tra_ClassEntity>(id, ConstantSql.hrm_tra_sp_get_ClassById, ref status); if (entity!=null) { if (entity.TrainerOtherList != null) entity.TrainerOtherList = entity.TrainerOtherList.Replace(" ", ""); model = entity.CopyData<Tra_ClassModel>(); if(model.IsTrainingOut == false) { model.IsTrainingInside = true; } if (entity.Teacher != null) { //Guid profileid = Guid.Parse(entity.Teacher); var lstEntityprofile = service.GetData<Tra_RequirementTrainEntity>(entity.Teacher, ConstantSql.hrm_hr_sp_get_ProfileById, ref status); if (lstEntityprofile!=null && lstEntityprofile.Count > 0) { var entityprofile = lstEntityprofile[0]; if (entityprofile != null && entityprofile.ProfileID != null && entityprofile.ProfileName != null) { model.ProfileID = entityprofile.ID; model.ProfileName = entityprofile.ProfileName; model.CodeEmp = entityprofile.CodeEmp; } } } } model.ActionStatus = status; return model; }
/// <summary> /// [Chuc.Nguyen] - Lấy dữ liệu bảng Tai Nạn(Hre_Accident) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public FIN_ClaimModel GetById(Guid id) { string status = string.Empty; var model = new FIN_ClaimModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<FIN_ClaimEntity>(id, ConstantSql.hrm_hr_sp_get_ClaimById, ref status); if (entity != null) { model = entity.CopyData<FIN_ClaimModel>(); if (!string.IsNullOrEmpty(model.Other)) { model.IsManufactureName = true; } else { model.IsProfile = true; } if(model.IsCashAdvance != null && model.IsCashAdvance == false) { model.IsNoneCashAdvance = true; } if (model.IsCashAdvance != null && model.IsCashAdvance == true) { model.IsNoneCashAdvance = false; } } model.ActionStatus = status; return model; }
public Cat_RateInsuranceModel GetById(Guid id) { string status = string.Empty; var model = new Cat_RateInsuranceModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Cat_RateInsuranceEntity>(id, ConstantSql.hrm_cat_sp_get_RateInsuranceById, ref status); if (entity!=null) { model = entity.CopyData<Cat_RateInsuranceModel>(); #region nhân 100 cho các tỉ lệ (để hiển thị %) if (model != null) { model.SocialInsCompRate = model.SocialInsCompRate*100 ; model.SocialInsEmpRate = model.SocialInsEmpRate * 100; model.HealthInsCompRate = model.HealthInsCompRate * 100; model.HealthInsEmpRate = model.HealthInsEmpRate * 100; model.UnemployInsCompRate = model.UnemployInsCompRate * 100; model.UnemployInsEmpRate = model.UnemployInsEmpRate * 100; } #endregion } model.ActionStatus = status; return model; }
/// <summary> /// [Son.Vo] - Lấy dữ liệu OrgStructure(Cat_OrgStructure) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public CatOrgStructureModel GetById(Guid id) { string status = string.Empty; var model = new CatOrgStructureModel(); var orgServices = new Cat_OrgMoreInforServices(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Cat_OrgStructureEntity>(id,ConstantSql.hrm_cat_sp_get_OrgStructureById ,ref status); var objs = new List<object>(); objs.Add(Common.DotNetToOracle(id.ToString())); var orgInfoEntity = orgServices.GetData<Cat_OrgMoreInforEntity>(objs, ConstantSql.hrm_hr_sp_get_OrgMoreInfoByOrgID, UserLogin, ref status).FirstOrDefault(); if (entity != null) { model = entity.CopyData<CatOrgStructureModel>(); if (orgInfoEntity != null) { model.ServicesType = orgInfoEntity.ServicesType; model.BillingAddress = orgInfoEntity.BillingAddress; model.ContractFrom = orgInfoEntity.ContractFrom; model.ContractTo = orgInfoEntity.ContractTo; model.BillingCompanyName = orgInfoEntity.BillingCompanyName; model.TaxCode = orgInfoEntity.TaxCode; model.DescriptionInfo = orgInfoEntity.Description; model.DurationPay = orgInfoEntity.DurationPay; model.RecipientInvoice = orgInfoEntity.RecipientInvoice; model.TelePhone = orgInfoEntity.TelePhone; model.CellPhone = orgInfoEntity.CellPhone; model.EmailInfo = orgInfoEntity.Email; model.OrgMoreInforID = (Guid?)orgInfoEntity.ID; } } model.ActionStatus = status; return model; }
public Eva_PerformanceModel GetById(Guid id) { string status = string.Empty; var performanceService = new Eva_PerformanceServices(); var model = new Eva_PerformanceModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Eva_PerformanceEntity>(id, ConstantSql.hrm_eva_sp_get_PerformanceById, ref status); if (entity != null) { model = entity.CopyData<Eva_PerformanceModel>(); // model.AttachFileLast = model.AttachFile; #region Đọc Xml từ db và chuyển sang string if (model != null) { var doc = performanceService.ReadXml(model.AttachFile, AttachFileEntity.FieldNames.FullName); model.AttachFileLast = string.Join(",", doc.ToArray()); model.AttachFile = model.AttachFileLast; model.AttachFiles = doc; } #endregion } model.ActionStatus = status; return model; }
// GET api/<controller>/5 public Cat_UnusualAllowanceCfgModel Get(Guid id) { var profileName = string.Empty; var service = new Cat_UnusualAllowanceCfgServices(); ActionService actionService = new ActionService(UserLogin); var result = actionService.GetByIdUseStore<Cat_UnusualAllowanceCfgEntity>(id, ConstantSql.hrm_cat_sp_get_UnusualAllowanceCfgId, ref status); if (result == null) { return new Cat_UnusualAllowanceCfgModel(); } var cat_UnsualAllowanceCfgEntity = new Cat_UnusualAllowanceCfgModel { ID = result.ID, Code = result.Code, Comment = result.Comment, UnusualAllowanceCfgName = result.UnusualAllowanceCfgName, IsAddToHourlyRate = result.IsAddToHourlyRate, IsChargePIT = result.IsChargePIT, IsExcludePayslip = result.IsExcludePayslip, MethodCalculation = result.MethodCalculation, Formula = result.Formula, EDType = result.EDType, Amount = result.Amount, Type = result.Type }; return cat_UnsualAllowanceCfgEntity; }
public Rec_JobConditionModel GetById(Guid id) { string status = string.Empty; var model = new Rec_JobConditionModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Rec_JobConditionEntity>(id, ConstantSql.hrm_rec_sp_get_JobConditionById, ref status);//note if (entity != null) { model = entity.CopyData<Rec_JobConditionModel>(); if (model.ConditionName == ConditionName.E_DISEASEIDS.ToString() && !string.IsNullOrEmpty(model.Value1)) { var service1 = new BaseService(); var lst = service1.GetData<Cat_ComputingLevelMultiEntity>(model.Value1, ConstantSql.hrm_cat_sp_get_LevelGeneralByIds, UserLogin ,ref status).ToList(); var ids = model.Value1 .Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(x => Common.OracleToDotNet(x.ToString())) .ToList(); model.Value1 = string.Join(",", ids); model.DiseaseIDs = string.Join(",", ids); // model.ArrDisease = lst; } } model.ActionStatus = status; return model; }
public Cat_HDTJobGroupModel Post([Bind]Cat_HDTJobGroupModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData<Cat_HDTJobGroupModel>(model, "Cat_HDTJobGroup", ref message); if (!checkValidate) { model.ActionStatus = message; return model; } ActionService action = new ActionService(UserLogin); string status = string.Empty; if(model.ID!= null) { var resut = action.GetByIdUseStore<Cat_HDTJobGroupEntity>(model.ID, ConstantSql.hrm_cat_sp_get_HDTJobGroupById, ref status); if (resut != null && resut.Status == EnumDropDown.Status.E_APPROVED.ToString()) { model.ActionStatus = ConstantDisplay.StatusApproveCannotEdit.TranslateString(); return model; } } #endregion ActionService service = new ActionService(UserLogin); return service.UpdateOrCreate<Cat_HDTJobGroupEntity, Cat_HDTJobGroupModel>(model); }
public ActionResult GetCan_SumryMealRecord([DataSourceRequest] DataSourceRequest request, Can_SumryMealRecordSearchModel model) { ActionService action = new ActionService(UserLogin); string status = string.Empty; var Cutoffduration = action.GetByIdUseStore<Att_CutOffDurationEntity>((Guid)model.CutoffdurationID, ConstantSql.hrm_att_sp_get_CutOffDurationById, ref status); model.DateFrom = Cutoffduration.DateStart; model.DateTo = Cutoffduration.DateEnd; return GetListDataAndReturn<Can_SumryMealRecordModel, Can_SumryMealRecordEntity, Can_SumryMealRecordSearchModel>(request, model, ConstantSql.hrm_can_sp_get_SumMealRecord); }
public Rec_RecruitmentCampaignItemModel GetById(Guid id) { string status = string.Empty; var model = new Rec_RecruitmentCampaignItemModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Rec_RecruitmentCampaignItemEntity>(id, ConstantSql.hrm_rec_sp_get_RecruitmentCampaignItemById, ref status);//note if (entity != null) { model = entity.CopyData<Rec_RecruitmentCampaignItemModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// [Tin.Nguyen] - Lấy dữ liệu Tủ Đồ(Lau_Locker) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Lau_MarkerModel GetById(Guid id) { string status = string.Empty; var model = new Lau_MarkerModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<LMS_MarkerEntity>(id, ConstantSql.hrm_lau_sp_get_MarkerById, ref status); if (entity != null) { model = entity.CopyData<Lau_MarkerModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// [Chuc.Nguyen] - Lấy dữ liệu Ngân Hàng(Cat_Bank) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Hre_MPModel GetById(Guid id) { string status = string.Empty; var model = new Hre_MPModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Hre_MPEntity>(id, ConstantSql.hrm_hr_sp_get_MPById, ref status); if (entity!=null) { model = entity.CopyData<Hre_MPModel>(); } model.ActionStatus = status; return model; }
public Pur_MCAMModel GetById(Guid id) { string status = string.Empty; var model = new Pur_MCAMModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Pur_MCAMEntity>(id, ConstantSql.Hrm_CAT_SP_GET_PURMCAMBYID, ref status); if (entity != null) { model = entity.CopyData<Pur_MCAMModel>(); } model.ActionStatus = status; return model; }
// // GET: /Sal_UnusualED/ public Sal_UnusualAllowanceModel GetById(Guid id) { string status = string.Empty; var model = new Sal_UnusualAllowanceModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Sal_UnusualAllowanceEntity>(id, ConstantSql.hrm_sal_sp_get_UnusualEDById, ref status); if (entity != null) { model = entity.Copy<Sal_UnusualAllowanceModel>(); } model.ActionStatus = status; return model; }
public DashboardApproveModel GetById(Guid id) { string status = string.Empty; var model = new DashboardApproveModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<DashboardApproveEntity>(id, ConstantSql.hrm_sys_sp_get_DashboardApproveById, ref status); if (entity != null) { model = entity.CopyData<DashboardApproveModel>(); } //model.ActionStatus = status; return model; }
/// <summary> /// [Chuc.Nguyen] - Lấy dữ liệu bảng Tai Nạn(Hre_Accident) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public FIN_CashAdvanceItemModel GetById(Guid id) { string status = string.Empty; var model = new FIN_CashAdvanceItemModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Fin_CashAdvanceItemEntity>(id, ConstantSql.hrm_hr_sp_get_CashAdvanceItemById, ref status); if (entity != null) { model = entity.CopyData<FIN_CashAdvanceItemModel>(); } model.ActionStatus = status; return model; }
// // GET: /Cat_KPIBonusItem/ public Cat_KPIBonusItemModel GetById(Guid id) { string status = string.Empty; var model = new Cat_KPIBonusItemModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Cat_KPIBonusItemEntity>(id, ConstantSql.hrm_cat_sp_get_KPIBonusItemByID, ref status); if (entity != null) { model = entity.CopyData<Cat_KPIBonusItemModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public FIN_ApproverECLAIMModel GetById(Guid id) { string status = string.Empty; var model = new FIN_ApproverECLAIMModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<FIN_ApproverECLAIMEntity>(id, ConstantSql.hrm_eva_sp_get_ApproverECLAIMById, ref status); if (entity != null) { model = entity.CopyData<FIN_ApproverECLAIMModel>(); } model.ActionStatus = status; return model; }
public PUR_ColorModelModel GetById(Guid id) { string status = string.Empty; var model = new PUR_ColorModelModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<PUR_ColorModelEntity>(id, ConstantSql.hrm_Cat_SP_GET_PurColorByID, ref status); if (entity != null) { model = entity.CopyData<PUR_ColorModelModel>(); } return model; }
public Rec_TagModel GetById(Guid id) { string status = string.Empty; var model = new Rec_TagModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Rec_TagEntity>(id, ConstantSql.hrm_rec_sp_get_TagById, ref status); if (entity != null) { model = entity.CopyData<Rec_TagModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// </summary> /// <param name="id"></param> /// <returns></returns> public Tra_TraineeScoreModel GetById(Guid id) { string status = string.Empty; var model = new Tra_TraineeScoreModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Tra_TraineeScoreEntity>(id, ConstantSql.hrm_tra_sp_get_TraineeScoreById, ref status); if (entity!=null) { model = entity.CopyData<Tra_TraineeScoreModel>(); } model.ActionStatus = status; return model; }
public Eva_PerformanceEvaDetailModel GetById(Guid id) { string status = string.Empty; var model = new Eva_PerformanceEvaDetailModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Eva_PerformanceEvaDetailEntity>(id, ConstantSql.hrm_eva_sp_get_PerformanceEvaDetailById, ref status); if (entity != null) { model = entity.CopyData<Eva_PerformanceEvaDetailModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public Kai_RankMarkModel GetById(Guid id) { string status = string.Empty; var model = new Kai_RankMarkModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Kai_RankMarkEntity>(id, ConstantSql.hrm_kai_sp_get_RankMarkById, ref status);//note if (entity != null) { model = entity.CopyData<Kai_RankMarkModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// [Tho.Bui] - Lấy dữ liệu Quốc Gia(Cat_Country) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Sal_InsuranceSalaryModel GetById(Guid id) { string status = string.Empty; var model = new Sal_InsuranceSalaryModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Sal_InsuranceSalaryEntity>(id, ConstantSql.hrm_sal_sp_get_InsuranceSalaryById, ref status);//note if (entity != null) { model = entity.CopyData<Sal_InsuranceSalaryModel>(); } model.ActionStatus = status; return model; }
public Ins_InsuranceRecordModel GetById(Guid id) { string status = string.Empty; var model = new Ins_InsuranceRecordModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Ins_InsuranceRecordEntity>(id, ConstantSql.hrm_ins_sp_get_InsuranceRecordById, ref status); if (entity != null) { model = entity.CopyData<Ins_InsuranceRecordModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// [Chuc.Nguyen] - Lấy dữ liệu bảng Thai Sản(Att_Pregnancy) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Att_PregnancyModel GetById(Guid id) { string status = string.Empty; var model = new Att_PregnancyModel(); var service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Att_PregnancyEntity>(id, ConstantSql.hrm_att_sp_get_PregnancyById, ref status); if (entity != null) { model = entity.CopyData<Att_PregnancyModel>(); } model.ActionStatus = status; return model; }
public Sys_ConditionApprovedModel GetById(Guid id) { string status = string.Empty; var model = new Sys_ConditionApprovedModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Sys_ConditionApprovedEntity>(id, ConstantSql.hrm_sys_sp_get_ConditionApprovedById, ref status); if (entity!=null) { model = entity.CopyData<Sys_ConditionApprovedModel>(); } model.ActionStatus = status; return model; }
/// <summary> /// [Quoc.Do] - Lấy dữ liệu Mức Độ Trợ Cấp( Cat_UsualAllowanceLevel) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Cat_UsualAllowanceLevelModel GetById(Guid id) { string status = string.Empty; var model = new Cat_UsualAllowanceLevelModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Cat_UsualAllowanceLevelEntity>(id, ConstantSql.hrm_cat_sp_get_UsualAllowanceLevelById, ref status); if (entity!=null) { model = entity.CopyData<Cat_UsualAllowanceLevelModel>(); } model.ActionStatus = status; return model; }
// GET api/<controller>/5 public Sys_LockObjectModel Get(Guid id) { string status = string.Empty; var model = new Sys_LockObjectModel(); ActionService service = new ActionService(UserLogin); var cutOfServices = new Att_CutOffDurationServices(); var orgServices = new Cat_OrgStructureServices(); var entity = service.GetByIdUseStore <Sys_LockObjectEntity>(id, ConstantSql.hrm_sys_sp_get_LockObjectByID, ref status); List <object> listModel = new List <object>(); listModel.AddRange(new object[3]); listModel[1] = 1; listModel[2] = Int32.MaxValue - 1; List <Att_CutOffDurationEntity> listCutoffduration_All = cutOfServices.GetData <Att_CutOffDurationEntity>(listModel, ConstantSql.hrm_att_sp_get_CutOffDurations, UserLogin, ref status).ToList(); var objOrg = new List <object>(); objOrg.Add(null); objOrg.Add(null); objOrg.Add(null); objOrg.Add(1); objOrg.Add(int.MaxValue - 1); var lstOrg = orgServices.GetData <Cat_OrgStructureEntity>(objOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, UserLogin, ref status).ToList(); if (entity != null) { model = entity.CopyData <Sys_LockObjectModel>(); if (model.PayrollGroups != null) { model.lstPayrollGroupID = Common.GetListNumbersFromBinary(model.PayrollGroups); model.PayrollGroupID = string.Join(",", model.lstPayrollGroupID); } if (model.OrgStructures != null) { model.lstOrgStructureID = Common.GetListNumbersFromBinary(model.OrgStructures); var lstOrgName = lstOrg.Where(s => model.lstOrgStructureID.Contains(s.OrderNumber)).Select(s => s.OrgStructureName).ToList(); model.OrgStructureID = string.Join(",", model.lstOrgStructureID); model.OrgStructureName = string.Join(",", lstOrgName); } var cutOfDurationEntity = listCutoffduration_All.Where(s => s.DateEnd == model.DateEnd && s.DateStart == model.DateStart).FirstOrDefault(); if (cutOfDurationEntity != null) { model.CutOffDurationID = cutOfDurationEntity.ID; model.CutOffDurationName = cutOfDurationEntity.CutOffDurationName; } } model.ActionStatus = status; return(model); }