///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5MD_GDwPfID_1414 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5MD_GDwPfID_1414 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5MD_GDwPfID_1414 functionReturn = new FR_L5MD_GDwPfID_1414(); 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_withPractice_byID", ex); } return(functionReturn); }
protected static FR_L5MD_GDwPfID_1414 Execute(DbConnection Connection, DbTransaction Transaction, P_L5MD_GDwPfID_1414 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5MD_GDwPfID_1414(); P_L3MD_GDBIfID_1150 biParam = new P_L3MD_GDBIfID_1150(); biParam.DoctorID = Parameter.DoctorID; var baseInfo = cls_Get_Doctor_BaseInfo_byID.Invoke(Connection, Transaction, biParam, securityTicket).Result; returnValue.Result = new L5MD_GDwPfID_1414(); returnValue.Result.BaseInfo = baseInfo; P_L3DAC_RACDbBPID_1056 aiParam = new P_L3DAC_RACDbBPID_1056(); aiParam.BPrticipantID = baseInfo.Doctor_CMN_BPT_BusinessParticipantID; var accInfo = cls_Retrive_Account_Code_Details_byBParticipantID.Invoke(Connection, Transaction, aiParam, securityTicket).Result; if (accInfo != null) { var AccountInfo = new L5MD_GDwPfID_1414_AccountInfo(); AccountInfo.AccountCode_ValidFrom = accInfo.AccountCode_ValidFrom; AccountInfo.AccountCode_Value = accInfo.AccountCode_Value; AccountInfo.USR_AccountID = baseInfo.Account_RefID; AccountInfo.USR_Device_AccountCodeID = accInfo.USR_Device_AccountCodeID; returnValue.Result.AccountInfo = AccountInfo; } var customerQuery = new ORM_CMN_BPT_CTM_Customer.Query(); customerQuery.Ext_BusinessParticipant_RefID = baseInfo.Doctor_CMN_BPT_BusinessParticipantID; customerQuery.IsDeleted = false; var customerRes = ORM_CMN_BPT_CTM_Customer.Query.Search(Connection, Transaction, customerQuery); if (customerRes.Count > 0) { var ORM_CMN_BPT_CTM_Customer_2_SalesRepresentativeQuery = new ORM_CMN_BPT_CTM_Customer_2_SalesRepresentative.Query(); ORM_CMN_BPT_CTM_Customer_2_SalesRepresentativeQuery.Customer_RefID = customerRes.First().CMN_BPT_CTM_CustomerID; ORM_CMN_BPT_CTM_Customer_2_SalesRepresentativeQuery.IsDeleted = false; var ORM_CMN_BPT_CTM_Customer_2_SalesRepresentative1 = ORM_CMN_BPT_CTM_Customer_2_SalesRepresentative.Query.Search(Connection, Transaction, ORM_CMN_BPT_CTM_Customer_2_SalesRepresentativeQuery).First(); returnValue.Result.SalesRepresentative = new L5MD_GDwPfID_1414_SalesRepresentative(); returnValue.Result.SalesRepresentative.SalesRepresentative_RefID = ORM_CMN_BPT_CTM_Customer_2_SalesRepresentative1.SalesRepresentative_RefID; } var assocBPQuery = new ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant.Query(); assocBPQuery.BusinessParticipant_RefID = baseInfo.Doctor_CMN_BPT_BusinessParticipantID; assocBPQuery.IsDeleted = false; var assocBPQs = ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant.Query.Search(Connection, Transaction, assocBPQuery).ToArray(); if (assocBPQs.Length > 0) { assocBPQs = assocBPQs.OrderBy(a => a.Creation_Timestamp).ToArray(); var assocBPQ = assocBPQs.First(); var practiceBPQuery = new ORM_CMN_BPT_BusinessParticipant.Query(); practiceBPQuery.CMN_BPT_BusinessParticipantID = assocBPQ.AssociatedBusinessParticipant_RefID; var practiceBP = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, practiceBPQuery).First(); var companInfoQuery = new ORM_CMN_COM_CompanyInfo.Query(); companInfoQuery.CMN_COM_CompanyInfoID = practiceBP.IfCompany_CMN_COM_CompanyInfo_RefID; var companInfo = ORM_CMN_COM_CompanyInfo.Query.Search(Connection, Transaction, companInfoQuery).First(); var practiceQuery = new ORM_HEC_MedicalPractis.Query(); practiceQuery.Ext_CompanyInfo_RefID = companInfo.CMN_COM_CompanyInfoID; var prac = ORM_HEC_MedicalPractis.Query.Search(Connection, Transaction, practiceQuery).First(); P_L3MP_GPfID_1222 pbiParam = new P_L3MP_GPfID_1222(); pbiParam.HEC_MedicalPractiseID = prac.HEC_MedicalPractiseID; var practiceBasInfo = cls_Get_Practice_For_ID.Invoke(Connection, Transaction, pbiParam, securityTicket).Result; if (practiceBasInfo != null) { L5MD_GDwPfID_1414_Practice practice = new L5MD_GDwPfID_1414_Practice(); practice.AssociatedParticipant_FunctionName = assocBPQ.AssociatedParticipant_FunctionName; practice.CMN_BPT_BusinessParticipantID = practiceBasInfo.BaseInfo.CMN_BPT_BusinessParticipantID; if (practiceBasInfo.OtherOphthal_PracticeData != null) { practice.HealthAssociation_Name = practiceBasInfo.OtherOphthal_PracticeData.HealthAssociation_Name; } practice.PracticeID = practiceBasInfo.BaseInfo.HEC_MedicalPractiseID; practice.PracticeName = practiceBasInfo.BaseInfo.PracticeName; practice.Region_Name = practiceBasInfo.BaseInfo.Region_Name; practice.Street_Name = practiceBasInfo.BaseInfo.Street_Name; practice.Street_Number = practiceBasInfo.BaseInfo.Street_Number; practice.Town = practiceBasInfo.BaseInfo.Town; practice.ZIP = practiceBasInfo.BaseInfo.ZIP; returnValue.Result.Practice = practice; } } return(returnValue); #endregion UserCode }