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

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_Treatments.Complex.Retrieval.SQL.cls_Get_Treatment_for_PatientID.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, "PatientID", Parameter.PatientID);



            List <L5TR_GTfPID_1045_raw> results = new List <L5TR_GTfPID_1045_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[] { "IsTreatmentPerformed", "IfTreatmentPerformed_Date", "IsTreatmentFollowup", "IsScheduled", "IfSheduled_Date", "IsTreatmentBilled", "IfTreatmentBilled_Date", "HEC_Patient_TreatmentID", "IsTreatmentOfLeftEye", "IsTreatmentOfRightEye", "Treatment_PracticeID", "Treatment_Performed_by_DoctorID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID", "Status_Name_DictID", "ArticleDate", "ExpectedDateOfDelivery", "HEC_Patient_Treatment_RequiredProductID", "BoundTo_CustomerOrderPosition_RefID", "PharmacyID", "FollowUp_ID", "IsFollowUPPerformed", "IfFollowUpPerformed_Date", "IfFollowUpSheduled_Date", "Followup_PracticeID", "Followup_Performed_by_DoctorID", "Followup_Scheduled_for_DoctorID" });
                while (reader.Read())
                {
                    L5TR_GTfPID_1045_raw resultItem = new L5TR_GTfPID_1045_raw();
                    //0:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(0);
                    //1:Parameter IfTreatmentPerformed_Date of type DateTime
                    resultItem.IfTreatmentPerformed_Date = reader.GetDate(1);
                    //2:Parameter IsTreatmentFollowup of type bool
                    resultItem.IsTreatmentFollowup = reader.GetBoolean(2);
                    //3:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(3);
                    //4:Parameter IfSheduled_Date of type DateTime
                    resultItem.IfSheduled_Date = reader.GetDate(4);
                    //5:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(5);
                    //6:Parameter IfTreatmentBilled_Date of type DateTime
                    resultItem.IfTreatmentBilled_Date = reader.GetDate(6);
                    //7:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(7);
                    //8:Parameter IsTreatmentOfLeftEye of type bool
                    resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(8);
                    //9:Parameter IsTreatmentOfRightEye of type bool
                    resultItem.IsTreatmentOfRightEye = reader.GetBoolean(9);
                    //10:Parameter Treatment_PracticeID of type Guid
                    resultItem.Treatment_PracticeID = reader.GetGuid(10);
                    //11:Parameter Treatment_Performed_by_DoctorID of type Guid
                    resultItem.Treatment_Performed_by_DoctorID = reader.GetGuid(11);
                    //12:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(12);
                    //13:Parameter Product_Number of type string
                    resultItem.Product_Number = reader.GetString(13);
                    //14:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(14);
                    //15:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(15);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //16:Parameter Status_Name_DictID of type Dict
                    resultItem.Status_Name_DictID             = reader.GetDictionary(16);
                    resultItem.Status_Name_DictID.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name_DictID);
                    //17:Parameter ArticleDate of type DateTime
                    resultItem.ArticleDate = reader.GetDate(17);
                    //18:Parameter ExpectedDateOfDelivery of type DateTime
                    resultItem.ExpectedDateOfDelivery = reader.GetDate(18);
                    //19:Parameter HEC_Patient_Treatment_RequiredProductID of type Guid
                    resultItem.HEC_Patient_Treatment_RequiredProductID = reader.GetGuid(19);
                    //20:Parameter BoundTo_CustomerOrderPosition_RefID of type Guid
                    resultItem.BoundTo_CustomerOrderPosition_RefID = reader.GetGuid(20);
                    //21:Parameter PharmacyID of type Guid
                    resultItem.PharmacyID = reader.GetGuid(21);
                    //22:Parameter FollowUp_ID of type Guid
                    resultItem.FollowUp_ID = reader.GetGuid(22);
                    //23:Parameter IsFollowUPPerformed of type bool
                    resultItem.IsFollowUPPerformed = reader.GetBoolean(23);
                    //24:Parameter IfFollowUpPerformed_Date of type DateTime
                    resultItem.IfFollowUpPerformed_Date = reader.GetDate(24);
                    //25:Parameter IfFollowUpSheduled_Date of type DateTime
                    resultItem.IfFollowUpSheduled_Date = reader.GetDate(25);
                    //26:Parameter Followup_PracticeID of type Guid
                    resultItem.Followup_PracticeID = reader.GetGuid(26);
                    //27:Parameter Followup_Performed_by_DoctorID of type Guid
                    resultItem.Followup_Performed_by_DoctorID = reader.GetGuid(27);
                    //28:Parameter Followup_Scheduled_for_DoctorID of type Guid
                    resultItem.Followup_Scheduled_for_DoctorID = reader.GetGuid(28);

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

            returnStatus.Result = L5TR_GTfPID_1045_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_L5TR_GTfPID_1045_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5TR_GTfPID_1045 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_L5TR_GTfPID_1045_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5TR_GTfPID_1045 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

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