/// <summary> /// Loads the given BasketItem object from the given database data reader. /// </summary> /// <param name="basketItem">The BasketItem object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(BasketItem basketItem, IDataReader dr) { //SET FIELDS FROM ROW DATA basketItem.BasketItemId = dr.GetInt32(0); basketItem.ParentItemId = dr.GetInt32(1); basketItem.BasketId = dr.GetInt32(2); basketItem.BasketShipmentId = NullableData.GetInt32(dr, 3); basketItem.ProductId = dr.GetInt32(4); basketItem.OptionList = NullableData.GetString(dr, 5); basketItem.TaxCodeId = NullableData.GetInt32(dr, 6); basketItem.Name = dr.GetString(7); basketItem.Sku = NullableData.GetString(dr, 8); basketItem.Price = dr.GetDecimal(9); basketItem.Weight = dr.GetDecimal(10); basketItem.Quantity = dr.GetInt16(11); basketItem.LineMessage = NullableData.GetString(dr, 12); basketItem.OrderItemTypeId = dr.GetInt16(13); basketItem.OrderBy = dr.GetInt16(14); basketItem.WrapStyleId = NullableData.GetInt32(dr, 15); basketItem.GiftMessage = NullableData.GetString(dr, 16); basketItem.WishlistItemId = NullableData.GetInt32(dr, 17); basketItem.ShippableId = dr.GetByte(18); basketItem.LastModifiedDate = LocaleHelper.ToLocalTime(dr.GetDateTime(19)); basketItem.TaxRate = dr.GetDecimal(20); basketItem.TaxAmount = dr.GetDecimal(21); basketItem.KitList = NullableData.GetString(dr, 22); basketItem.CustomFields.Parse(NullableData.GetString(dr, 23)); basketItem.IsDirty = false; }
/// <summary> /// Loads the given Affiliate object from the given database data reader. /// </summary> /// <param name="affiliate">The Affiliate object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Affiliate affiliate, IDataReader dr) { //SET FIELDS FROM ROW DATA affiliate.AffiliateId = dr.GetInt32(0); affiliate.StoreId = dr.GetInt32(1); affiliate.Name = dr.GetString(2); affiliate.PayeeName = NullableData.GetString(dr, 3); affiliate.FirstName = NullableData.GetString(dr, 4); affiliate.LastName = NullableData.GetString(dr, 5); affiliate.Company = NullableData.GetString(dr, 6); affiliate.Address1 = NullableData.GetString(dr, 7); affiliate.Address2 = NullableData.GetString(dr, 8); affiliate.City = NullableData.GetString(dr, 9); affiliate.Province = NullableData.GetString(dr, 10); affiliate.PostalCode = NullableData.GetString(dr, 11); affiliate.CountryCode = NullableData.GetString(dr, 12); affiliate.PhoneNumber = NullableData.GetString(dr, 13); affiliate.FaxNumber = NullableData.GetString(dr, 14); affiliate.MobileNumber = NullableData.GetString(dr, 15); affiliate.WebsiteUrl = NullableData.GetString(dr, 16); affiliate.Email = NullableData.GetString(dr, 17); affiliate.CommissionRate = dr.GetDecimal(18); affiliate.CommissionIsPercent = dr.GetBoolean(19); affiliate.CommissionOnTotal = dr.GetBoolean(20); affiliate.ReferralPeriodId = dr.GetByte(21); affiliate.ReferralDays = dr.GetInt16(22); affiliate.GroupId = NullableData.GetInt32(dr, 23); affiliate.IsDirty = false; }
/// <summary> /// Loads the given OrderItem object from the given database data reader. /// </summary> /// <param name="orderItem">The OrderItem object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(OrderItem orderItem, IDataReader dr) { //SET FIELDS FROM ROW DATA orderItem.OrderItemId = dr.GetInt32(0); orderItem.OrderId = dr.GetInt32(1); orderItem.ParentItemId = NullableData.GetInt32(dr, 2); orderItem.OrderItemTypeId = dr.GetInt16(3); orderItem.ShippableId = dr.GetByte(4); orderItem.OrderShipmentId = NullableData.GetInt32(dr, 5); orderItem.ProductId = NullableData.GetInt32(dr, 6); orderItem.Name = dr.GetString(7); orderItem.OptionList = NullableData.GetString(dr, 8); orderItem.VariantName = NullableData.GetString(dr, 9); orderItem.Sku = NullableData.GetString(dr, 10); orderItem.Price = dr.GetDecimal(11); orderItem.Weight = dr.GetDecimal(12); orderItem.CostOfGoods = dr.GetDecimal(13); orderItem.Quantity = dr.GetInt16(14); orderItem.LineMessage = NullableData.GetString(dr, 15); orderItem.OrderBy = dr.GetInt16(16); orderItem.GiftMessage = NullableData.GetString(dr, 17); orderItem.TaxCodeId = NullableData.GetInt32(dr, 18); orderItem.WrapStyleId = NullableData.GetInt32(dr, 19); orderItem.WishlistItemId = NullableData.GetInt32(dr, 20); orderItem.InventoryStatusId = dr.GetInt16(21); orderItem.TaxRate = dr.GetDecimal(22); orderItem.TaxAmount = dr.GetDecimal(23); orderItem.KitList = NullableData.GetString(dr, 24); orderItem.CustomFields.Parse(NullableData.GetString(dr, 25)); orderItem.IsDirty = false; }
/// <summary> /// Loads the given OrderShipment object from the given database data reader. /// </summary> /// <param name="orderShipment">The OrderShipment object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(OrderShipment orderShipment, IDataReader dr) { //SET FIELDS FROM ROW DATA orderShipment.OrderShipmentId = dr.GetInt32(0); orderShipment.OrderId = dr.GetInt32(1); orderShipment.WarehouseId = NullableData.GetInt32(dr, 2); orderShipment.ShipToFirstName = NullableData.GetString(dr, 3); orderShipment.ShipToLastName = NullableData.GetString(dr, 4); orderShipment.ShipToCompany = NullableData.GetString(dr, 5); orderShipment.ShipToAddress1 = NullableData.GetString(dr, 6); orderShipment.ShipToAddress2 = NullableData.GetString(dr, 7); orderShipment.ShipToCity = NullableData.GetString(dr, 8); orderShipment.ShipToProvince = NullableData.GetString(dr, 9); orderShipment.ShipToPostalCode = NullableData.GetString(dr, 10); orderShipment.ShipToCountryCode = NullableData.GetString(dr, 11); orderShipment.ShipToPhone = NullableData.GetString(dr, 12); orderShipment.ShipToFax = NullableData.GetString(dr, 13); orderShipment.ShipToEmail = NullableData.GetString(dr, 14); orderShipment.ShipToResidence = NullableData.GetBoolean(dr, 15); orderShipment.ShipMethodId = NullableData.GetInt32(dr, 16); orderShipment.ShipMethodName = NullableData.GetString(dr, 17); orderShipment.ShipMessage = NullableData.GetString(dr, 18); orderShipment.ShipDate = LocaleHelper.ToLocalTime(NullableData.GetDateTime(dr, 19)); orderShipment.IsDirty = false; }
/// <summary> /// Loads the given ProductVariant object from the given database data reader. /// </summary> /// <param name="productVariant">The ProductVariant object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ProductVariant productVariant, IDataReader dr) { //SET FIELDS FROM ROW DATA productVariant.ProductVariantId = dr.GetInt32(0); productVariant.ProductId = dr.GetInt32(1); productVariant.Option1 = dr.GetInt32(2); productVariant.Option2 = dr.GetInt32(3); productVariant.Option3 = dr.GetInt32(4); productVariant.Option4 = dr.GetInt32(5); productVariant.Option5 = dr.GetInt32(6); productVariant.Option6 = dr.GetInt32(7); productVariant.Option7 = dr.GetInt32(8); productVariant.Option8 = dr.GetInt32(9); productVariant.VariantName = NullableData.GetString(dr, 10); productVariant.Sku = NullableData.GetString(dr, 11); productVariant.Price = NullableData.GetDecimal(dr, 12); productVariant.PriceModeId = dr.GetByte(13); productVariant.Weight = NullableData.GetDecimal(dr, 14); productVariant.WeightModeId = dr.GetByte(15); productVariant.CostOfGoods = NullableData.GetDecimal(dr, 16); productVariant.InStock = dr.GetInt32(17); productVariant.InStockWarningLevel = dr.GetInt32(18); productVariant.Available = dr.GetBoolean(19); productVariant.IsDirty = false; }
/// <summary> /// Loads the given Basket object from the given database data reader. /// </summary> /// <param name="basket">The Basket object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Basket basket, IDataReader dr) { //SET FIELDS FROM ROW DATA basket.BasketId = dr.GetInt32(0); basket.UserId = dr.GetInt32(1); basket.ContentHash = NullableData.GetString(dr, 2); basket.IsDirty = false; }
/// <summary> /// Loads the given Wishlist object from the given database data reader. /// </summary> /// <param name="wishlist">The Wishlist object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Wishlist wishlist, IDataReader dr) { //SET FIELDS FROM ROW DATA wishlist.WishlistId = dr.GetInt32(0); wishlist.UserId = dr.GetInt32(1); wishlist.Name = NullableData.GetString(dr, 2); wishlist.ViewPassword = NullableData.GetString(dr, 3); wishlist.IsDirty = false; }
/// <summary> /// Loads the given Province object from the given database data reader. /// </summary> /// <param name="province">The Province object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Province province, IDataReader dr) { //SET FIELDS FROM ROW DATA province.ProvinceId = dr.GetInt32(0); province.CountryCode = dr.GetString(1); province.Name = dr.GetString(2); province.ProvinceCode = NullableData.GetString(dr, 3); province.IsDirty = false; }
/// <summary> /// Loads the given Vendor object from the given database data reader. /// </summary> /// <param name="vendor">The Vendor object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Vendor vendor, IDataReader dr) { //SET FIELDS FROM ROW DATA vendor.VendorId = dr.GetInt32(0); vendor.StoreId = dr.GetInt32(1); vendor.Name = dr.GetString(2); vendor.Email = NullableData.GetString(dr, 3); vendor.IsDirty = false; }
/// <summary> /// Loads the given Country object from the given database data reader. /// </summary> /// <param name="country">The Country object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Country country, IDataReader dr) { //SET FIELDS FROM ROW DATA country.CountryCode = dr.GetString(0); country.StoreId = dr.GetInt32(1); country.Name = dr.GetString(2); country.AddressFormat = NullableData.GetString(dr, 3); country.IsDirty = false; }
/// <summary> /// Gets cms path for the given node. Only supported for Category type catalog node objects /// </summary> /// <param name="categoryId">Id of the category</param> /// <param name="currentNodeId">Id of the node</param> /// <param name="currentNodeType">Type of node</param> /// <returns>List of cms path nodes</returns> public static List <CmsPathNode> GetCmsPath(int categoryId, int currentNodeId, CatalogNodeType currentNodeType) { List <CmsPathNode> path = new List <CmsPathNode>(); Database database = Token.Instance.Database; StringBuilder selectQuery = new StringBuilder(); switch (currentNodeType) { case CatalogNodeType.Category: selectQuery.Append("SELECT CP.ParentId AS NodeId, 0 As NodeType, C.Name, C.Summary, CP.ParentLevel, CP.ParentNumber"); selectQuery.Append(" FROM ac_CategoryParents AS CP INNER JOIN"); selectQuery.Append(" ac_Categories C ON CP.ParentId = C.CategoryId"); selectQuery.Append(" WHERE CP.CategoryId = @currentNodeId"); selectQuery.Append(" ORDER BY CP.ParentLevel"); break; default: throw new Exception("Not supported."); } DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString()); database.AddInParameter(selectCommand, "@currentNodeId", DbType.Int32, currentNodeId); //EXECUTE THE COMMAND using (IDataReader dr = database.ExecuteReader(selectCommand)) { int nodeId; CatalogNodeType nodeType; String url; String title; String description; while (dr.Read()) { nodeId = dr.GetInt32(0); nodeType = (CatalogNodeType)dr.GetInt32(1); switch (nodeType) { case CatalogNodeType.Category: url = "~/Admin/Catalog/Browse.aspx?CategoryId=" + nodeId.ToString(); break; default: url = string.Empty; break; } title = dr.GetString(2); description = NullableData.GetString(dr, 3); path.Add(new CmsPathNode(nodeId, nodeType, url, title, description)); } dr.Close(); } if (path.Count == 0) { return(null); } return(path); }
/// <summary> /// Loads the given ProductImage object from the given database data reader. /// </summary> /// <param name="productImage">The ProductImage object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ProductImage productImage, IDataReader dr) { //SET FIELDS FROM ROW DATA productImage.ProductImageId = dr.GetInt32(0); productImage.ProductId = dr.GetInt32(1); productImage.ImageUrl = dr.GetString(2); productImage.ImageAltText = NullableData.GetString(dr, 3); productImage.OrderBy = dr.GetInt16(4); productImage.IsDirty = false; }
/// <summary> /// Loads the given IPLocation object from the given database data reader. /// </summary> /// <param name="iPLocation">The IPLocation object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(IPLocation iPLocation, IDataReader dr) { //SET FIELDS FROM ROW DATA iPLocation.IPRangeStart = dr.GetInt64(0); iPLocation.IPRangeEnd = dr.GetInt64(1); iPLocation.CountryCode = dr.GetString(2); iPLocation.Region = NullableData.GetString(dr, 3); iPLocation.City = NullableData.GetString(dr, 4); iPLocation.IsDirty = false; }
/// <summary> /// Loads the given BannedIP object from the given database data reader. /// </summary> /// <param name="bannedIP">The BannedIP object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(BannedIP bannedIP, IDataReader dr) { //SET FIELDS FROM ROW DATA bannedIP.BannedIPId = dr.GetInt32(0); bannedIP.StoreId = dr.GetInt32(1); bannedIP.IPRangeStart = dr.GetInt64(2); bannedIP.IPRangeEnd = dr.GetInt64(3); bannedIP.Comment = NullableData.GetString(dr, 4); bannedIP.IsDirty = false; }
/// <summary> /// Loads the given UserPersonalization object from the given database data reader. /// </summary> /// <param name="userPersonalization">The UserPersonalization object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(UserPersonalization userPersonalization, IDataReader dr) { //SET FIELDS FROM ROW DATA userPersonalization.PersonalizationPathId = dr.GetInt32(0); userPersonalization.UserId = dr.GetInt32(1); userPersonalization.PageSettings = NullableData.GetBytes(dr, 2); userPersonalization.Theme = NullableData.GetString(dr, 3); userPersonalization.MasterPageFile = NullableData.GetString(dr, 4); userPersonalization.LastUpdatedDate = LocaleHelper.ToLocalTime(dr.GetDateTime(5)); userPersonalization.IsDirty = false; }
/// <summary> /// Loads the given PaymentGateway object from the given database data reader. /// </summary> /// <param name="paymentGateway">The PaymentGateway object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(PaymentGateway paymentGateway, IDataReader dr) { //SET FIELDS FROM ROW DATA paymentGateway.PaymentGatewayId = dr.GetInt32(0); paymentGateway.StoreId = dr.GetInt32(1); paymentGateway.Name = dr.GetString(2); paymentGateway.ClassId = dr.GetString(3); paymentGateway.ConfigData = NullableData.GetString(dr, 4); paymentGateway.ReCrypt = dr.GetBoolean(5); paymentGateway.IsDirty = false; }
/// <summary> /// Loads the given ProductCustomField object from the given database data reader. /// </summary> /// <param name="productCustomField">The ProductCustomField object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ProductCustomField productCustomField, IDataReader dr) { //SET FIELDS FROM ROW DATA productCustomField.ProductFieldId = dr.GetInt32(0); productCustomField.ProductId = dr.GetInt32(1); productCustomField.IsUserDefined = dr.GetBoolean(2); productCustomField.IsVisible = dr.GetBoolean(3); productCustomField.FieldName = dr.GetString(4); productCustomField.FieldValue = NullableData.GetString(dr, 5); productCustomField.IsDirty = false; }
/// <summary> /// Loads the given ErrorMessage object from the given database data reader. /// </summary> /// <param name="errorMessage">The ErrorMessage object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ErrorMessage errorMessage, IDataReader dr) { //SET FIELDS FROM ROW DATA errorMessage.ErrorMessageId = dr.GetInt32(0); errorMessage.EntryDate = LocaleHelper.ToLocalTime(dr.GetDateTime(1)); errorMessage.StoreId = dr.GetInt32(2); errorMessage.MessageSeverityId = dr.GetByte(3); errorMessage.Text = dr.GetString(4); errorMessage.DebugData = NullableData.GetString(dr, 5); errorMessage.IsDirty = false; }
/// <summary> /// Loads the given UserPassword object from the given database data reader. /// </summary> /// <param name="userPassword">The UserPassword object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(UserPassword userPassword, IDataReader dr) { //SET FIELDS FROM ROW DATA userPassword.UserId = dr.GetInt32(0); userPassword.PasswordNumber = dr.GetByte(1); userPassword.Password = dr.GetString(2); userPassword.PasswordFormat = NullableData.GetString(dr, 3); userPassword.CreateDate = LocaleHelper.ToLocalTime(dr.GetDateTime(4)); userPassword.ForceExpiration = dr.GetBoolean(5); userPassword.IsDirty = false; }
/// <summary> /// Loads the given ReviewerProfile object from the given database data reader. /// </summary> /// <param name="reviewerProfile">The ReviewerProfile object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ReviewerProfile reviewerProfile, IDataReader dr) { //SET FIELDS FROM ROW DATA reviewerProfile.ReviewerProfileId = dr.GetInt32(0); reviewerProfile.Email = dr.GetString(1); reviewerProfile.DisplayName = dr.GetString(2); reviewerProfile.Location = NullableData.GetString(dr, 3); reviewerProfile.EmailVerified = dr.GetBoolean(4); reviewerProfile.EmailVerificationCode = NullableData.GetGuid(dr, 5); reviewerProfile.IsDirty = false; }
/// <summary> /// Loads the given Group object from the given database data reader. /// </summary> /// <param name="group">The Group object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Group group, IDataReader dr) { //SET FIELDS FROM ROW DATA group.GroupId = dr.GetInt32(0); group.StoreId = dr.GetInt32(1); group.Name = dr.GetString(2); group.Description = NullableData.GetString(dr, 3); group.IsTaxExempt = dr.GetBoolean(4); group.IsReadOnly = dr.GetBoolean(5); group.IsDirty = false; }
/// <summary> /// Loads the given ShipZone object from the given database data reader. /// </summary> /// <param name="shipZone">The ShipZone object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(ShipZone shipZone, IDataReader dr) { //SET FIELDS FROM ROW DATA shipZone.ShipZoneId = dr.GetInt32(0); shipZone.StoreId = dr.GetInt32(1); shipZone.Name = dr.GetString(2); shipZone.CountryRuleId = dr.GetByte(3); shipZone.ProvinceRuleId = dr.GetByte(4); shipZone.PostalCodeFilter = NullableData.GetString(dr, 5); shipZone.ExcludePostalCodeFilter = NullableData.GetString(dr, 6); shipZone.IsDirty = false; }
/// <summary> /// Loads the given KitComponent object from the given database data reader. /// </summary> /// <param name="kitComponent">The KitComponent object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(KitComponent kitComponent, IDataReader dr) { //SET FIELDS FROM ROW DATA kitComponent.KitComponentId = dr.GetInt32(0); kitComponent.StoreId = dr.GetInt32(1); kitComponent.Name = dr.GetString(2); kitComponent.UserPrompt = NullableData.GetString(dr, 3); kitComponent.InputTypeId = dr.GetInt16(4); kitComponent.Columns = dr.GetByte(5); kitComponent.HeaderOption = NullableData.GetString(dr, 6); kitComponent.IsDirty = false; }
/// <summary> /// Loads the given WrapStyle object from the given database data reader. /// </summary> /// <param name="wrapStyle">The WrapStyle object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(WrapStyle wrapStyle, IDataReader dr) { //SET FIELDS FROM ROW DATA wrapStyle.WrapStyleId = dr.GetInt32(0); wrapStyle.WrapGroupId = dr.GetInt32(1); wrapStyle.Name = dr.GetString(2); wrapStyle.TaxCodeId = NullableData.GetInt32(dr, 3); wrapStyle.Price = dr.GetDecimal(4); wrapStyle.ThumbnailUrl = NullableData.GetString(dr, 5); wrapStyle.ImageUrl = NullableData.GetString(dr, 6); wrapStyle.OrderBy = dr.GetInt16(7); wrapStyle.IsDirty = false; }
/// <summary> /// Loads the given Option object from the given database data reader. /// </summary> /// <param name="option">The Option object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Option option, IDataReader dr) { //SET FIELDS FROM ROW DATA option.OptionId = dr.GetInt32(0); option.Name = dr.GetString(1); option.HeaderText = NullableData.GetString(dr, 2); option.ShowThumbnails = dr.GetBoolean(3); option.ThumbnailColumns = dr.GetByte(4); option.ThumbnailWidth = dr.GetInt16(5); option.ThumbnailHeight = dr.GetInt16(6); option.CreatedDate = LocaleHelper.ToLocalTime(dr.GetDateTime(7)); option.IsDirty = false; }
/// <summary> /// Loads the given OrderStatus object from the given database data reader. /// </summary> /// <param name="orderStatus">The OrderStatus object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(OrderStatus orderStatus, IDataReader dr) { //SET FIELDS FROM ROW DATA orderStatus.OrderStatusId = dr.GetInt32(0); orderStatus.StoreId = dr.GetInt32(1); orderStatus.Name = dr.GetString(2); orderStatus.DisplayName = NullableData.GetString(dr, 3); orderStatus.InventoryActionId = dr.GetInt16(4); orderStatus.IsActive = dr.GetBoolean(5); orderStatus.IsValid = dr.GetBoolean(6); orderStatus.OrderBy = dr.GetInt16(7); orderStatus.IsDirty = false; }
/// <summary> /// Loads the given EmailList object from the given database data reader. /// </summary> /// <param name="emailList">The EmailList object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(EmailList emailList, IDataReader dr) { //SET FIELDS FROM ROW DATA emailList.EmailListId = dr.GetInt32(0); emailList.StoreId = dr.GetInt32(1); emailList.Name = dr.GetString(2); emailList.Description = NullableData.GetString(dr, 3); emailList.IsPublic = dr.GetBoolean(4); emailList.SignupRuleId = dr.GetInt16(5); emailList.SignupEmailTemplateId = NullableData.GetInt32(dr, 6); emailList.LastSendDate = LocaleHelper.ToLocalTime(NullableData.GetDateTime(dr, 7)); emailList.IsDirty = false; }
/// <summary> /// Loads the given EmailTemplate object from the given database data reader. /// </summary> /// <param name="emailTemplate">The EmailTemplate object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(EmailTemplate emailTemplate, IDataReader dr) { //SET FIELDS FROM ROW DATA emailTemplate.EmailTemplateId = dr.GetInt32(0); emailTemplate.StoreId = dr.GetInt32(1); emailTemplate.Name = dr.GetString(2); emailTemplate.ToAddress = dr.GetString(3); emailTemplate.FromAddress = dr.GetString(4); emailTemplate.ReplyToAddress = NullableData.GetString(dr, 5); emailTemplate.CCList = NullableData.GetString(dr, 6); emailTemplate.BCCList = NullableData.GetString(dr, 7); emailTemplate.Subject = NullableData.GetString(dr, 8); emailTemplate.ContentFileName = NullableData.GetString(dr, 9); emailTemplate.IsHTML = dr.GetBoolean(10); emailTemplate.IsDirty = false; }
/// <summary> /// Loads the given UpsOrigin object from the given database data reader. /// </summary> /// <param name="upsOrigin">The UpsOrigin object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(UpsOrigin upsOrigin, IDataReader dr) { //SET FIELDS FROM ROW DATA upsOrigin.CountryCode = dr.GetString(0); upsOrigin.CountryName = NullableData.GetString(dr, 1); upsOrigin.CurrencyName = NullableData.GetString(dr, 2); upsOrigin.CurrencyCode = NullableData.GetString(dr, 3); upsOrigin.EuroAllowed = NullableData.GetInt16(dr, 4); upsOrigin.MIVDollar = NullableData.GetDecimal(dr, 5); upsOrigin.MIVEuro = NullableData.GetDecimal(dr, 6); upsOrigin.UOM = NullableData.GetInt16(dr, 7); upsOrigin.MaxWeight = NullableData.GetDecimal(dr, 8); upsOrigin.MaxMetricWeight = NullableData.GetDecimal(dr, 9); upsOrigin.EUMember = NullableData.GetInt16(dr, 10); upsOrigin.IsDirty = false; }
/// <summary> /// Loads the given Webpage object from the given database data reader. /// </summary> /// <param name="webpage">The Webpage object to load.</param> /// <param name="dr">The database data reader to read data from.</param> public static void LoadDataReader(Webpage webpage, IDataReader dr) { //SET FIELDS FROM ROW DATA webpage.WebpageId = dr.GetInt32(0); webpage.StoreId = dr.GetInt32(1); webpage.Name = NullableData.GetString(dr, 2); webpage.Summary = NullableData.GetString(dr, 3); webpage.Description = NullableData.GetString(dr, 4); webpage.ThumbnailUrl = NullableData.GetString(dr, 5); webpage.ThumbnailAltText = NullableData.GetString(dr, 6); webpage.DisplayPage = NullableData.GetString(dr, 7); webpage.Theme = NullableData.GetString(dr, 8); webpage.HtmlHead = NullableData.GetString(dr, 9); webpage.VisibilityId = dr.GetByte(10); webpage.IsDirty = false; }