protected void BindClassList(int ClassID) { string strWhere=""; Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass(); Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass(); model = bll.GetModel(ClassID); int parentid = model.ParentId; if (parentid != 0) { model= bll.GetModelByCache(parentid); parentid = model.ParentId; } strWhere = "parentid="+model.ClassId; DataSet ds = new DataSet(); ds = bll.GetList(strWhere); DataTable dt = ds.Tables[0]; this.ClassName.InnerHtml = model.ClassDesc; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string classname="nav_2"; // Ñ¡ÖÐ״̬Ñùʽ if (ClassID.ToString() == dt.Rows[i][0].ToString()) classname = "nav_2_on"; this.ClassList.InnerHtml += "<li class='" + classname + "'><img src='images/picto_feuilles.gif' align='absmiddle' /><a href='main.aspx?classid=" + dt.Rows[i][0].ToString() + "' >" + dt.Rows[i][1].ToString() + "</a></li>"; } } }
protected void grid_ItemDataBound(object sender, DataGridItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { string Dormancy = (string)DataBinder.Eval(e.Item.DataItem, "Dormancy"); int ClassId = (int)DataBinder.Eval(e.Item.DataItem, "ClassId"); if (Dormancy.ToLower() == "true") { e.Item.Cells[4].Text = "<span style=\" color:Red\">休眠</span>"; } else { e.Item.Cells[4].Text = "<span style=\" color:Green\">发布</span>"; } Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass(); Maticsoft.Model.NewsManage.NewsClass mod = bll.GetModelByCache(ClassId); if (mod != null) { e.Item.Cells[5].Text = mod.ClassDesc; } else { e.Item.Cells[5].Text = "未知类别"; } } }
protected void grid_ItemDataBound(object sender, DataGridItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { string Dormancy = (string)DataBinder.Eval(e.Item.DataItem, "Dormancy"); int ClassId = (int)DataBinder.Eval(e.Item.DataItem, "ClassId"); if (Dormancy.ToLower() == "true") { e.Item.Cells[4].Text = "<span style=\" color:Red\">����</span>"; } else { e.Item.Cells[4].Text = "<span style=\" color:Green\">����</span>"; } Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass(); Maticsoft.Model.NewsManage.NewsClass mod = bll.GetModelByCache(ClassId); if (mod != null) { e.Item.Cells[5].Text = mod.ClassDesc; } else { e.Item.Cells[5].Text = "δ֪���"; } } }
protected void BindClassList(int ClassID) { string strWhere = ""; Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass(); Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass(); model = bll.GetModel(ClassID); int parentid = model.ParentId; if (parentid != 0) { model = bll.GetModelByCache(parentid); parentid = model.ParentId; } strWhere = "parentid=" + model.ClassId; DataSet ds = new DataSet(); ds = bll.GetList(strWhere); DataTable dt = ds.Tables[0]; }
protected void BindClassList(int ClassID) { string strWhere = ""; Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass(); Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass(); model = bll.GetModel(ClassID); int parentid = model.ParentId; if (parentid != 0) { model = bll.GetModelByCache(parentid); parentid = model.ParentId; } strWhere = "parentid=" + model.ClassId; DataSet ds = new DataSet(); ds = bll.GetList(strWhere); DataTable dt = ds.Tables[0]; this.ClassName.InnerHtml = model.ClassDesc; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string classname = "nav_2"; // Ñ¡ÖÐ״̬Ñùʽ if (ClassID.ToString() == dt.Rows[i][0].ToString()) { classname = "nav_2_on"; } this.ClassList.InnerHtml += "<li class='" + classname + "'><img src='images/picto_feuilles.gif' align='absmiddle' /><a href='main.aspx?classid=" + dt.Rows[i][0].ToString() + "' >" + dt.Rows[i][1].ToString() + "</a></li>"; } } }