Пример #1
0
        /// <summary>
        /// Returns a new CreditLineDetails instance filled with the DataReader's current record data
        /// </summary>
        protected virtual CreditLineDetails GetCreditLineFromReader(DbDataReader reader)
        {
            CreditLineDetails creditLine = new CreditLineDetails();

            if (reader.HasRows)
            {
                creditLine.CreditLineId       = GetReaderValue_Int32(reader, "CreditLineId", 0);                     //From: [Table]
                creditLine.FullPart           = GetReaderValue_String(reader, "FullPart", "");                       //From: [Table]
                creditLine.Part               = GetReaderValue_String(reader, "Part", "");                           //From: [usp_selectAll_Allocation]
                creditLine.ManufacturerNo     = GetReaderValue_NullableInt32(reader, "ManufacturerNo", null);        //From: [usp_selectAll_Allocation]
                creditLine.DateCode           = GetReaderValue_String(reader, "DateCode", "");                       //From: [usp_selectAll_Allocation]
                creditLine.PackageNo          = GetReaderValue_NullableInt32(reader, "PackageNo", null);             //From: [usp_selectAll_Allocation]
                creditLine.ProductNo          = GetReaderValue_NullableInt32(reader, "ProductNo", null);             //From: [usp_selectAll_Allocation]
                creditLine.CreditNo           = GetReaderValue_Int32(reader, "CreditNo", 0);                         //From: [Table]
                creditLine.Quantity           = GetReaderValue_Int32(reader, "Quantity", 0);                         //From: [Table]
                creditLine.Price              = GetReaderValue_Double(reader, "Price", 0);                           //From: [usp_selectAll_Allocation_for_CustomerRMALine]
                creditLine.Taxable            = GetReaderValue_Boolean(reader, "Taxable", false);                    //From: [Table]
                creditLine.CustomerPart       = GetReaderValue_String(reader, "CustomerPart", "");                   //From: [usp_selectAll_Allocation]
                creditLine.LandedCost         = GetReaderValue_NullableDouble(reader, "LandedCost", null);           //From: [usp_selectAll_Allocation]
                creditLine.InvoiceLineNo      = GetReaderValue_NullableInt32(reader, "InvoiceLineNo", null);         //From: [Table]
                creditLine.CustomerRMALineNo  = GetReaderValue_NullableInt32(reader, "CustomerRMALineNo", null);     //From: [usp_selectAll_Allocation_for_CustomerRMALine]
                creditLine.ROHS               = GetReaderValue_Byte(reader, "ROHS", (byte)0);                        //From: [usp_selectAll_Allocation]
                creditLine.UpdatedBy          = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);             //From: [Table]
                creditLine.DLUP               = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);          //From: [Table]
                creditLine.StockNo            = GetReaderValue_NullableInt32(reader, "StockNo", null);               //From: [Table]
                creditLine.ServiceNo          = GetReaderValue_NullableInt32(reader, "ServiceNo", null);             //From: [Table]
                creditLine.Notes              = GetReaderValue_String(reader, "Notes", "");                          //From: [usp_select_Address_DefaultBilling_for_Company]
                creditLine.FullCustomerPart   = GetReaderValue_String(reader, "FullCustomerPart", "");               //From: [Table]
                creditLine.CreditId           = GetReaderValue_Int32(reader, "CreditId", 0);                         //From: [Table]
                creditLine.CreditNumber       = GetReaderValue_Int32(reader, "CreditNumber", 0);                     //From: [Table]
                creditLine.CreditDate         = GetReaderValue_DateTime(reader, "CreditDate", DateTime.MinValue);    //From: [Table]
                creditLine.CompanyName        = GetReaderValue_String(reader, "CompanyName", "");                    //From: [usp_list_Activity_by_Client_with_filter]
                creditLine.CompanyNo          = GetReaderValue_Int32(reader, "CompanyNo", 0);                        //From: [usp_list_Activity_by_Client_with_filter]
                creditLine.CustomerRMANumber  = GetReaderValue_Int32(reader, "CustomerRMANumber", 0);                //From: [usp_selectAll_Allocation_for_SalesOrderLine]
                creditLine.CustomerRMANo      = GetReaderValue_NullableInt32(reader, "CustomerRMANo", null);         //From: [usp_selectAll_Allocation_for_SalesOrderLine]
                creditLine.CustomerPO         = GetReaderValue_String(reader, "CustomerPO", "");                     //From: [usp_selectAll_Allocation]
                creditLine.InvoiceNumber      = GetReaderValue_Int32(reader, "InvoiceNumber", 0);                    //From: [usp_select_Credit]
                creditLine.InvoiceNo          = GetReaderValue_NullableInt32(reader, "InvoiceNo", null);             //From: [Table]
                creditLine.ContactName        = GetReaderValue_String(reader, "ContactName", "");                    //From: [usp_list_Activity_by_Client_with_filter]
                creditLine.ContactNo          = GetReaderValue_Int32(reader, "ContactNo", 0);                        //From: [Table]
                creditLine.ManufacturerCode   = GetReaderValue_String(reader, "ManufacturerCode", "");               //From: [usp_selectAll_Allocation]
                creditLine.RowCnt             = GetReaderValue_NullableInt32(reader, "RowCnt", null);                //From: [usp_list_Activity_by_Client_with_filter]
                creditLine.LineNotes          = GetReaderValue_String(reader, "LineNotes", "");                      //From: [usp_select_CreditLine]
                creditLine.ManufacturerName   = GetReaderValue_String(reader, "ManufacturerName", "");               //From: [usp_selectAll_Allocation]
                creditLine.PackageName        = GetReaderValue_String(reader, "PackageName", "");                    //From: [usp_selectAll_Allocation]
                creditLine.PackageDescription = GetReaderValue_String(reader, "PackageDescription", "");             //From: [usp_selectAll_Allocation]
                creditLine.ProductName        = GetReaderValue_String(reader, "ProductName", "");                    //From: [usp_selectAll_Allocation]
                creditLine.ProductDescription = GetReaderValue_String(reader, "ProductDescription", "");             //From: [usp_selectAll_Allocation]
                creditLine.CurrencyNo         = GetReaderValue_Int32(reader, "CurrencyNo", 0);                       //From: [usp_selectAll_Allocation_for_CustomerRMALine]
                creditLine.CurrencyCode       = GetReaderValue_String(reader, "CurrencyCode", "");                   //From: [usp_list_Activity_by_Client_with_filter]
                creditLine.RaiserName         = GetReaderValue_String(reader, "RaiserName", "");                     //From: [usp_select_Credit]
                creditLine.SalesmanName       = GetReaderValue_String(reader, "SalesmanName", "");                   //From: [usp_selectAll_Allocation]
                creditLine.TeamNo             = GetReaderValue_NullableInt32(reader, "TeamNo", null);                //From: [Table]
                creditLine.DivisionName       = GetReaderValue_String(reader, "DivisionName", "");                   //From: [usp_select_Credit]
                creditLine.ReferenceDate      = GetReaderValue_DateTime(reader, "ReferenceDate", DateTime.MinValue); //From: [Table]
            }
            return(creditLine);
        }
Пример #2
0
 /// <summary>
 /// Get
 /// Calls [usp_select_CreditLine]
 /// </summary>
 public static CreditLine Get(System.Int32?creditLineId)
 {
     Rebound.GlobalTrader.DAL.CreditLineDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.CreditLine.Get(creditLineId);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         CreditLine obj = new CreditLine();
         obj.CreditLineId       = objDetails.CreditLineId;
         obj.FullPart           = objDetails.FullPart;
         obj.Part               = objDetails.Part;
         obj.ManufacturerNo     = objDetails.ManufacturerNo;
         obj.DateCode           = objDetails.DateCode;
         obj.PackageNo          = objDetails.PackageNo;
         obj.ProductNo          = objDetails.ProductNo;
         obj.CreditNo           = objDetails.CreditNo;
         obj.Quantity           = objDetails.Quantity;
         obj.Price              = objDetails.Price;
         obj.Taxable            = objDetails.Taxable;
         obj.CustomerPart       = objDetails.CustomerPart;
         obj.LandedCost         = objDetails.LandedCost;
         obj.InvoiceLineNo      = objDetails.InvoiceLineNo;
         obj.CustomerRMALineNo  = objDetails.CustomerRMALineNo;
         obj.ROHS               = objDetails.ROHS;
         obj.StockNo            = objDetails.StockNo;
         obj.ServiceNo          = objDetails.ServiceNo;
         obj.LineNotes          = objDetails.LineNotes;
         obj.UpdatedBy          = objDetails.UpdatedBy;
         obj.DLUP               = objDetails.DLUP;
         obj.ManufacturerName   = objDetails.ManufacturerName;
         obj.ManufacturerCode   = objDetails.ManufacturerCode;
         obj.PackageName        = objDetails.PackageName;
         obj.PackageDescription = objDetails.PackageDescription;
         obj.ProductName        = objDetails.ProductName;
         obj.ProductDescription = objDetails.ProductDescription;
         obj.CurrencyNo         = objDetails.CurrencyNo;
         obj.CurrencyCode       = objDetails.CurrencyCode;
         obj.CompanyName        = objDetails.CompanyName;
         obj.ContactName        = objDetails.ContactName;
         obj.RaiserName         = objDetails.RaiserName;
         obj.SalesmanName       = objDetails.SalesmanName;
         obj.TeamNo             = objDetails.TeamNo;
         obj.DivisionName       = objDetails.DivisionName;
         obj.InvoiceNumber      = objDetails.InvoiceNumber;
         obj.CustomerRMANumber  = objDetails.CustomerRMANumber;
         obj.CreditDate         = objDetails.CreditDate;
         obj.ReferenceDate      = objDetails.ReferenceDate;
         objDetails             = null;
         return(obj);
     }
 }