///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6AT_GFAWMDfTID Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6AT_GFAWMDfTID functionReturn = new FR_L6AT_GFAWMDfTID(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, 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 { } throw new Exception("Exception occured in method cls_Get_FilteredAppointmentWebMainData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L6AT_GFAWMDfTID Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_L6AT_GFAWMDfTID(); returnValue.Result = new L6AT_GFAWMDfTID(); //List<L5AP_GAWMDfTID_1101> appointmentLIst = new List<L5AP_GAWMDfTID_1101>(); var notFilteredAppointments = cls_Get_AppointmentWebMainData_for_TenantID.Invoke(Connection, Transaction, new P_L5AP_GAWMDfTID_1101 { Type = EnumUtils.GetEnumDescription(EComunactionContactType.Phone), TaskType = EnumUtils.GetEnumDescription(AvailabilityType.WebBooking) }, securityTicket).Result; foreach (var item in notFilteredAppointments) { //L5AP_GAWMDfTID_1101 appointment = new L5AP_GAWMDfTID_1101(); //appointment.DisplayName = item.DisplayName; //appointment.Office_Name = item.Office_Name; //appointment.PatientBirthDay = item.PatientBirthDay; //appointment.PatientFirstName = item.PatientFirstName; //appointment.PatientLastName = item.PatientLastName; //appointment.PlannedStartDate = item.PlannedStartDate; //appointment.PPS_TSK_TaskID = item.PPS_TSK_TaskID; //appointment.TaskTemplateName = item.TaskTemplateName; //appointment.AcademicTitle = item.AcademicTitle; //appointment.PlannedDuration_in_sec = item.PlannedDuration_in_sec; List <L5AP_GAWMDfTID_1101_Doctor> Doctor = item.Doctor.Where(i => i.DoctorFlag != null).ToList(); item.Doctor = Doctor.ToArray(); List <L5AP_GAWMDfTID_1101_RequiredDoctor> RequiredDocor = item.RequiredDoctor.Where(i => i.RequiredDoctorFlag != null).ToList(); item.RequiredDoctor = RequiredDocor.ToArray(); //appointmentLIst.Add(item); } returnValue.Result.Appointment = notFilteredAppointments; // appointmentLIst.ToArray(); return(returnValue); #endregion UserCode }