//添加二级分类 public void AddCateList(int parentid, string txtName, string txtIntro, int txtOrderby) { UserIdentity identity = User.Identity as UserIdentity; try { bool b = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetParentId(parentid, identity.ShopID); if (!b) { Response.Write(3); } else { Weifenxiao.Entity.ProductClsEntity model = new Weifenxiao.Entity.ProductClsEntity(); model.ShopId = identity.ShopID; model.Clsname = txtName; model.ParentId = parentid; model.Description = txtIntro; model.orderby = txtOrderby; model.Status = 1; model.Addtime = DateTime.Now; model.Updatetime = DateTime.Now; Weifenxiao.BLL.ProductClsBLL.GetInstance().Insert(model); Jnwf.Utils.Helper.HttpHelper.LoadPageContent("http://m.disneybg.com/clear.aspx?type=config&shopid=" + identity.ShopID); Response.Write(1); } } catch (Exception ex) { Response.Write(2); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UserIdentity identity = User.Identity as UserIdentity; shopid = identity.ShopID; IList <Weifenxiao.Entity.ProductClsEntity> ProductClsList = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetListByShopId(identity.ShopID); ddl_Category.DataSource = ProductClsList; ddl_Category.DataTextField = "Clsname"; ddl_Category.DataValueField = "ClsId"; ddl_Category.DataBind(); ListItem list = new ListItem("--暂无父类--", "-1"); ddl_Category.Items.Insert(0, list); ddl_Category.SelectedIndex = 0; if (categoryId != 0) { Weifenxiao.Entity.ProductClsEntity model = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetAdminSingle(categoryId); txtIntro.Value = model.Description; txtOrderby.Value = model.orderby.ToString(); txtName.Value = model.Clsname.ToString(); if (model.Image != "") { strImgs = strImgs + "<div class=\"uploadImgitem\"><img src=\"" + model.Image + "\" /><span onclick=\"fnDelImg(this)\">删除</span></div>"; } } } }
public void getCateList(int cid) { try { Weifenxiao.Entity.ProductClsEntity model = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetAdminSingle(cid); Response.Write(Jnwf.Utils.Json.JsonHelper.SerializeJson(model)); } catch (Exception ex) { Response.Write(2); } }
/// <summary> /// 编辑二级分类 /// </summary> /// <param name="clsid"></param> /// <param name="parentid"></param> /// <param name="txtName"></param> /// <param name="txtIntro"></param> /// <param name="txtOrderby"></param> public void updateCateList(int clsid, int parentid, string txtName, string txtIntro, int txtOrderby) { try { Weifenxiao.Entity.ProductClsEntity model = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetAdminSingle(clsid); model.ParentId = parentid; model.Clsname = txtName; model.Description = txtIntro; model.orderby = txtOrderby; model.Updatetime = DateTime.Now; Weifenxiao.BLL.ProductClsBLL.GetInstance().Update(model); //Jnwf.Utils.Helper.HttpHelper.LoadPageContent("http://m.disneybg.com/clear.aspx?type=config&shopid=" + parentid); Response.Write(1); } catch (Exception ex) { Response.Write(2); } }
protected void btn_Submit_Click(object sender, EventArgs e) { Weifenxiao.Entity.ProductClsEntity model = new Weifenxiao.Entity.ProductClsEntity(); if (categoryId != 0) { model = Weifenxiao.BLL.ProductClsBLL.GetInstance().GetAdminSingle(categoryId); model.Updatetime = DateTime.Now; } else { UserIdentity identity = User.Identity as UserIdentity; model.ShopId = identity.ShopID; model.Addtime = DateTime.Now; model.Updatetime = DateTime.Now; model.Status = 1; } model.Clsname = txtName.Value; model.Description = txtIntro.Value; model.orderby = Convert.ToInt16(txtOrderby.Value); string[] imgs = (txt_img.Value.ToString()).Split(','); if (imgs.Length > 0) { model.Image = imgs[0]; } else { model.Image = ""; } if (categoryId != 0) { Weifenxiao.BLL.ProductClsBLL.GetInstance().Update(model); } else { Weifenxiao.BLL.ProductClsBLL.GetInstance().Insert(model); } Response.Redirect("/product/cateList.aspx"); }