protected static FR_DO_GPDD_1137 Execute(DbConnection Connection, DbTransaction Transaction, P_DO_GPDD_1137 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_DO_GPDD_1137(); returnValue.Result = new DO_GPDD_1137(); DO_GPDD_1137 doctor_detail = new DO_GPDD_1137(); var data = cls_Get_Doctor_Details_for_DoctorID.Invoke(Connection, Transaction, new P_DO_GDDfDID_0823 { DoctorID = Parameter.ID }, securityTicket).Result.Single(); doctor_detail.address = data.address; doctor_detail.practice = data.practice; doctor_detail.bank_name = data.BankName; doctor_detail.bic = data.BICCode; if (data.DoctorComunication.Where(k => k.Type == "Phone").SingleOrDefault() != null) { doctor_detail.phone = data.DoctorComunication.Where(k => k.Type == "Phone").Single().Content; } doctor_detail.iban = data.IBAN; doctor_detail.id = data.id.ToString(); doctor_detail.lanr = data.lanr; doctor_detail.first_name = data.first_name; doctor_detail.practice_id = data.practice_id.ToString(); doctor_detail.last_name = data.last_name; doctor_detail.title = data.title; if (data.DoctorComunication.Where(k => k.Type == "Email").SingleOrDefault() != null) { doctor_detail.email = data.DoctorComunication.Where(k => k.Type == "Email").Single().Content; } var practice_bank_info = cls_Get_BankInfo_for_Practice.Invoke(Connection, Transaction, new P_DO_GBAfPR_1524() { PracticeID = data.practice_id }, securityTicket).Result.FirstOrDefault(); if (practice_bank_info != null) { var doctor_bank_info = cls_Get_BankInfo_for_DoctorID.Invoke(Connection, Transaction, new P_DO_BBIfDID_1424() { DoctorID = data.id }, securityTicket).Result; if (doctor_bank_info != null) { doctor_detail.is_bank_inherited = doctor_bank_info.BankAccountID == practice_bank_info.BankAccountID; } } doctor_detail.login_email = data.sign_in_email; doctor_detail.account_holder = data.OwnerText; doctor_detail.password = "******"; doctor_detail.salutation = data.salutation; returnValue.Result = doctor_detail; return(returnValue); #endregion UserCode }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_DO_GPDD_1137 Invoke(DbConnection Connection, DbTransaction Transaction, P_DO_GPDD_1137 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_DO_GPDD_1137 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_DO_GPDD_1137 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_DO_GPDD_1137 functionReturn = new FR_DO_GPDD_1137(); 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 { } throw new Exception("Exception occured in method cls_Get_Doctor_DetailData", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_DO_GPDD_1137 Invoke(string ConnectionString, P_DO_GPDD_1137 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }