///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6AT_GFAMDfTID Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6AT_GFAMDfTID functionReturn = new FR_L6AT_GFAMDfTID(); 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_FilteredAppointmentMainData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L6AT_GFAMDfTID Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L6AT_GFAMDfTID(); returnValue.Result = new L6AT_GFAMDfTID(); List <L5AP_GAMDfTID_1035> appointmentLIst = new List <L5AP_GAMDfTID_1035>(); var notFilteredAppointments = cls_Get_AppointmentMainData_for_TenantID.Invoke(Connection, Transaction, new P_L5AP_GAMDfTID_1035() { AvaPropertyMatchingID = EnumUtils.GetEnumDescription(AvailabilityType.Standard) }, securityTicket).Result; foreach (var item in notFilteredAppointments) { L5AP_GAMDfTID_1035 appointment = new L5AP_GAMDfTID_1035(); appointment.PatientID = item.PatientID; 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; appointment.PatientEmail = item.PatientEmail; List <L5AP_GAMDfTID_1035_Doctor> Doctor = item.Doctor.Where(i => i.DoctorFlag != null).ToList(); appointment.Doctor = Doctor.ToArray(); List <L5AP_GAMDfTID_1035_RequiredDoctor> RequiredDocor = item.RequiredDoctor.Where(i => i.RequiredDoctorFlag != null).ToList(); appointment.RequiredDoctor = RequiredDocor.ToArray(); appointmentLIst.Add(appointment); } returnValue.Result.Appointment = appointmentLIst.ToArray(); return(returnValue); #endregion UserCode }