/// <summary> /// Returns a new WarehouseDetails instance filled with the DataReader's current record data /// </summary> protected virtual WarehouseDetails GetWarehouseFromReader(DbDataReader reader) { WarehouseDetails warehouse = new WarehouseDetails(); if (reader.HasRows) { warehouse.WarehouseId = GetReaderValue_Int32(reader, "WarehouseId", 0); //From: [Table] warehouse.ClientNo = GetReaderValue_Int32(reader, "ClientNo", 0); //From: [Table] warehouse.WarehouseName = GetReaderValue_String(reader, "WarehouseName", ""); //From: [Table] warehouse.Inactive = GetReaderValue_Boolean(reader, "Inactive", false); //From: [Table] warehouse.AddressNo = GetReaderValue_NullableInt32(reader, "AddressNo", null); //From: [Table] warehouse.UpdatedBy = GetReaderValue_NullableInt32(reader, "UpdatedBy", null); //From: [Table] warehouse.DLUP = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue); //From: [Table] warehouse.VirtualWarehouse = GetReaderValue_Boolean(reader, "VirtualWarehouse", false); //From: [Table] warehouse.DefaultWarehouse = GetReaderValue_Boolean(reader, "DefaultWarehouse", false); //From: [Table] warehouse.AddressName = GetReaderValue_String(reader, "AddressName", ""); //From: [usp_select_Warehouse] warehouse.Line1 = GetReaderValue_String(reader, "Line1", ""); //From: [usp_select_Warehouse] warehouse.Line2 = GetReaderValue_String(reader, "Line2", ""); //From: [usp_select_Warehouse] warehouse.Line3 = GetReaderValue_String(reader, "Line3", ""); //From: [usp_select_Warehouse] warehouse.County = GetReaderValue_String(reader, "County", ""); //From: [usp_select_Warehouse] warehouse.City = GetReaderValue_String(reader, "City", ""); //From: [usp_select_Warehouse] warehouse.State = GetReaderValue_String(reader, "State", ""); //From: [usp_select_Warehouse] warehouse.ZIP = GetReaderValue_String(reader, "ZIP", ""); //From: [usp_select_Warehouse] warehouse.CountryName = GetReaderValue_String(reader, "CountryName", ""); //From: [usp_select_Warehouse] warehouse.CountryNo = GetReaderValue_NullableInt32(reader, "CountryNo", null); //From: [usp_select_Warehouse] } return(warehouse); }
/// <summary> /// Get /// Calls [usp_select_Warehouse] /// </summary> public static Warehouse Get(System.Int32?warehouseId) { Rebound.GlobalTrader.DAL.WarehouseDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Warehouse.Get(warehouseId); if (objDetails == null) { return(null); } else { Warehouse obj = new Warehouse(); obj.WarehouseId = objDetails.WarehouseId; obj.ClientNo = objDetails.ClientNo; obj.WarehouseName = objDetails.WarehouseName; obj.Inactive = objDetails.Inactive; obj.AddressNo = objDetails.AddressNo; obj.UpdatedBy = objDetails.UpdatedBy; obj.DLUP = objDetails.DLUP; obj.VirtualWarehouse = objDetails.VirtualWarehouse; obj.AddressName = objDetails.AddressName; obj.Line1 = objDetails.Line1; obj.Line2 = objDetails.Line2; obj.Line3 = objDetails.Line3; obj.County = objDetails.County; obj.City = objDetails.City; obj.State = objDetails.State; obj.ZIP = objDetails.ZIP; obj.CountryName = objDetails.CountryName; obj.CountryNo = objDetails.CountryNo; obj.DefaultWarehouse = objDetails.DefaultWarehouse; objDetails = null; return(obj); } }
/// <summary> /// GetDefault /// Calls [usp_select_Warehouse_Default] /// </summary> public static Warehouse GetDefault(System.Int32?clientId) { Rebound.GlobalTrader.DAL.WarehouseDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Warehouse.GetDefault(clientId); if (objDetails == null) { return(null); } else { Warehouse obj = new Warehouse(); obj.WarehouseId = objDetails.WarehouseId; objDetails = null; return(obj); } }