Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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"));
        }
Ejemplo n.º 4
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("操作失败!");
                }
            }
        }