private static ProductVariant DBMapping(DBProductVariant dbItem) { if (dbItem == null) return null; ProductVariant item = new ProductVariant(); item.ProductVariantID = dbItem.ProductVariantID; item.ProductID = dbItem.ProductID; item.Name = dbItem.Name; item.SKU = dbItem.SKU; item.Description = dbItem.Description; item.AdminComment = dbItem.AdminComment; item.ManufacturerPartNumber = dbItem.ManufacturerPartNumber; item.IsDownload = dbItem.IsDownload; item.DownloadID = dbItem.DownloadID; item.UnlimitedDownloads = dbItem.UnlimitedDownloads; item.MaxNumberOfDownloads = dbItem.MaxNumberOfDownloads; item.HasSampleDownload = dbItem.HasSampleDownload; item.SampleDownloadID = dbItem.SampleDownloadID; item.IsShipEnabled = dbItem.IsShipEnabled; item.IsFreeShipping = dbItem.IsFreeShipping; item.AdditionalShippingCharge = dbItem.AdditionalShippingCharge; item.IsTaxExempt = dbItem.IsTaxExempt; item.TaxCategoryID = dbItem.TaxCategoryID; item.ManageInventory = dbItem.ManageInventory; item.StockQuantity = dbItem.StockQuantity; item.MinStockQuantity = dbItem.MinStockQuantity; item.LowStockActivityID = dbItem.LowStockActivityID; item.NotifyAdminForQuantityBelow = dbItem.NotifyAdminForQuantityBelow; item.OrderMinimumQuantity = dbItem.OrderMinimumQuantity; item.OrderMaximumQuantity = dbItem.OrderMaximumQuantity; item.WarehouseId = dbItem.WarehouseId; item.DisableBuyButton = dbItem.DisableBuyButton; item.Price = dbItem.Price; item.OldPrice = dbItem.OldPrice; item.Weight = dbItem.Weight; item.Length = dbItem.Length; item.Width = dbItem.Width; item.Height = dbItem.Height; item.PictureID = dbItem.PictureID; item.AvailableStartDateTime = dbItem.AvailableStartDateTime; item.AvailableEndDateTime = dbItem.AvailableEndDateTime; item.Published = dbItem.Published; item.Deleted = dbItem.Deleted; item.DisplayOrder = dbItem.DisplayOrder; item.CreatedOn = dbItem.CreatedOn; item.UpdatedOn = dbItem.UpdatedOn; return item; }
private DBProductVariant GetProductVariantFromReader(IDataReader dataReader) { DBProductVariant productVariant = new DBProductVariant(); productVariant.ProductVariantID = NopSqlDataHelper.GetInt(dataReader, "ProductVariantID"); productVariant.ProductID = NopSqlDataHelper.GetInt(dataReader, "ProductID"); productVariant.Name = NopSqlDataHelper.GetString(dataReader, "Name"); productVariant.SKU = NopSqlDataHelper.GetString(dataReader, "SKU"); productVariant.Description = NopSqlDataHelper.GetString(dataReader, "Description"); productVariant.AdminComment = NopSqlDataHelper.GetString(dataReader, "AdminComment"); productVariant.ManufacturerPartNumber = NopSqlDataHelper.GetString(dataReader, "ManufacturerPartNumber"); productVariant.IsDownload = NopSqlDataHelper.GetBoolean(dataReader, "IsDownload"); productVariant.DownloadID = NopSqlDataHelper.GetInt(dataReader, "DownloadID"); productVariant.UnlimitedDownloads = NopSqlDataHelper.GetBoolean(dataReader, "UnlimitedDownloads"); productVariant.MaxNumberOfDownloads = NopSqlDataHelper.GetInt(dataReader, "MaxNumberOfDownloads"); productVariant.HasSampleDownload = NopSqlDataHelper.GetBoolean(dataReader, "HasSampleDownload"); productVariant.SampleDownloadID = NopSqlDataHelper.GetInt(dataReader, "SampleDownloadID"); productVariant.IsShipEnabled = NopSqlDataHelper.GetBoolean(dataReader, "IsShipEnabled"); productVariant.IsFreeShipping = NopSqlDataHelper.GetBoolean(dataReader, "IsFreeShipping"); productVariant.AdditionalShippingCharge = NopSqlDataHelper.GetDecimal(dataReader, "AdditionalShippingCharge"); productVariant.IsTaxExempt = NopSqlDataHelper.GetBoolean(dataReader, "IsTaxExempt"); productVariant.TaxCategoryID = NopSqlDataHelper.GetInt(dataReader, "TaxCategoryID"); productVariant.ManageInventory = NopSqlDataHelper.GetBoolean(dataReader, "ManageInventory"); productVariant.StockQuantity = NopSqlDataHelper.GetInt(dataReader, "StockQuantity"); productVariant.MinStockQuantity = NopSqlDataHelper.GetInt(dataReader, "MinStockQuantity"); productVariant.LowStockActivityID = NopSqlDataHelper.GetInt(dataReader, "LowStockActivityID"); productVariant.NotifyAdminForQuantityBelow = NopSqlDataHelper.GetInt(dataReader, "NotifyAdminForQuantityBelow"); productVariant.OrderMinimumQuantity = NopSqlDataHelper.GetInt(dataReader, "OrderMinimumQuantity"); productVariant.OrderMaximumQuantity = NopSqlDataHelper.GetInt(dataReader, "OrderMaximumQuantity"); productVariant.WarehouseId = NopSqlDataHelper.GetInt(dataReader, "WarehouseId"); productVariant.DisableBuyButton = NopSqlDataHelper.GetBoolean(dataReader, "DisableBuyButton"); productVariant.Price = NopSqlDataHelper.GetDecimal(dataReader, "Price"); productVariant.OldPrice = NopSqlDataHelper.GetDecimal(dataReader, "OldPrice"); productVariant.Weight = NopSqlDataHelper.GetDecimal(dataReader, "Weight"); productVariant.Length = NopSqlDataHelper.GetDecimal(dataReader, "Length"); productVariant.Width = NopSqlDataHelper.GetDecimal(dataReader, "Width"); productVariant.Height = NopSqlDataHelper.GetDecimal(dataReader, "Height"); productVariant.PictureID = NopSqlDataHelper.GetInt(dataReader, "PictureID"); productVariant.AvailableStartDateTime = NopSqlDataHelper.GetNullableUtcDateTime(dataReader, "AvailableStartDateTime"); productVariant.AvailableEndDateTime = NopSqlDataHelper.GetNullableUtcDateTime(dataReader, "AvailableEndDateTime"); productVariant.Published = NopSqlDataHelper.GetBoolean(dataReader, "Published"); productVariant.Deleted = NopSqlDataHelper.GetBoolean(dataReader, "Deleted"); productVariant.DisplayOrder = NopSqlDataHelper.GetInt(dataReader, "DisplayOrder"); productVariant.CreatedOn = NopSqlDataHelper.GetUtcDateTime(dataReader, "CreatedOn"); productVariant.UpdatedOn = NopSqlDataHelper.GetUtcDateTime(dataReader, "UpdatedOn"); return productVariant; }