/// <summary> /// Returns a new DebitLineDetails instance filled with the DataReader's current record data /// </summary> protected virtual DebitLineDetails GetDebitLineFromReader(DbDataReader reader) { DebitLineDetails debitLine = new DebitLineDetails(); if (reader.HasRows) { debitLine.DebitLineId = GetReaderValue_Int32(reader, "DebitLineId", 0); //From: [Table] debitLine.DebitNo = GetReaderValue_Int32(reader, "DebitNo", 0); //From: [Table] debitLine.FullPart = GetReaderValue_String(reader, "FullPart", ""); //From: [Table] debitLine.Part = GetReaderValue_String(reader, "Part", ""); //From: [usp_selectAll_Allocation] debitLine.ManufacturerNo = GetReaderValue_NullableInt32(reader, "ManufacturerNo", null); //From: [usp_selectAll_Allocation] debitLine.DateCode = GetReaderValue_String(reader, "DateCode", ""); //From: [usp_selectAll_Allocation] debitLine.PackageNo = GetReaderValue_NullableInt32(reader, "PackageNo", null); //From: [usp_selectAll_Allocation] debitLine.ProductNo = GetReaderValue_NullableInt32(reader, "ProductNo", null); //From: [usp_selectAll_Allocation] debitLine.Quantity = GetReaderValue_Int32(reader, "Quantity", 0); //From: [Table] debitLine.Price = GetReaderValue_Double(reader, "Price", 0); //From: [usp_selectAll_Allocation_for_CustomerRMALine] debitLine.Taxable = GetReaderValue_Boolean(reader, "Taxable", false); //From: [Table] debitLine.SupplierPart = GetReaderValue_String(reader, "SupplierPart", ""); //From: [usp_selectAll_Allocation] debitLine.LandedCost = GetReaderValue_NullableDouble(reader, "LandedCost", null); //From: [usp_selectAll_Allocation] debitLine.PurchaseOrderLineNo = GetReaderValue_NullableInt32(reader, "PurchaseOrderLineNo", null); //From: [usp_selectAll_Allocation_for_CustomerRMALine] debitLine.SupplierRMALineNo = GetReaderValue_NullableInt32(reader, "SupplierRMALineNo", null); //From: [Table] debitLine.StockNo = GetReaderValue_NullableInt32(reader, "StockNo", null); //From: [Table] debitLine.ROHS = GetReaderValue_Byte(reader, "ROHS", (byte)0); //From: [usp_selectAll_Allocation] debitLine.UpdatedBy = GetReaderValue_NullableInt32(reader, "UpdatedBy", null); //From: [Table] debitLine.DLUP = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue); //From: [Table] debitLine.ServiceNo = GetReaderValue_NullableInt32(reader, "ServiceNo", null); //From: [Table] debitLine.Notes = GetReaderValue_String(reader, "Notes", ""); //From: [usp_select_Address_DefaultBilling_for_Company] debitLine.FullSupplierPart = GetReaderValue_String(reader, "FullSupplierPart", ""); //From: [Table] debitLine.DebitId = GetReaderValue_Int32(reader, "DebitId", 0); //From: [Table] debitLine.DebitNumber = GetReaderValue_Int32(reader, "DebitNumber", 0); //From: [Table] debitLine.DebitDate = GetReaderValue_DateTime(reader, "DebitDate", DateTime.MinValue); //From: [Table] debitLine.CompanyName = GetReaderValue_String(reader, "CompanyName", ""); //From: [usp_list_Activity_by_Client_with_filter] debitLine.CompanyNo = GetReaderValue_Int32(reader, "CompanyNo", 0); //From: [usp_list_Activity_by_Client_with_filter] debitLine.SupplierRMANumber = GetReaderValue_Int32(reader, "SupplierRMANumber", 0); //From: [usp_selectAll_Allocation] debitLine.SupplierRMANo = GetReaderValue_NullableInt32(reader, "SupplierRMANo", null); //From: [usp_selectAll_Allocation] debitLine.SupplierInvoice = GetReaderValue_String(reader, "SupplierInvoice", ""); //From: [Table] debitLine.PurchaseOrderNumber = GetReaderValue_Int32(reader, "PurchaseOrderNumber", 0); //From: [usp_selectAll_Allocation] debitLine.PurchaseOrderNo = GetReaderValue_NullableInt32(reader, "PurchaseOrderNo", null); //From: [usp_selectAll_Allocation] debitLine.ContactName = GetReaderValue_String(reader, "ContactName", ""); //From: [usp_list_Activity_by_Client_with_filter] debitLine.ContactNo = GetReaderValue_Int32(reader, "ContactNo", 0); //From: [Table] debitLine.ManufacturerCode = GetReaderValue_String(reader, "ManufacturerCode", ""); //From: [usp_selectAll_Allocation] debitLine.RowCnt = GetReaderValue_NullableInt32(reader, "RowCnt", null); //From: [usp_list_Activity_by_Client_with_filter] debitLine.DivisionNo = GetReaderValue_Int32(reader, "DivisionNo", 0); //From: [usp_select_Contact] debitLine.ManufacturerName = GetReaderValue_String(reader, "ManufacturerName", ""); //From: [usp_selectAll_Allocation] debitLine.PackageName = GetReaderValue_String(reader, "PackageName", ""); //From: [usp_selectAll_Allocation] debitLine.PackageDescription = GetReaderValue_String(reader, "PackageDescription", ""); //From: [usp_selectAll_Allocation] debitLine.ProductName = GetReaderValue_String(reader, "ProductName", ""); //From: [usp_selectAll_Allocation] debitLine.ProductDescription = GetReaderValue_String(reader, "ProductDescription", ""); //From: [usp_selectAll_Allocation] debitLine.CurrencyNo = GetReaderValue_Int32(reader, "CurrencyNo", 0); //From: [usp_selectAll_Allocation_for_CustomerRMALine] debitLine.CurrencyCode = GetReaderValue_String(reader, "CurrencyCode", ""); //From: [usp_list_Activity_by_Client_with_filter] debitLine.LineNotes = GetReaderValue_String(reader, "LineNotes", ""); //From: [usp_select_CreditLine] } return(debitLine); }
/// <summary> /// Get /// Calls [usp_select_DebitLine] /// </summary> public static DebitLine Get(System.Int32?debitLineId) { Rebound.GlobalTrader.DAL.DebitLineDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.DebitLine.Get(debitLineId); if (objDetails == null) { return(null); } else { DebitLine obj = new DebitLine(); obj.DebitLineId = objDetails.DebitLineId; obj.DebitNo = objDetails.DebitNo; obj.DebitNumber = objDetails.DebitNumber; obj.DebitDate = objDetails.DebitDate; obj.DivisionNo = objDetails.DivisionNo; obj.FullPart = objDetails.FullPart; obj.Part = objDetails.Part; obj.ROHS = objDetails.ROHS; obj.ManufacturerNo = objDetails.ManufacturerNo; obj.ManufacturerName = objDetails.ManufacturerName; obj.ManufacturerCode = objDetails.ManufacturerCode; obj.DateCode = objDetails.DateCode; obj.PackageNo = objDetails.PackageNo; obj.PackageName = objDetails.PackageName; obj.PackageDescription = objDetails.PackageDescription; obj.ProductNo = objDetails.ProductNo; obj.ProductName = objDetails.ProductName; obj.ProductDescription = objDetails.ProductDescription; obj.Quantity = objDetails.Quantity; obj.Price = objDetails.Price; obj.LandedCost = objDetails.LandedCost; obj.Taxable = objDetails.Taxable; obj.PurchaseOrderLineNo = objDetails.PurchaseOrderLineNo; obj.SupplierPart = objDetails.SupplierPart; obj.SupplierRMALineNo = objDetails.SupplierRMALineNo; obj.StockNo = objDetails.StockNo; obj.ServiceNo = objDetails.ServiceNo; obj.CurrencyNo = objDetails.CurrencyNo; obj.CurrencyCode = objDetails.CurrencyCode; obj.LineNotes = objDetails.LineNotes; obj.UpdatedBy = objDetails.UpdatedBy; obj.DLUP = objDetails.DLUP; obj.IsProdHazardous = objDetails.IsProdHazardous; obj.PrintHazardous = objDetails.PrintHazardous; objDetails = null; return(obj); } }