protected void Bind() { ImageBind(); WMGoods good = WMGoods.Get(Id); if (good != null) { CategoryMasterBind(good.Categories); BrandBind(good.BrandId); StateBind(good.StatusId); GoodName.Text = good.Name; OriginalPrice.Text = good.OriginalPrice.ToString(); PresentPrice.Text = good.PresentPrice.ToString(); GoodUnit.Text = good.Unit; GoodInte.Text = good.Integral.ToString(); GoodBonus.Text = good.Bonus.ToString(); GoodGoldPool.Text = good.GoldPool.ToString(); AddDate.Text = good.AddDate.ToString("yyyy-MM-dd HH:mm"); GoodDsec.Text = good.Desc; GoodSpec.Text = good.Spec; GoodService.Text = good.Service; GoodClick.Text = good.Clicks.ToString(); GoodSave.Text = good.Saves.ToString(); } }
protected void ListBind() { int pageCount = 0; List <WMGoods> list = WMGoods.GetList(out pageCount, CategoryId, BrandId, null, StateId, OrderBy, Pager.CurrentPageIndex - 1, Pager.PageSize); ListConatner.DataSource = list; ListConatner.DataBind(); Pager.RecordCount = pageCount; }
protected void ListConatner_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { string goodId = e.CommandArgument.ToString(); bool flag = WMGoods.Delete(goodId); if (flag) { Bind(); } Helper.MessageBox(flag); } }
protected void SubmitButton_Click(object sender, EventArgs e) { bool flag = false; if (this.IsValid) { string cid = CategoryId.Value; if (General.IsNullable(cid)) { CategoryValid.CssClass = CategoryValid.CssClass.Replace(" hide", ""); return; } WMGoods good = WMGoods.Get(Id); if (good != null) { good.Name = GoodName.Text; good.CategoryId = cid; good.BrandId = BrandList.SelectedValue; good.OriginalPrice = OriginalPrice.Text.ToDouble().Value; good.PresentPrice = PresentPrice.Text.ToDouble(); good.Unit = GoodUnit.Text; good.Integral = GoodInte.Text.ToInt32(); good.Bonus = GoodBonus.Text.ToInt32(); good.GoldPool = GoodGoldPool.Text.ToInt32(); good.Desc = GoodDsec.Text; good.Spec = GoodSpec.Text; good.Service = GoodService.Text; good.StatusId = StateList.SelectedValue.ToInt32(); flag = good.Update(); } } if (flag) { Bind(); } Helper.MessageBox(flag); }
protected void SubmitButton_Click(object sender, EventArgs e) { bool flag = false; if (this.IsValid) { string cid = CategoryId.Value; if (General.IsNullable(cid)) { CategoryValid.CssClass = CategoryValid.CssClass.Replace(" hide", ""); return; } WMGoods good = new WMGoods(); good.Name = GoodName.Text; good.CategoryId = cid; good.BrandId = BrandList.SelectedValue; good.OriginalPrice = OriginalPrice.Text.ToDouble().Value; good.PresentPrice = PresentPrice.Text.ToDouble(); good.Unit = GoodUnit.Text; good.Integral = GoodInte.Text.ToInt32(); good.Bonus = GoodBonus.Text.ToInt32(); good.GoldPool = GoodGoldPool.Text.ToInt32(); good.Desc = GoodDsec.Text; good.Spec = GoodSpec.Text; good.Service = GoodService.Text; good.StatusId = StateList.SelectedValue.ToInt32(); flag = good.Add(); if (flag) { string url = string.Format("~/admin/modules/good/goods/upload.aspx?gid={0}", good.Id); Response.Redirect(url); return; } } Helper.MessageBox(flag); }