public void DeleteIco(int CategoryId) { BLL.Tao.Categories CateBll = new BLL.Tao.Categories(); Model.Tao.Categories Val = CateBll.GetModel(CategoryId); if (Val.IconUrl != null) { HiUploader.DeleteImage(Val.IconUrl); CateBll.UpdateImgURL(CategoryId.ToString()); } }
private void InitDate(int cateId) { BLL.Tao.Categories cateBll = new BLL.Tao.Categories(); Model.Tao.Categories model = cateBll.GetModel(cateId); if (model != null) { string[] cateArr = model.Path.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); switch (cateArr.Length) { case 3: InitFullCateInfo(cateId, cateArr, 3); break; case 2: InitFullCateInfo(cateId, cateArr, 0); break; default: break; } } }
private void BiudTree() { BLL.Tao.Categories CateBll = new BLL.Tao.Categories(); DataTable dt = CateBll.GetList("").Tables[0]; this.listTarget.Items.Clear(); //加载树 this.listTarget.Items.Add(new ListItem(" ", "0")); DataRow[] drs = dt.Select("ParentCategoryId= " + 0); foreach (DataRow r in drs) { string nodeid = r["CategoryId"].ToString(); string text = r["Name"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, nodeid)); int sonparentid = int.Parse(nodeid); string blank = "├"; BindNode(sonparentid, dt, blank); } this.listTarget.DataBind(); }
private void GetCateNav(HttpContext context) { JsonObject json = new JsonObject(); string strId = context.Request.Params["cateID"]; int cateId = Common.Globals.SafeInt(strId, 0); BLL.Tao.Categories categoriesBLL = new BLL.Tao.Categories(); System.Text.StringBuilder str = new System.Text.StringBuilder(); Maticsoft.Model.Tao.Categories model = categoriesBLL.GetModelByCache(cateId); if (null != model) { string[] strPath = model.Path.Split('|'); str.Append(" 全部分类 "); foreach (string s in strPath) { if (Maticsoft.Common.PageValidate.IsNumber(s)) { Maticsoft.Model.Tao.Categories categoriesModel = categoriesBLL.GetModelByCache(int.Parse(s)); if (null != categoriesModel) { str.Append(" > " + categoriesModel.Name); } } } json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS); json.Put("NAV", str.ToString()); } else { json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED); } context.Response.Write(json.ToString()); }
public string NavInfo(object cid) { if (cid != null) { if (!string.IsNullOrEmpty(cid.ToString())) { int cateId = Common.Globals.SafeInt(cid.ToString(), 0); BLL.Tao.Categories categoriesBLL = new BLL.Tao.Categories(); System.Text.StringBuilder str = new System.Text.StringBuilder(); Maticsoft.Model.Tao.Categories model = categoriesBLL.GetModelByCache(cateId); if (null != model) { string[] strPath = model.Path.Split('|'); str.Append(" 全部分类 "); foreach (string s in strPath) { if (Maticsoft.Common.PageValidate.IsNumber(s)) { Maticsoft.Model.Tao.Categories categoriesModel = categoriesBLL.GetModelByCache(int.Parse(s)); if (null != categoriesModel) { str.Append(" > " + categoriesModel.Name); } } } return str.ToString(); } else { return ""; } } else { return ""; } } else { return ""; } }