protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_CIEIM_1235 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); ORM_CMN_STR_Office_ResponsiblePerson.Query officeQuery = new ORM_CMN_STR_Office_ResponsiblePerson.Query(); officeQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; officeQuery.IsDeleted = false; if (ORM_CMN_STR_Office_ResponsiblePerson.Query.Exists(Connection, Transaction, officeQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query workAreaQuery = new ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query(); workAreaQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; workAreaQuery.IsDeleted = false; if (ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query.Exists(Connection, Transaction, workAreaQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query workPlaceQuery = new ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query(); workPlaceQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; workPlaceQuery.IsDeleted = false; if (ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query.Exists(Connection, Transaction, workPlaceQuery)) { returnValue.Result = true; } //Put your code here return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5WP_IWPU_1503 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); //Put your code here ORM_CMN_BPT_EMP_Employee_PlanGroup.Query planGroupQuery = new ORM_CMN_BPT_EMP_Employee_PlanGroup.Query(); planGroupQuery.BoundTo_WorkPlace_RefID = Parameter.WorkplaceID; planGroupQuery.IsDeleted = false; planGroupQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_BPT_EMP_Employee_PlanGroup.Query.Exists(Connection, Transaction, planGroupQuery)) { returnValue.Result = true; } ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query extraWorkCalculationQuery = new ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query(); extraWorkCalculationQuery.BoundTo_Workplace_RefID = Parameter.WorkplaceID; extraWorkCalculationQuery.IsDeleted = false; extraWorkCalculationQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_BPT_EMP_ExtraWorkCalculation_StructureBinding.Query.Exists(Connection, Transaction, extraWorkCalculationQuery)) { returnValue.Result = true; } ORM_CMN_BPT_EMP_ExtraWorkCalculation_Surcharge_StructureBinding.Query surchargeQuery = new ORM_CMN_BPT_EMP_ExtraWorkCalculation_Surcharge_StructureBinding.Query(); surchargeQuery.BoundTo_Workplace_RefID = Parameter.WorkplaceID; surchargeQuery.IsDeleted = false; surchargeQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_BPT_EMP_ExtraWorkCalculation_Surcharge_StructureBinding.Query.Exists(Connection, Transaction, surchargeQuery)) { returnValue.Result = true; } ORM_CMN_BPT_EMP_Employee.Query employeeQuery = new ORM_CMN_BPT_EMP_Employee.Query(); employeeQuery.Primary_Workplace_RefID = Parameter.WorkplaceID; employeeQuery.IsDeleted = false; employeeQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_BPT_EMP_Employee.Query.Exists(Connection, Transaction, employeeQuery)) { returnValue.Result = true; } ORM_CMN_PPS_ShiftTemplate.Query shiftTemplateQuery = new ORM_CMN_PPS_ShiftTemplate.Query(); shiftTemplateQuery.CMN_STR_Workplace_RefID = Parameter.WorkplaceID; shiftTemplateQuery.IsDeleted = false; shiftTemplateQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_PPS_ShiftTemplate.Query.Exists(Connection, Transaction, shiftTemplateQuery)) { returnValue.Result = true; } ORM_CMN_PPS_BreakTime_Defaults_StructureBinding.Query defaultBreakQuery = new ORM_CMN_PPS_BreakTime_Defaults_StructureBinding.Query(); defaultBreakQuery.BoundTo_Workplace_RefID = Parameter.WorkplaceID; defaultBreakQuery.IsDeleted = false; defaultBreakQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_PPS_BreakTime_Defaults_StructureBinding.Query.Exists(Connection, Transaction, defaultBreakQuery)) { returnValue.Result = true; } ORM_CMN_PPS_BreakTime_Template.Query breakTimeTemplateQuery = new ORM_CMN_PPS_BreakTime_Template.Query(); breakTimeTemplateQuery.BoundTo_Workplace_RefID = Parameter.WorkplaceID; breakTimeTemplateQuery.IsDeleted = false; breakTimeTemplateQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_PPS_BreakTime_Template.Query.Exists(Connection, Transaction, breakTimeTemplateQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query WorkplaceResponsiblePersonQuery = new ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query(); WorkplaceResponsiblePersonQuery.Workplace_RefID = Parameter.WorkplaceID; WorkplaceResponsiblePersonQuery.IsDeleted = false; WorkplaceResponsiblePersonQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query.Exists(Connection, Transaction, WorkplaceResponsiblePersonQuery)) { returnValue.Result = true; } ORM_CMN_BPT_EMP_EffectiveWorkTime_Position.Query WorkplaceEffectiveWorkTimePositionQuery = new ORM_CMN_BPT_EMP_EffectiveWorkTime_Position.Query(); WorkplaceEffectiveWorkTimePositionQuery.Workplace_RefID = Parameter.WorkplaceID; WorkplaceEffectiveWorkTimePositionQuery.IsDeleted = false; WorkplaceEffectiveWorkTimePositionQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_BPT_EMP_EffectiveWorkTime_Position.Query.Exists(Connection, Transaction, WorkplaceEffectiveWorkTimePositionQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_DailyWorkSchedule_Detail.Query WorkplaceDailyScheduleQuery = new ORM_CMN_STR_PPS_DailyWorkSchedule_Detail.Query(); WorkplaceDailyScheduleQuery.SheduleForWorkplace_RefID = Parameter.WorkplaceID; WorkplaceDailyScheduleQuery.IsDeleted = false; WorkplaceDailyScheduleQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_STR_PPS_DailyWorkSchedule_Detail.Query.Exists(Connection, Transaction, WorkplaceDailyScheduleQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_WorkDetail_Activity.Query WorkplaceWorkDetailActivityQuery = new ORM_CMN_STR_PPS_WorkDetail_Activity.Query(); WorkplaceWorkDetailActivityQuery.CMN_STR_PPS_Workplace_RefID = Parameter.WorkplaceID; WorkplaceWorkDetailActivityQuery.IsDeleted = false; WorkplaceWorkDetailActivityQuery.Tenant_RefID = securityTicket.TenantID; if (ORM_CMN_STR_PPS_WorkDetail_Activity.Query.Exists(Connection, Transaction, WorkplaceWorkDetailActivityQuery)) { returnValue.Result = true; } return(returnValue); #endregion UserCode }
protected static FR_L5WP_GWPFWPID_1132 Execute(DbConnection Connection, DbTransaction Transaction, P_L5WP_GWPFWPID_1132 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5WP_GWPFWPID_1132(); returnValue.Result = new L5WP_GWPFWPID_1132(); L5WP_GWFT_1203 result = new L5WP_GWFT_1203(); ORM_CMN_STR_PPS_Workplace item = new ORM_CMN_STR_PPS_Workplace(); if (Parameter.workplaceID != Guid.Empty) { var resultWorkplace = item.Load(Connection, Transaction, Parameter.workplaceID); if (resultWorkplace.Status != FR_Status.Success || item.CMN_STR_PPS_WorkplaceID == Guid.Empty) { var error = new FR_Guid(); error.ErrorMessage = "No Such ID"; error.Status = FR_Status.Error_Internal; return(null); } } result.CMN_CAL_CalendarInstance_RefID = item.CMN_CAL_CalendarInstance_RefID; result.CMN_STR_PPS_WorkplaceID = item.CMN_STR_PPS_WorkplaceID; result.ShortName = item.ShortName; result.WorkArea_RefID = item.WorkArea_RefID; result.WorkPlaceDescription = item.Description; result.WorkPlaceName = item.Name; var responsiblePersonsQuery = new ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query(); responsiblePersonsQuery.Tenant_RefID = securityTicket.TenantID; responsiblePersonsQuery.Workplace_RefID = item.CMN_STR_PPS_WorkplaceID; responsiblePersonsQuery.IsDeleted = false; var responsiblePersonsList = ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query.Search(Connection, Transaction, responsiblePersonsQuery); List <L5WP_GWFT_1203_ResponsiblePerson> responsiblePresonsResultList = new List <L5WP_GWFT_1203_ResponsiblePerson>(); foreach (var responsiblePerson in responsiblePersonsList) { L5WP_GWFT_1203_ResponsiblePerson responsiblePersonResult = new L5WP_GWFT_1203_ResponsiblePerson(); responsiblePersonResult.CMN_BPT_EMP_EmployeeID = responsiblePerson.CMN_BPT_EMP_Employee_RefID; responsiblePersonResult.CMN_STR_PPS_Workplace_ResponsiblePersonID = responsiblePerson.CMN_STR_PPS_Workplace_ResponsiblePersonID; ORM_CMN_BPT_EMP_Employee employee = new ORM_CMN_BPT_EMP_Employee(); employee.Load(Connection, Transaction, responsiblePerson.CMN_BPT_EMP_Employee_RefID); ORM_CMN_BPT_BusinessParticipant bParticipant = new ORM_CMN_BPT_BusinessParticipant(); bParticipant.Load(Connection, Transaction, employee.BusinessParticipant_RefID); ORM_CMN_PER_PersonInfo person = new ORM_CMN_PER_PersonInfo(); person.Load(Connection, Transaction, bParticipant.IfNaturalPerson_CMN_PER_PersonInfo_RefID); responsiblePersonResult.CMN_BPT_BusinessParticipantID = bParticipant.CMN_BPT_BusinessParticipantID; responsiblePersonResult.FirstName = person.FirstName; responsiblePersonResult.LastName = person.LastName; responsiblePersonResult.CMN_PER_PersonInfoID = person.CMN_PER_PersonInfoID; responsiblePresonsResultList.Add(responsiblePersonResult); } result.ResponsiblePersons = responsiblePresonsResultList.ToArray(); returnValue.Result.workplace = result; //Put your code here return(returnValue); #endregion UserCode }