Ejemplo n.º 1
0
        protected static FR_L5BL_GPDfBE_1635 Execute(DbConnection Connection, DbTransaction Transaction, P_L5BL_GPDfBE_1635 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5BL_GPDfBE_1635();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOBilling_Bill.Atomic.Retrieval.SQL.cls_Get_PreloadingData_for_BillEdit.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, "BillHeaderID", Parameter.BillHeaderID);



            List <L5BL_GPDfBE_1635_raw> results = new List <L5BL_GPDfBE_1635_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[] { "BIL_BillHeaderID", "BillRecipient_BuisnessParticipant_RefID", "CreatedBy_BusinessParticipant_RefID", "BillNumber", "BillComment", "BillHeader_PaymentCondition_RefID", "ACC_PAY_Type_RefID", "DateOnBill", "BillingAddress_UCD_RefID", "CMN_UniversalContactDetailID", "CompanyName_Line1", "First_Name", "Last_Name", "Country_Name", "Country_639_1_ISOCode", "Street_Name", "Street_Number", "ZIP", "Town", "Tenant_RefID", "TotalValue_BeforeTax", "TotalValue_IncludingTax", "Status_AssignmentID", "CMN_BPT_CTM_CustomerID", "Symbol", "ISO4127", "NotesNumber", "BIL_BillStatusID", "Status_GlobalPropertyMatchingID", "BillStatus_Name_DictID", "IsCurrentStatus" });
                while (reader.Read())
                {
                    L5BL_GPDfBE_1635_raw resultItem = new L5BL_GPDfBE_1635_raw();
                    //0:Parameter BIL_BillHeaderID of type Guid
                    resultItem.BIL_BillHeaderID = reader.GetGuid(0);
                    //1:Parameter BillRecipient_BuisnessParticipant_RefID of type Guid
                    resultItem.BillRecipient_BuisnessParticipant_RefID = reader.GetGuid(1);
                    //2:Parameter CreatedBy_BusinessParticipant_RefID of type Guid
                    resultItem.CreatedBy_BusinessParticipant_RefID = reader.GetGuid(2);
                    //3:Parameter BillNumber of type String
                    resultItem.BillNumber = reader.GetString(3);
                    //4:Parameter BillComment of type String
                    resultItem.BillComment = reader.GetString(4);
                    //5:Parameter BillHeader_PaymentCondition_RefID of type Guid
                    resultItem.BillHeader_PaymentCondition_RefID = reader.GetGuid(5);
                    //6:Parameter ACC_PAY_Type_RefID of type Guid
                    resultItem.ACC_PAY_Type_RefID = reader.GetGuid(6);
                    //7:Parameter DateOnBill of type DateTime
                    resultItem.DateOnBill = reader.GetDate(7);
                    //8:Parameter BillingAddress_UCD_RefID of type Guid
                    resultItem.BillingAddress_UCD_RefID = reader.GetGuid(8);
                    //9:Parameter CMN_UniversalContactDetailID of type Guid
                    resultItem.CMN_UniversalContactDetailID = reader.GetGuid(9);
                    //10:Parameter CompanyName_Line1 of type String
                    resultItem.CompanyName_Line1 = reader.GetString(10);
                    //11:Parameter First_Name of type String
                    resultItem.First_Name = reader.GetString(11);
                    //12:Parameter Last_Name of type String
                    resultItem.Last_Name = reader.GetString(12);
                    //13:Parameter Country_Name of type String
                    resultItem.Country_Name = reader.GetString(13);
                    //14:Parameter Country_639_1_ISOCode of type String
                    resultItem.Country_639_1_ISOCode = reader.GetString(14);
                    //15:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(15);
                    //16:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(16);
                    //17:Parameter ZIP of type String
                    resultItem.ZIP = reader.GetString(17);
                    //18:Parameter Town of type String
                    resultItem.Town = reader.GetString(18);
                    //19:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(19);
                    //20:Parameter TotalValue_BeforeTax of type Double
                    resultItem.TotalValue_BeforeTax = reader.GetDouble(20);
                    //21:Parameter TotalValue_IncludingTax of type Double
                    resultItem.TotalValue_IncludingTax = reader.GetDouble(21);
                    //22:Parameter Status_AssignmentID of type Guid
                    resultItem.Status_AssignmentID = reader.GetGuid(22);
                    //23:Parameter CMN_BPT_CTM_CustomerID of type Guid
                    resultItem.CMN_BPT_CTM_CustomerID = reader.GetGuid(23);
                    //24:Parameter Symbol of type String
                    resultItem.Symbol = reader.GetString(24);
                    //25:Parameter ISO4127 of type String
                    resultItem.ISO4127 = reader.GetString(25);
                    //26:Parameter NotesNumber of type int
                    resultItem.NotesNumber = reader.GetInteger(26);
                    //27:Parameter BIL_BillStatusID of type Guid
                    resultItem.BIL_BillStatusID = reader.GetGuid(27);
                    //28:Parameter Status_GlobalPropertyMatchingID of type string
                    resultItem.Status_GlobalPropertyMatchingID = reader.GetString(28);
                    //29:Parameter BillStatus_Name of type Dict
                    resultItem.BillStatus_Name             = reader.GetDictionary(29);
                    resultItem.BillStatus_Name.SourceTable = "bil_billstatuses";
                    loader.Append(resultItem.BillStatus_Name);
                    //30:Parameter IsCurrentStatus of type bool
                    resultItem.IsCurrentStatus = reader.GetBoolean(30);

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

            returnStatus.Result = L5BL_GPDfBE_1635_raw.Convert(results).FirstOrDefault();

            return(returnStatus);
        }
Ejemplo n.º 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_L5BL_GPDfBE_1635 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5BL_GPDfBE_1635 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Ejemplo n.º 3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5BL_GPDfBE_1635 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5BL_GPDfBE_1635 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5BL_GPDfBE_1635 functionReturn = new FR_L5BL_GPDfBE_1635();

            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_PreloadingData_for_BillEdit", ex);
            }
            return(functionReturn);
        }
Ejemplo n.º 4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5BL_GPDfBE_1635 Invoke(string ConnectionString, P_L5BL_GPDfBE_1635 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }