///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DWS_GDWSWDFT_0946_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DWS_GDWSWDFT_0946 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DWS_GDWSWDFT_0946_Array functionReturn = new FR_L5DWS_GDWSWDFT_0946_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } Guid errorID = Guid.NewGuid(); ServerLog.Instance.Fatal("Application error occured. ErrorID = " + errorID, ex); throw new Exception("Exception occured in method cls_Get_DailyWorkSchedules_WithDetails_For_Date", ex); } return(functionReturn); }
protected static FR_L5DWS_GDWSWDFT_0946_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DWS_GDWSWDFT_0946 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5DWS_GDWSWDFT_0946_Array(); //Put your code here ORM_CMN_STR_PPS_DailyWorkSchedule.Query scheduleQuery = new ORM_CMN_STR_PPS_DailyWorkSchedule.Query(); scheduleQuery.Tenant_RefID = securityTicket.TenantID; scheduleQuery.IsDeleted = false; scheduleQuery.WorkSheduleDate = Parameter.WorkSheduleDate.Date; List <ORM_CMN_STR_PPS_DailyWorkSchedule> workSechedules = ORM_CMN_STR_PPS_DailyWorkSchedule.Query.Search(Connection, Transaction, scheduleQuery); var scheduleList = new List <L5DWS_GDWSWDFT_0946>(); foreach (var workSchedule in workSechedules) { var resultItem = new L5DWS_GDWSWDFT_0946(); resultItem.BreakDurationTime_in_sec = workSchedule.BreakDurationTime_in_sec; resultItem.CMN_STR_PPS_DailyWorkScheduleID = workSchedule.CMN_STR_PPS_DailyWorkScheduleID; resultItem.ContractWorkerText = workSchedule.ContractWorkerText; resultItem.Employee_RefID = workSchedule.Employee_RefID; resultItem.InstantiatedWithShiftTemplate_RefID = workSchedule.InstantiatedWithShiftTemplate_RefID; resultItem.IsBreakTimeManualySpecified = workSchedule.IsBreakTimeManualySpecified; resultItem.IsWorkShedule_Confirmed = workSchedule.IsWorkShedule_Confirmed; resultItem.R_ContractSpecified_WorkingTime_in_sec = workSchedule.R_ContractSpecified_WorkingTime_in_sec; resultItem.R_WorkDay_Duration_in_sec = workSchedule.R_WorkDay_Duration_in_sec; resultItem.R_WorkDay_End_in_sec = workSchedule.R_WorkDay_End_in_sec; resultItem.R_WorkDay_Start_in_sec = workSchedule.R_WorkDay_Start_in_sec; resultItem.SheduleBreakTemplate_RefID = workSchedule.SheduleBreakTemplate_RefID; resultItem.WorkingSheduleComment = workSchedule.WorkingSheduleComment; resultItem.WorkShedule_ConfirmedBy_Account_RefID = workSchedule.WorkShedule_ConfirmedBy_Account_RefID; resultItem.WorkSheduleDate = workSchedule.WorkSheduleDate; P_L5DWS_GDWSDFDWSID_1156 par = new P_L5DWS_GDWSDFDWSID_1156(); par.DailyWorkScheduleID = workSchedule.CMN_STR_PPS_DailyWorkScheduleID; List <L5DWS_GDWSDFDWSID_1156> details = cls_Get_DailyWorkSchedule_Detail_For_DailyWorkScheduleID.Invoke(Connection, Transaction, par, securityTicket).Result.ToList(); List <L5DWS_GDWSWDFT_0946_Detail> resultDetails = new List <L5DWS_GDWSWDFT_0946_Detail>(); foreach (var detail in details) { L5DWS_GDWSWDFT_0946_Detail resultDetail = new L5DWS_GDWSWDFT_0946_Detail(); resultDetail.AbsenceReason_RefID = detail.AbsenceReason_RefID; resultDetail.CMN_CAL_Event_RefID = detail.CMN_CAL_Event_RefID; resultDetail.CMN_STR_PPS_DailyWorkSchedule_DetailID = detail.CMN_STR_PPS_DailyWorkSchedule_DetailID; resultDetail.FromTime_as_DateTime = detail.FromTime_as_DateTime; resultDetail.FromTime_as_time = detail.FromTime_as_time; resultDetail.IsWorkBreak = detail.IsWorkBreak; resultDetail.SheduleForWorkplace_RefID = detail.SheduleForWorkplace_RefID; resultDetail.TotalWorkTime_as_time = detail.TotalWorkTime_as_time; resultDetail.ToTime_as_DateTime = detail.ToTime_as_DateTime; resultDetail.ToTime_as_time = detail.ToTime_as_time; resultDetail.LeaveRequest_RefID = detail.LeaveRequest_RefID; resultDetails.Add(resultDetail); } resultItem.Details = resultDetails.ToArray(); P_L5DWS_GEWTFD_1648 param = new P_L5DWS_GEWTFD_1648(); param.currentDate = Parameter.WorkSheduleDate.Date; scheduleList.Add(resultItem); } returnValue.Result = scheduleList.ToArray(); return(returnValue); #endregion UserCode }