Exemplo n.º 1
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5PP_GPFTIDaPIDA_1406 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5PP_GPFTIDaPIDA_1406 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Exemplo n.º 2
0
        protected static FR_L5PP_GPFTIDaPIDA_1406 Execute(DbConnection Connection, DbTransaction Transaction, P_L5PP_GPFTIDaPIDA_1406 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5PP_GPFTIDaPIDA_1406();

            returnValue.Result = new L5PP_GPFTIDaPIDA_1406();
            returnValue.Result.ContactPerson = new L3MP_GPCPfPID_1155();
            returnValue.Result.PracticeData  = new L3MP_GPBIfID_1131();
            List <L3MP_GCPfPBITID_1228> copPractices = new List <L3MP_GCPfPBITID_1228>();
            returnValue.Result.CooperatingPractices = copPractices.ToArray();

            P_L3MP_GPBIfID_1131 par = new P_L3MP_GPBIfID_1131();
            par.HEC_MedicalPractiseID = Parameter.PracticeID;

            L3MP_GPBIfID_1131 PracticeData = cls_Get_Practice_BaseInfo_For_ID.Invoke(Connection, Transaction, par, securityTicket).Result;

            returnValue.Result.PracticeData = PracticeData;

            P_L3MP_GPCPfPID_1155 param = new P_L3MP_GPCPfPID_1155();
            param.CMN_BPT_BusinessParticipantID = PracticeData.ContactPerson_RefID;

            L3MP_GPCPfPID_1155 ContactPerson = cls_Get_Practice_ContactPerson_For_PersonID.Invoke(Connection, Transaction, param, securityTicket).Result;

            returnValue.Result.ContactPerson = ContactPerson;


            P_L3MP_GCPfPBITID_1228 parameter = new P_L3MP_GCPfPBITID_1228();
            parameter.PracticeBussinessParticipant_RefID = PracticeData.CMN_BPT_BusinessParticipantID;

            List <L3MP_GCPfPBITID_1228> CooperatingPractices = cls_Get_CooperatingPractices_For_PracticeBussinessID_and_TenantID.Invoke(Connection, Transaction, parameter, securityTicket).Result.ToList();

            returnValue.Result.CooperatingPractices = CooperatingPractices.ToArray();

            return(returnValue);

            #endregion UserCode
        }
Exemplo n.º 3
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5PP_GPFTIDaPIDA_1406 Invoke(string ConnectionString, P_L5PP_GPFTIDaPIDA_1406 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Exemplo n.º 4
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5PP_GPFTIDaPIDA_1406 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5PP_GPFTIDaPIDA_1406 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5PP_GPFTIDaPIDA_1406 functionReturn = new FR_L5PP_GPFTIDaPIDA_1406();

            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_GetPractice_for_TenantID_and_PraciceID_Admin", ex);
            }
            return(functionReturn);
        }