public static void RepeaterArticleClassIdWhere(int top, int classId, string where, Repeater rep) { string classIdString = ToAspx.getcloumnid(classId); DataSet ds = new Cms.BLL.C_article().GetList(top, "parentId in (" + classIdString + ") and ishidden=0 " + where, "ordernumber desc ,articleId desc"); if (ds != null && ds.Tables[0].Rows.Count > 0) { rep.DataSource = ds.Tables[0].DefaultView; rep.DataBind(); } }
public static void RepeaterArticleWhere(int top, int classId, int parentId, string where, Repeater rep) { string classIdString = ToAspx.getcloumnid(parentId); string workname = new Cms.BLL.C_Column().GetModel(classId).name.ToString(); DataSet ds = Cms.DBUtility.DbHelperSQL.Query("SELECT * FROM ( SELECT ROW_NUMBER() OVER (order by T.orderNumber desc,T.articleId desc )AS Row, T.* from View_content T WHERE parentId in (" + classIdString + ") " + where + " ) TT WHERE TT.Row between 0 and " + top); if (ds != null && ds.Tables[0].Rows.Count > 0) { rep.DataSource = ds.Tables[0].DefaultView; rep.DataBind(); } }
public static string crumb(int classId) { string result = "<li class='house'> <a href='/'>首页</a> ></li> {parent} <li class='shicol'> <a href='{linkUrl}'>{className}</a></li>"; Cms.Model.C_Column model = new Cms.BLL.C_Column().GetModel(classId); if (model != null) { result = result.Replace("{linkUrl}", ToAspx.getCloumnUrl(model.classId)); result = result.Replace("{className}", model.className); result = result.Replace("{parent}", InitChildCrumb(Convert.ToInt32(model.parentId))); } return(result); }
public static string getActive(string cuurId, int classid, string active) { string result = ""; if (classid == Convert.ToInt32(cuurId)) { result = active; } else { string classIdList = ToAspx.getcloumnid(classid); if (classIdList.IndexOf(cuurId) > -1) { result = active; } } return(result); }
private static string InitChildCrumb(int parentId) { string result = ""; if (parentId != 26) { Cms.Model.C_Column modelParent = new Cms.BLL.C_Column().GetModel(parentId); if (modelParent != null) { string parent = "<li><a href='{parentUrl}'>{parentName}</a> ></li> "; parent = parent.Replace("{parentUrl}", ToAspx.getCloumnUrl(modelParent.classId)); parent = parent.Replace("{parentName}", modelParent.className); result = parent + result; result = InitChildCrumb(Convert.ToInt32(modelParent.parentId)) + result; } } return(result); }