private void BindGrid() { Maticsoft.BLL.tArticleType bll = new Maticsoft.BLL.tArticleType(); DataSet ds = bll.GetList(" IsEnable=1"); ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["FatherID"], false); ddlfatherId.Items.Clear(); foreach (DataRow row in ds.Tables[0].Rows) { if (row["FatherID"].ToString() == "0") { FineUIPro.ListItem it = new FineUIPro.ListItem(); it.Text = row["Name"].ToString(); it.Value = row["Id"].ToString(); it.SimulateTreeLevel = 1; if (row.GetChildRows("TreeRelation").Length <= 0) { it.EnableSelect = true; } else { it.EnableSelect = false; } ddlfatherId.Items.Add(it); ResolveSubTree(row, ddlfatherId); } } }
private void BindGrid() { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); TMailList.Nodes.Clear(); DataSet ds = BLL.GetList(" IsEnable=1 order by Sort desc"); ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["FatherID"], false); foreach (DataRow row in ds.Tables[0].Rows) { if (row["FatherID"].ToString() == "0") { FineUIPro.TreeNode node = new FineUIPro.TreeNode(); node.NodeID = row["Id"].ToString(); node.Text = row["Name"].ToString(); node.Expanded = true; if (row.GetChildRows("TreeRelation").Length <= 0) { node.ToolTip = "可选择"; } else { node.ToolTip = "不可选择"; } node.EnableClickEvent = true; TMailList.Nodes.Add(node); ResolveSubTree(row, node); } } }
/// <summary> /// 根据ArtGuid 来给控件赋值 /// </summary> /// <param name="ArtGuid"></param> public void UpMenuModel(string ArtGuid) { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); Maticsoft.Model.tArticleType m = BLL.GetModel(int.Parse(ArtGuid)); chkFlag.Checked = m.IsEnable == 1 ? true : false; txtName.Text = m.Name; ddlfatherId.SelectedValue = m.FatherID.ToString(); txtSort.Text = m.Sort.ToString(); }
private void BindGrid() { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); DataTable table = BLL.GetList(" FatherID=0 order by Sort desc").Tables[0]; ddlfatherId.DataTextField = "Name"; ddlfatherId.DataValueField = "Id"; ddlfatherId.DataSource = table; ddlfatherId.DataBind(); ddlfatherId.Items.Insert(0, new FineUIPro.ListItem("根目录", "0")); }
protected void btnSave_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(Request.QueryString["ArtGuid"])) { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); int ArtGuid = int.Parse(Request.QueryString["ArtGuid"]); Maticsoft.Model.tArticleType menu = BLL.GetModel(ArtGuid); if (BLL.GetList(string.Format(" Name='{0}' and Id<>{1} ", txtName.Text, ArtGuid)).Tables[0].Rows.Count >= 1) { Alert.ShowInTop("该分类名称已经存在!"); return; } if (ddlfatherId.SelectedValue == menu.Id.ToString()) { Alert.ShowInTop("上级分类不可选择!"); return; } menu.Id = ArtGuid; menu.Name = txtName.Text.ToString().Trim(); menu.FatherID = int.Parse(ddlfatherId.SelectedValue); menu.Sort = Convert.ToInt32(txtSort.Text.ToString().Trim()); menu.IsEnable = chkFlag.Checked ? 1 : 0; if (BLL.Update(menu) == true) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("操作失败!"); } } else { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); Maticsoft.Model.tArticleType menu = new Maticsoft.Model.tArticleType(); if (BLL.GetList(string.Format(" Name='{0}' ", txtName.Text)).Tables[0].Rows.Count >= 1) { Alert.ShowInTop("该分类名称已经存在!"); return; } menu.Name = txtName.Text.ToString().Trim(); menu.FatherID = int.Parse(ddlfatherId.SelectedValue); menu.Sort = Convert.ToInt32(txtSort.Text.ToString().Trim()); menu.IsEnable = chkFlag.Checked ? 1 : 0; if (BLL.Add(menu) >= 1) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("操作失败!"); } } }
protected void getNav(int tId) { StringBuilder sb = new StringBuilder(); BLL.tArticleType bll = new Maticsoft.BLL.tArticleType(); List <Model.tArticleType> list = null; if (tId == 7) { list = bll.GetModelList(" IsEnable=1 and Id=7 "); } else { list = bll.GetModelList(" IsEnable=1 and Id<>7 "); } foreach (Model.tArticleType m in list) { if (m.Id == tId) { typeName = m.Name; this.Title = m.Name; sb.Append("<div class=\"df f-ac tab-content tab-active\" data-title=\"" + m.Name + "\">"); } else { sb.Append("<div class=\"df f-ac tab-content\" data-title=\"" + m.Name + "\">"); } sb.Append("<div class=\"fs-1 fw-b\">"); sb.Append("<img src=\"images/list-icon-active.png\" />"); sb.Append("</div>"); if (tId == 7) { sb.Append("<div class=\"tab-title\"><a href=\"member.aspx\">" + m.Name + "</a></div>"); } else { sb.Append("<div class=\"tab-title\"><a href=\"pagenews.aspx?tId=" + m.Id + "\">" + m.Name + "</a></div>"); } sb.Append("</div>"); } lit_nav.Text = sb.ToString(); }
protected string GetName(string Tid) { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); return(BLL.GetModel(int.Parse(Tid)).Name); }