Exemplo n.º 1
0
        private void Form_xtgn_Load(object sender, EventArgs e)
        {
            addTree();
            xtggBiz xtggbiz = new xtggBiz();

            dt = xtggbiz.Get_xt_gn(0);
            this.dgXtgn.DataSource = dt;
            gridViewColumnsSyle();

            treeView1.ImageList = imageList1;
            foreach (TreeNode node in treeView1.Nodes)
            {
                if (node.Nodes.Count > 0)
                {
                    if (node.IsExpanded)
                    {
                        node.ImageIndex = 0;
                    }
                    else
                    {
                        node.ImageIndex = 1;
                    }
                    //AddImage(node);
                }
            }
            try
            {
                new mainBiz().AddImages(imageList1);
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        private void SaveData(ref List <string> tmpList, DevComponents.AdvTree.AdvTree treeView, int typeClass)
        {
            List <string> delRoleID = new List <string>();
            List <string> addRoleID = new List <string>();

            FindDiff(ref addRoleID, treeView.Nodes[0].Nodes);
            //获取取消勾的节点
            IEnumerable <string> onlyDel = tmpList.Except(addRoleID);
            //获取新加入勾的节点
            IEnumerable <string> onlyAdd = addRoleID.Except(tmpList);

            if (onlyDel.Count() == 0 && onlyAdd.Count() == 0)
            {
                MessageBox.Show("没有修改任何权限", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            xtggBiz xtggbiz = new xtggBiz();
            bool    isDone  = xtggbiz.SaveYsKs(dgv_czy.CurrentRow.Cells["czybm"].Value.ToString(), onlyDel, onlyAdd);

            if (isDone)
            {
                tmpList = addRoleID;
                MessageBox.Show("保存功能权限成功");
            }
            else
            {
                MessageBox.Show("保存功能权限失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void bt_Save_Click(object sender, EventArgs e)
        {
            xtggBiz xtggbiz = new xtggBiz();

            xtggbiz.Update_xt_yhz(dt_xt_yhz);
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 4
0
        private void Form_yhqxsz_sort_Load(object sender, EventArgs e)
        {
            xtggBiz xtggbiz = new xtggBiz();

            dt = xtggbiz.Get_xt_yhzqx_sort(sjid, yhzid);
            dgYhqxsort.DataSource = dt;
        }
Exemplo n.º 5
0
        public void addTree2(DataRowView drv)
        {
            treeView2.Nodes.Clear();
            xtggBiz xtggbiz = new xtggBiz();

            treeView2.Nodes.Add(xtggbiz.GetTreeList(Convert.ToInt32(drv.Row[0].ToString()), drv.Row[2].ToString()));
            treeView2.ExpandAll();
        }
Exemplo n.º 6
0
        public void addTree()
        {
            treeView1.Nodes.Clear();
            xtggBiz xtggbiz = new xtggBiz();

            treeView1.Nodes.Add(xtggbiz.GetTreeList());
            treeView1.ExpandAll();
        }
Exemplo n.º 7
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            xtggBiz xtggbiz = new xtggBiz();

            xtggbiz.Update_xt_gn(dt);

            addTree();
        }
Exemplo n.º 8
0
        public void addTree1(int yhzid)
        {
            treeView1.Nodes.Clear();
            xtggBiz xtggbiz = new xtggBiz();

            xtggbiz.CreateChildTree1(treeView1.Nodes, 0, yhzid);
            treeView1.CheckBoxes = true;
            treeView1.ExpandAll();
        }
Exemplo n.º 9
0
        public void addData()
        {
            xtggBiz xtggbiz = new xtggBiz();

            dt = xtggbiz.Get_xt_yhz();
            cb_yhz.DataSource    = dt;
            cb_yhz.DisplayMember = dt.Columns["yhzmc"].ColumnName.ToString();
            cb_yhz.ValueMember   = dt.Columns["yhzid"].ColumnName.ToString();
        }
Exemplo n.º 10
0
        private void DataBind()
        {
            xtggBiz xtggbiz = new xtggBiz();

            dt_xt_yhz = xtggbiz.Get_xt_yhz();
            if (object.Equals(dt_xt_yhz, null))
            {
                return;
            }
            dg_yhz.DataSource = dt_xt_yhz;
        }
Exemplo n.º 11
0
 private void treeView2_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if (e.Label.Length > 0)
         {
             xtggBiz xtggbiz = new xtggBiz();
             e.Node.EndEdit(false);
             xtggbiz.udpate_xt_yhzqx_mc(Convert.ToInt16(e.Node.Name), e.Label);
         }
     }
 }
Exemplo n.º 12
0
        private void delToolStripMenuItem_Click(object sender, EventArgs e)
        {
            xtggBiz xtggbiz = new xtggBiz();

            if (treeView2.SelectedNode != null)
            {
                xtggbiz.delTreeView(Convert.ToInt32(treeView2.SelectedNode.Name));
                DataRowView drv = (DataRowView)cb_yhz.SelectedItem;
                addTree2(drv);
                addTree1(Convert.ToInt16(drv.Row[0].ToString()));
            }
        }
Exemplo n.º 13
0
        private void bt_Save_Click(object sender, EventArgs e)
        {
            xtggBiz xtggbiz = new xtggBiz();

            xtggbiz.Update_xt_yhzqx(dt, sjid, yhzid);
            this.DialogResult = DialogResult.OK;
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    objyhqxszsort.UpdateYhzqx(i_sjid, i_yhzid, i + 1, Convert.ToInt16(dt.Rows[i]["qxid"]));
            //}
            //dt = objyhqxszsort.GetNewsList(i_sjid, i_yhzid);
            //this.dgYhqxsort.DataSource = dt;
            //gridViewColumnsSyle();
        }
Exemplo n.º 14
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (object.Equals(null, cb_yhz.SelectedValue))
            {
                return;
            }

            DataRowView drv     = (DataRowView)cb_yhz.SelectedItem;
            xtggBiz     xtggbiz = new xtggBiz();

            xtggbiz.saveTreeView(treeView1.Nodes, Convert.ToInt32(cb_yhz.SelectedValue.ToString()), Convert.ToInt32(treeView2.SelectedNode.Name));

            addTree2(drv);
            addTree1(Convert.ToInt32(cb_yhz.SelectedValue.ToString()));
            treeView2.ExpandAll();
        }
Exemplo n.º 15
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            int sjid = 0;

            sjid = Convert.ToInt16(e.Node.Name);
            xtggBiz xtggbiz = new xtggBiz();

            dt = xtggbiz.Get_xt_gn(sjid);
            this.dgXtgn.DataSource = dt;
            gridViewColumnsSyle();
            e.Node.SelectedImageIndex = 2;
            if (e.Node.Text == "系统功能")
            {
                return;
            }
            else
            {
                e.Node.Parent.ImageIndex = 4;
            }
        }
Exemplo n.º 16
0
        private void dgv_czy_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            listRoleID.Clear();
            if (e.RowIndex >= 0)
            {
                xtggBiz biz = new xtggBiz();

                DataTable newDt = biz.Get_xt_ysksqx(dgv_czy.Rows[e.RowIndex].Cells["czybm"].Value.ToString());
                if (newDt != null)
                {
                    foreach (DataRow dr in newDt.Rows)
                    {
                        listRoleID.Add(dr["KsID"].ToString());
                    }
                }

                //递归判断是否节点在泛型中 有就选中
                isChecked(listRoleID, advTree1.Nodes[0].Nodes);
            }
        }
Exemplo n.º 17
0
        private void Form_ysksqx_Load(object sender, EventArgs e)
        {
            dgv_czy.AutoGenerateColumns = false;
            xtggBiz xtggbiz = new xtggBiz();

            dgv_czy.DataSource = xtggbiz.Get_xt_czy();
            ywszBiz ywszbiz = new ywszBiz();
            //增加科室树
            DataTable kstable = ywszbiz.Get_tj_tjlxb();

            if (kstable != null)
            {
                advTree1.ImageList = imageList1;
                advTree1.CheckBoxImageUnChecked = imageList1.Images[1];
                advTree1.CheckBoxImageChecked   = imageList1.Images[2];
                advTree1.Nodes.Clear();
                DevComponents.AdvTree.Node nodeFather;
                nodeFather                 = new DevComponents.AdvTree.Node();
                nodeFather.Text            = "科室已分权限";
                nodeFather.Tag             = "";
                nodeFather.Name            = "";
                nodeFather.ImageIndex      = 0;
                nodeFather.CheckBoxVisible = true;
                advTree1.Nodes.Add(nodeFather);
                //
                for (int i = 0; i < kstable.Rows.Count; i++)
                {
                    DevComponents.AdvTree.Node nod = new DevComponents.AdvTree.Node();
                    nod.CheckBoxVisible = true;
                    nod.Text            = kstable.Rows[i]["mc"].ToString();
                    nod.Tag             = kstable.Rows[i]["lxbh"].ToString();
                    //nod.Name = plist[i].ToString();//利用name tag 是否相同 来判断是否父节点
                    nodeFather.Nodes.Add(nod);
                }
                advTree1.ExpandAll();
            }
        }