//public string Article_Category_Select(int cate_id, string div_name) //{ // string select_list = ""; // string select_tmp = ""; // int grade = 0; // int i; // int parentid = 0; // string select_name = ""; // string cate_relate = Get_Category_Relate(cate_id, ""); // cate_relate = cate_relate + ","; // foreach (string cate in cate_relate.Split(',')) // { // if (cate.Length > 0) // { // QueryInfo Query = new QueryInfo(); // Query.CurrentPage = 1; // Query.PageSize = 0; // Query.ParamInfos.Add(new ParamInfo("AND", "str", "ArticleCateInfo.Article_Cate_ParentID", "=", cate)); // IList<ArticleCateInfo> cates = MyBLL.GetArticleCates(Query, Public.GetUserPrivilege()); // if (cates != null) // { // grade = grade + 1; // if (grade == 1) // { // select_tmp = "<select id=\"article_cate\" name=\"article_cate\" onchange=\"change_maincate('" + div_name + "','article_cate');\">"; // select_tmp = select_tmp + "<option value=\"0\">选择类别</option>"; // } // else // { // select_name = "article_cate"; // for (i = 1; i < grade; i++) // { // select_name = select_name + "_parent"; // } // select_tmp = "<select id=\"" + select_name + "\" name=\"" + select_name + "\" onchange=\"change_maincate('" + div_name + "','" + select_name + "');\">"; // select_tmp = select_tmp + "<option value=\"0\">选择类别</option>"; // } // foreach (ArticleCateInfo entity in cates) // { // if (parentid == entity.Article_Cate_ID || cate_id == entity.Article_Cate_ID) // { // select_tmp = select_tmp + "<option value=\"" + entity.Article_Cate_ID + "\" selected>" + entity.Article_Cate_Name + "</option>"; // } // else // { // select_tmp = select_tmp + "<option value=\"" + entity.Article_Cate_ID + "\">" + entity.Article_Cate_Name + "</option>"; // } // } // select_tmp = select_tmp + "</select> "; // parentid = tools.CheckInt(cate); // } // Query = null; // cates = null; // select_list = select_tmp + select_list; // } // } // return select_list; //} public string Get_Category_Relate(int cate_id, string cate_str) { string cate_relate = cate_id.ToString(); if (cate_id > 0) { ArticleCateInfo cate = MyBLL.GetArticleCateByID(cate_id, Public.GetUserPrivilege()); if (cate != null) { cate_relate = cate_relate + ","; cate_relate = cate_str + Get_Category_Relate(cate.Article_Cate_ParentID, cate_relate); } else { cate_relate = "0"; } } else { if (cate_str != "") { cate_relate = cate_str + cate_relate; } } return(cate_relate); }
public virtual void EditArticleCate() { int Article_Cate_ID = tools.CheckInt(Request.Form["Article_Cate_ID"]); int Article_Cate_ParentID = tools.CheckInt(Request.Form["Article_Cate_ParentID"]); string Article_Cate_Name = tools.CheckStr(Request.Form["Article_Cate_Name"]); int Article_Cate_Sort = tools.CheckInt(Request.Form["Article_Cate_Sort"]); string Article_Cate_Site = Public.GetCurrentSite(); if (Article_Cate_Name == "") { Public.Msg("error", "错误信息", "请填写类别名称", false, "{back}"); return; } ArticleCateInfo entity = new ArticleCateInfo(); entity.Article_Cate_ID = Article_Cate_ID; entity.Article_Cate_ParentID = Article_Cate_ParentID; entity.Article_Cate_Name = Article_Cate_Name; entity.Article_Cate_Sort = Article_Cate_Sort; entity.Article_Cate_Site = Article_Cate_Site; if (MyBLL.EditArticleCate(entity, Public.GetUserPrivilege())) { Public.Msg("positive", "操作成功", "操作成功", true, "Article_Cate_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }