private void bindCurrencyAll(KeyCurrency c, IList currencyAll) { set("c.Name", c.Name); set("c.Unit", c.Unit); set("c.InitValue", c.InitValue); set("c.EditUrl", to(EditKeyCurrency)); set("c.IsShow", (c.IsShow == 1) ? "√" : "×"); set("c.CanRate", (c.CanRate == 1) ? "√" : "×"); IBlock block = getBlock("list"); foreach (Currency currency in currencyAll) { block.Set("s.Name", currency.Name); block.Set("s.Unit", currency.Unit); block.Set("s.ExchangeRate", currency.ExchangeRate); block.Set("s.InitValue", currency.InitValue); block.Set("s.IsShow", (currency.IsShow == 1) ? "√" : "×"); block.Set("s.CanDeal", (currency.CanDeal == 1) ? "√" : "×"); block.Set("s.CanRate", (currency.CanRate == 1) ? "√" : "×"); block.Set("s.SetActionUrl", to(EditCurrency, currency.Id)); String deleteLink = ""; if (currency.CanDelete == 1) { deleteLink = string.Format("<a href=\"{0}\" class=\"deleteCmd\">" + lang("delete") + "</a>", to(Delete, currency.Id)); } block.Set("s.DeleteUrl", deleteLink); block.Next(); } }
public virtual void EditKeyCurrency() { target(UpdateKeyCurrency); KeyCurrency c = KeyCurrency.Instance; bindKeyCurrencyEdit(c); }
public virtual void EditKeyInit() { target(UpdateKeyInit); KeyCurrency c = KeyCurrency.Instance; bind("c", c); }
private void bindKeyCurrencyEdit(KeyCurrency c) { set("c.Name", c.Name); set("c.Unit", c.Unit); set("c.InitValue", c.InitValue); set("c.IsShow", (c.IsShow == 1) ? "checked='checked'" : ""); set("c.CanRate", (c.CanRate == 1) ? "checked='checked'" : ""); }
public virtual void Index() { set("addUrl", to(Add)); KeyCurrency c = KeyCurrency.Instance; IList currencyAll = currencyService.GetCurrencyAll(); bindCurrencyAll(c, currencyAll); }
public virtual void UpdateKeyInit() { KeyCurrency c = KeyCurrency.Instance; c.InitValue = ctx.PostInt("InitValue"); c.update(); log(SiteLogString.UpdateKeyCurrencyInit(), typeof(KeyCurrency)); echoToParentPart(lang("saved")); }
public virtual void UpdateKeyCurrency() { KeyCurrency c = KeyCurrency.Instance; c.Name = ctx.Post("Name"); c.Unit = ctx.Post("Unit"); c.InitValue = ctx.PostInt("InitValue"); c.IsShow = ctx.PostIsCheck("IsShow"); c.CanRate = ctx.PostIsCheck("CanRate"); if (strUtil.IsNullOrEmpty(c.Name)) { errors.Add(lang("exName")); run(EditKeyCurrency); } else { c.update(); log(SiteLogString.UpdateKeyCurrency(), typeof(KeyCurrency)); echoToParentPart(lang("saved")); } }