コード例 #1
0
        protected static FR_L6CO_GPOFPID_1440_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6CO_GPOFPID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L6CO_GPOFPID_1440_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_Lucentis_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_ProcurementOrder_For_PharmacyID.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "PharmacyID", Parameter.PharmacyID);



            List <L6CO_GPOFPID_1440_raw> results = new List <L6CO_GPOFPID_1440_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "Status_Code", "Status_Name_DictID", "ORD_PRC_ProcurementOrder_StatusID", "ORD_PRC_ProcurementOrder_HeaderID", "GlobalPropertyMatchingID", "ProcurementOrder_Number", "ProcurementOrder_Date", "HEC_Patient_TreatmentID", "HEC_Patient_Treatment_RequiredProductID", "CMN_COM_CompanyInfoID", "CMN_BPT_BusinessParticipantID", "DisplayName", "HEC_MedicalPractiseID", "ExpectedDateOfDelivery", "Product_Name_DictID", "ORD_PRC_ProcurementOrder_PositionID", "CMN_PRO_ProductID", "Position_OrdinalNumber", "Position_Quantity", "Position_ValuePerUnit", "Position_ValueTotal", "Position_Comment", "Product_Number", "Position_RequestedDateOfDelivery", "DoctorFirstName", "DoctorLastname", "DoctorTitle", "DoctorFirstNameScheduled", "DoctorLastnameScheduled", "DoctorTitleScheduled" });
                while (reader.Read())
                {
                    L6CO_GPOFPID_1440_raw resultItem = new L6CO_GPOFPID_1440_raw();
                    //0:Parameter Status_Code of type String
                    resultItem.Status_Code = reader.GetString(0);
                    //1:Parameter Status_Name of type Dict
                    resultItem.Status_Name             = reader.GetDictionary(1);
                    resultItem.Status_Name.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name);
                    //2:Parameter ORD_PRC_ProcurementOrder_StatusID of type Guid
                    resultItem.ORD_PRC_ProcurementOrder_StatusID = reader.GetGuid(2);
                    //3:Parameter ORD_PRC_ProcurementOrder_HeaderID of type Guid
                    resultItem.ORD_PRC_ProcurementOrder_HeaderID = reader.GetGuid(3);
                    //4:Parameter GlobalPropertyMatchingID of type String
                    resultItem.GlobalPropertyMatchingID = reader.GetString(4);
                    //5:Parameter ProcurementOrder_Number of type String
                    resultItem.ProcurementOrder_Number = reader.GetString(5);
                    //6:Parameter ProcurementOrder_Date of type DateTime
                    resultItem.ProcurementOrder_Date = reader.GetDate(6);
                    //7:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(7);
                    //8:Parameter HEC_Patient_Treatment_RequiredProductID of type Guid
                    resultItem.HEC_Patient_Treatment_RequiredProductID = reader.GetGuid(8);
                    //9:Parameter CMN_COM_CompanyInfoID of type Guid
                    resultItem.CMN_COM_CompanyInfoID = reader.GetGuid(9);
                    //10:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(10);
                    //11:Parameter DisplayName of type String
                    resultItem.DisplayName = reader.GetString(11);
                    //12:Parameter HEC_MedicalPractiseID of type Guid
                    resultItem.HEC_MedicalPractiseID = reader.GetGuid(12);
                    //13:Parameter ExpectedDateOfDelivery of type DateTime
                    resultItem.ExpectedDateOfDelivery = reader.GetDate(13);
                    //14:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(14);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //15:Parameter ORD_PRC_ProcurementOrder_PositionID of type Guid
                    resultItem.ORD_PRC_ProcurementOrder_PositionID = reader.GetGuid(15);
                    //16:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(16);
                    //17:Parameter Position_OrdinalNumber of type String
                    resultItem.Position_OrdinalNumber = reader.GetString(17);
                    //18:Parameter Position_Quantity of type String
                    resultItem.Position_Quantity = reader.GetString(18);
                    //19:Parameter Position_ValuePerUnit of type String
                    resultItem.Position_ValuePerUnit = reader.GetString(19);
                    //20:Parameter Position_ValueTotal of type String
                    resultItem.Position_ValueTotal = reader.GetString(20);
                    //21:Parameter Position_Comment of type String
                    resultItem.Position_Comment = reader.GetString(21);
                    //22:Parameter Product_Number of type String
                    resultItem.Product_Number = reader.GetString(22);
                    //23:Parameter Position_RequestedDateOfDelivery of type DateTime
                    resultItem.Position_RequestedDateOfDelivery = reader.GetDate(23);
                    //24:Parameter DoctorFirstName of type String
                    resultItem.DoctorFirstName = reader.GetString(24);
                    //25:Parameter DoctorLastname of type String
                    resultItem.DoctorLastname = reader.GetString(25);
                    //26:Parameter DoctorTitle of type String
                    resultItem.DoctorTitle = reader.GetString(26);
                    //27:Parameter DoctorFirstNameScheduled of type String
                    resultItem.DoctorFirstNameScheduled = reader.GetString(27);
                    //28:Parameter DoctorLastnameScheduled of type String
                    resultItem.DoctorLastnameScheduled = reader.GetString(28);
                    //29:Parameter DoctorTitleScheduled of type String
                    resultItem.DoctorTitleScheduled = reader.GetString(29);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_ProcurementOrder_For_PharmacyID", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L6CO_GPOFPID_1440_raw.Convert(results).ToArray();
            return(returnStatus);
        }
コード例 #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L6CO_GPOFPID_1440_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L6CO_GPOFPID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
コード例 #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6CO_GPOFPID_1440_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6CO_GPOFPID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6CO_GPOFPID_1440_Array functionReturn = new FR_L6CO_GPOFPID_1440_Array();

            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_ProcurementOrder_For_PharmacyID", ex);
            }
            return(functionReturn);
        }
コード例 #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L6CO_GPOFPID_1440_Array Invoke(string ConnectionString, P_L6CO_GPOFPID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }