public static void CopyStyle(Style style) { var styleCard = new StyleCard(); styleCard.GetData(style); styleCard._style = null; styleCard.ShowDialog(); }
public static Style GetDefault() { var style = new Style(); style.Title = StyleTag.TitleClear.InBrakets(); style.Header = StyleTag.TitleClear.InBrakets(); style.Content = StyleTag.Description.InBrakets(); style.Footer = string.Empty; return style; }
private void GetData(Style style) { _style = style; txtName.Text = _style.Name; txtTitle.Text = _style.Title; txtHeader.Text = _style.Header; txtContent.Text = _style.Content; txtFooter.Text = _style.Footer; txtDefaultMrkCategory.SelectedItem = _style.DefMarketCategoryObj; }
private void SetStyle(Style style) { _style = style; if (_style != null) { txtStyle.Text = _style.Name; } }
private AppleResult Apply(Style style, StyleType styleType) { if (style == null) return _lastAppleRes; if (_lastAppleRes == null) _lastAppleRes = new AppleResult(); AppleResult appleResultSpec = new AppleResult(); appleResultSpec.Type = styleType; appleResultSpec.Title = Apply(style.Title, _lastAppleRes.Title); appleResultSpec.Header = Apply(style.Header, _lastAppleRes.Header); appleResultSpec.Content = Apply(style.Content, _lastAppleRes.Content); appleResultSpec.Footer = Apply(style.Footer, _lastAppleRes.Footer); SaveToDict(appleResultSpec); _lastAppleRes = appleResultSpec; return appleResultSpec; }
private void AddToDict(Product product, BegemotProduct bproduct, Style specialStyle, Sale activeSale) { valueDict.Add(StyleTag.Title, bproduct.GetClearTitle()); valueDict.Add(StyleTag.TitleShort, bproduct.GetTitleShort()); valueDict.Add(StyleTag.TitleClear, bproduct.GetClearTitle()); valueDict.Add(StyleTag.TitleClearShort, bproduct.GetClearShortTitle()); valueDict.Add(StyleTag.Description, bproduct.GetClearDescrption()); valueDict.Add(StyleTag.Price, product.Price.ToString("f2")); valueDict.Add(StyleTag.PriceOld, product.PriceOld.ToString("f2")); var codeProduct = product.GetCode(); valueDict.Add(StyleTag.CodeProduct, codeProduct); if (specialStyle != null) { var codeStyle = specialStyle.GetCode(true); //codeStyle = HttpUtility.UrlEncode(codeStyle); valueDict.Add(StyleTag.CodeStyle, codeStyle); } if (activeSale != null) { var codeSale = activeSale.GetCode(true); // codeSale = HttpUtility.UrlEncode(codeSale); valueDict.Add(StyleTag.CodeSale, codeSale); } var salesLinks = SalesLinks(); valueDict.Add(StyleTag.Sales, salesLinks); var menuLinks = MenuLinks(); valueDict.Add(StyleTag.Menu, menuLinks); }
public void ApplyStyles(Product product, BegemotProduct bproduct, Style specialStyle, Style saleStyle, Style marketStyle, Marketplace market, Adv24au adv) { //bool isNoStyles = specialStyle == null && saleStyle == null && marketStyle == null; var activeSale = product.GetActiveSale(); Style defultStyle = Style.GetDefault(); valueDict = new Dictionary<string, string>(); AddToDict(product, bproduct, specialStyle, activeSale); AppleResult ar = null; ar = Apply(defultStyle, StyleType.SpecialDescrition); ar = Apply(specialStyle, StyleType.SpecialDescrition); ar = Apply(saleStyle, StyleType.Sale); ar = Apply(marketStyle, StyleType.MarketPlace); ar.ClearTags(); //ar.ClearPolicyWords(market); var title = ar.GetResultTitle(); var description = ar.GetResultDescription(); if (adv == null) { product.Title = title; product.Description = description; } else { title = market.PrepareTitle(title); description = market.PrepareDescription(description); adv.Title = title; adv.Description = description; } }
private void Choose() { var row = (DataSourceRow)gridView1.GetFocusedRow(); if (row == null) { return; } _style = row.GetStyle(); DialogResult = DialogResult.OK; }
public DataSourceRow(Style style) { _style = style; }
public void SetActiveStyle(Style style) { if (Styles.Any(s => s.Id == style.Id)) return; Styles.Clear(); if (style == null) return; Styles.Add(style); }
public static string GetCode(Style style, bool tagMode=false) { if (style == null) return string.Empty; string code = string.Format("s{0}", Encode(style.Id)); if (tagMode) { code = string.Format("{0} {1}", prefix, code); code = HttpUtility.UrlEncode(code); } return code; }
private void Save() { if (_style == null) { _style = new Style(); Context.Inst.StyleSet.Add(_style); _style.Active = true; _style.StyleType = _styleType; } SetData(_style); Context.Save(); }
public static void UpdateStyle(Style style) { var styleCard = new StyleCard(); styleCard.GetData(style); styleCard.ShowDialog(); }
private void SetData(Style style) { style.Name = txtName.Text.Trim(); style.Title = txtTitle.Text.Trim(); style.Header = txtHeader.Text.Trim(); style.Content = txtContent.Text.Trim(); style.Footer = txtFooter.Text.Trim(); _style.DefMarketCategoryObj = (MarketCategory)txtDefaultMrkCategory.SelectedItem; style.DateUpdate = DateTime.Now; }