public void MakeChanges(ModificationControl <bool> control, MerchantTribe.Commerce.Catalog.Product item) { if (control.ID == "TaxExemptBooleanModifierField") { item.TaxExempt = control.ApplyChanges(item.TaxExempt); } else if (control.ID == "NonShippingBooleanModifierField") { item.ShippingDetails.IsNonShipping = control.ApplyChanges(item.ShippingDetails.IsNonShipping); } else if (control.ID == "ShipSeperatelyBooleanModifierField") { item.ShippingDetails.ShipSeparately = control.ApplyChanges(item.ShippingDetails.ShipSeparately); } else if (control.ID == "ProductStateBooleanModifierField") { if (control.ApplyChanges(item.Status == MerchantTribe.Commerce.Catalog.ProductStatus.Active)) { item.Status = MerchantTribe.Commerce.Catalog.ProductStatus.Active; } else { item.Status = MerchantTribe.Commerce.Catalog.ProductStatus.Disabled; } } else if (control.ID == "GiftWrapAllowedBooleanModifierField") { item.GiftWrapAllowed = control.ApplyChanges(item.GiftWrapAllowed); } else { throw new ControlNotFoundException(control.ID); } }
public void MakeChanges(ModificationControl <int> control, MerchantTribe.Commerce.Catalog.Product item) { if (control.ID == "MinimumQuantityIntegerModifierField") { item.MinimumQty = control.ApplyChanges(item.MinimumQty); } else { throw new ControlNotFoundException(control.ID); } }
private string RemoteUrl(MerchantTribe.Commerce.Catalog.Product p) { string temp = BuildUrlForProduct(p); temp = temp.Replace("\\", "/"); if (temp.ToLower().StartsWith("http://") == false) { return(System.IO.Path.Combine(MTApp.CurrentStore.RootUrl(), temp.TrimStart('/'))); } else { return(temp); } }
// Order has Products Editor private void LoadOrderProductEditor(OrderHasProducts q) { this.ProductPickerOrderProducts.LoadSearch(); List <FriendlyBvinDisplay> displayData = new List <FriendlyBvinDisplay>(); foreach (string bvin in q.CurrentProductIds()) { FriendlyBvinDisplay item = new FriendlyBvinDisplay(); item.bvin = bvin; item.DisplayName = bvin; MerchantTribe.Commerce.Catalog.Product p = MyPage.MTApp.CatalogServices.Products.Find(item.bvin); if (p != null) { item.DisplayName = "[" + p.Sku + "] " + p.ProductName; } displayData.Add(item); } this.gvOrderProducts.DataSource = displayData; this.gvOrderProducts.DataBind(); }
public void MakeChanges(ModificationControl <decimal> control, MerchantTribe.Commerce.Catalog.Product item) { if (control.ID == "ListPriceMonetaryModifierField") { item.ListPrice = control.ApplyChanges(item.ListPrice); } else if (control.ID == "SitePriceMonetaryModifierField") { item.SitePrice = control.ApplyChanges(item.SitePrice); } else if (control.ID == "SiteCostMonetaryModifierField") { item.SiteCost = control.ApplyChanges(item.SiteCost); } else if (control.ID == "ExtraShipFeeMonetaryModifierField") { item.ShippingDetails.ExtraShipFee = control.ApplyChanges(item.ShippingDetails.ExtraShipFee); } else { throw new ControlNotFoundException(control.ID); } }
public void MakeChanges(ModificationControl <double> control, MerchantTribe.Commerce.Catalog.Product item) { if (control.ID == "ShippingWeightFloatModifierField") { item.ShippingDetails.Weight = (decimal)control.ApplyChanges((double)item.ShippingDetails.Weight); } else if (control.ID == "ShippingLengthFloatModifierField") { item.ShippingDetails.Length = (decimal)control.ApplyChanges((double)item.ShippingDetails.Length); } else if (control.ID == "ShippingWidthFloatModifierField") { item.ShippingDetails.Width = (decimal)control.ApplyChanges((double)item.ShippingDetails.Width); } else if (control.ID == "ShippingHeightFloatModifierField") { item.ShippingDetails.Height = (decimal)control.ApplyChanges((double)item.ShippingDetails.Height); } else { throw new ControlNotFoundException(control.ID); } }
private string BuildPhysicalUrlForProduct(MerchantTribe.Commerce.Catalog.Product p) { return(MerchantTribe.Commerce.Utilities.UrlRewriter.BuildUrlForProduct(p, this.Page)); }
private void WriteItem(MerchantTribe.Commerce.Catalog.Product p, ref StringBuilder sb, string expirationDate) { sb.Append(SafeString(p.Bvin)); sb.Append("\t"); sb.Append(SafeString(p.Sku)); sb.Append("\t"); sb.Append(SafeString(p.ProductName)); sb.Append("\t"); sb.Append(MerchantTribe.Web.Text.TrimToLength(SafeString(p.LongDescription), 10000)); sb.Append("\t"); sb.Append(RemoteImageUrl(p.ImageFileMedium)); sb.Append("\t"); sb.Append(SafeString(RemoteUrl(p))); sb.Append("\t"); sb.Append(SafeString(p.GetCurrentPrice(string.Empty, 0m, null, string.Empty).ToString())); sb.Append("\t"); sb.Append(SafeString("starting")); // Price Type sb.Append("\t"); sb.Append(SafeString("1")); sb.Append("\t"); sb.Append(string.Empty); // payment_accepted - cash,check,GoogleCheckout,Visa,MasterCard,AmericanExpress,Discover,wiretransfer sb.Append("\t"); sb.Append(string.Empty); // payment_notes sb.Append("\t"); List <MerchantTribe.Commerce.Catalog.ProductProperty> props = MTApp.CatalogServices.ProductPropertiesFindForType(p.ProductTypeId); sb.Append(SafeString(PropertyMatcher("shipping", props, p.Bvin))); sb.Append("\t"); int expirationDays = 30; DateTime expDate = DateTime.Now.AddDays(expirationDays); sb.Append(SafeString(expirationDate)); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("actor", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("apparel_type", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("artist", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("author", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("brand", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("color", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("condition", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("model_number", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("format", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("isbn", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("memory", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("pickup", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("processor_speed", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("size", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("tax_percent", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("tax_region", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("upc", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(PropertyMatcher("product_type", props, p.Bvin))); sb.Append("\t"); sb.Append(SafeString(lstCondition.SelectedItem.Value)); sb.Append(System.Environment.NewLine); }
public void MakeChanges(ModificationControl <string> control, MerchantTribe.Commerce.Catalog.Product item) { if (control.ID == "ProductNameStringModifierField") { item.ProductName = control.ApplyChanges(item.ProductName); } else if (control.ID == "ProductSkuStringModifierField") { item.Sku = control.ApplyChanges(item.Sku); } else if (control.ID == "MetaKeywordsStringModifierField") { item.MetaKeywords = control.ApplyChanges(item.MetaKeywords); } else if (control.ID == "MetaDescriptionStringModifierField") { item.MetaDescription = control.ApplyChanges(item.MetaDescription); } else if (control.ID == "MetaTitleStringModifierField") { item.MetaTitle = control.ApplyChanges(item.MetaTitle); } else if (control.ID == "ImageFileSmallStringModifierField") { item.ImageFileSmall = control.ApplyChanges(item.ImageFileSmall); } else if (control.ID == "ImageFileMediumStringModifierField") { item.ImageFileMedium = control.ApplyChanges(item.ImageFileMedium); } else if (control.ID == "ShortDescriptionStringModifierField") { item.ShortDescription = control.ApplyChanges(item.ShortDescription); } else if (control.ID == "LongDescriptionHtmlModifierField") { item.LongDescription = control.ApplyChanges(item.LongDescription); } else if (control.ID == "KeyWordsStringModifierField") { item.Keywords = control.ApplyChanges(item.Keywords); } else if (control.ID == "UrlToRewriteStringModifierField") { item.UrlSlug = control.ApplyChanges(item.UrlSlug); } else if (control.ID == "SitePriceOverrideStringModifierField") { item.SitePriceOverrideText = control.ApplyChanges(item.SitePriceOverrideText); } else if (control.ID == "ManufacturerEnumeratedValueModifierField") { item.ManufacturerId = control.ApplyChanges(item.ManufacturerId); } else if (control.ID == "PreContentColumnEnumeratedValueModifierField") { item.PreContentColumnId = control.ApplyChanges(item.PreContentColumnId); } else if (control.ID == "PostContentColumnEnumeratedValueModifierField") { item.PostContentColumnId = control.ApplyChanges(item.PostContentColumnId); } //else if (control.ID == "TaxClassEnumeratedValueModifierField") { // item.TaxSchedule = long.Parse(control.ApplyChanges(item.TaxSchedule)); //} else if (control.ID == "VendorEnumeratedValueModifierField") { item.VendorId = control.ApplyChanges(item.VendorId); } else { throw new ControlNotFoundException(control.ID); } }
public void PostChangesToProduct(MerchantTribe.Commerce.Catalog.Product item) { bool process = false; Collection <ModificationControlBase> controls = new Collection <ModificationControlBase>(); foreach (System.Web.UI.Control rowControl in this.ProductModificationPanel.Controls) { if (rowControl is HtmlTableRow) { foreach (System.Web.UI.Control cellControl in rowControl.Controls) { if (cellControl is HtmlTableCell) { foreach (System.Web.UI.Control control in cellControl.Controls) { if (control is CheckBox) { process = ((CheckBox)control).Checked; } if (process) { if (control is ModificationControlBase) { controls.Add((ModificationControlBase)control); } } } } } } } foreach (ModificationControlBase control in controls) { if (control is ModificationControl <string> ) { ModificationControl <string> stringControl = (ModificationControl <string>)control; MakeChanges(stringControl, item); } else if (control is ModificationControl <bool> ) { ModificationControl <bool> booleanControl = (ModificationControl <bool>)control; MakeChanges(booleanControl, item); } else if (control is ModificationControl <int> ) { ModificationControl <int> integerControl = (ModificationControl <int>)control; MakeChanges(integerControl, item); } else if (control is ModificationControl <double> ) { ModificationControl <double> floatControl = (ModificationControl <double>)control; MakeChanges(floatControl, item); } else if (control is ModificationControl <decimal> ) { ModificationControl <decimal> monetaryControl = (ModificationControl <decimal>)control; MakeChanges(monetaryControl, item); } } }