Beispiel #1
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (!MyLove.PermissionsBalidation(this.Text, "02"))
                {
                    return;
                }

                if (tvRegion.SelectedNode != null)
                {
                    if (YesNoForm.ShowFrom("确认要删除吗?") == DialogResult.Yes)
                    {
                        IBLL.IDept bll = new BLL.DeptBLL();
                        bll.Del(tvRegion.SelectedNode.Tag as bi_t_dept_info);

                        tvRegion.SelectedNode.Remove();
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.writeLog("frmDept=>Del", ex.ToString());
                MsgForm.ShowFrom(ex);
            }
        }
        private void myButtonOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.txtItemCls.Text))
                {
                    this.txtItemCls.Focus();
                    MsgForm.ShowFrom("请输入名称!");
                    return;
                }

                IBLL.IDept bll = new BLL.DeptBLL();
                if (ord_dept == null || string.IsNullOrEmpty(ord_dept.dept_no))
                {
                    bi_t_dept_info item = new bi_t_dept_info()
                    {
                        dept_no     = bll.GetMaxCode(par_code),
                        dept_name   = this.txtItemCls.Text.Trim(),
                        update_time = DateTime.Now,
                    };

                    bll.Add(item);
                }
                else
                {
                    ord_dept.dept_name   = this.txtItemCls.Text;
                    ord_dept.update_time = DateTime.Now;

                    bll.Upload(ord_dept);
                }


                if (ord_dept != null)
                {
                    this.Close();
                }
                this.txtItemCls.Text = "";
                this.txtItemCls.Focus();
            }
            catch (Exception ex)
            {
                ord_dept = null;
                LogHelper.writeLog("ItemRegionUpload=>Add", ex.ToString());
                MsgForm.ShowFrom(ex);
            }
        }
Beispiel #3
0
        private void LoadTv()
        {
            if (dept_lis != null && dept_lis.Count > 0)
            {
                this.dept_lis.Clear();
            }
            this.tv.Nodes.Clear();

            IBLL.IDept bll = new BLL.DeptBLL();
            dept_lis = bll.GetAllList();

            TreeNode tn = new TreeNode("所有部门");

            tn.Tag = "";
            this.tv.Nodes.Add(tn);
            LoadTreeView();
            this.tv.Nodes[0].Expand();
        }
        private void LoadCb()
        {
            //部门
            IBLL.IDept bll  = new BLL.DeptBLL();
            var        list = bll.GetAllList();

            this.cbDept.DisplayMember = "dept_name";
            this.cbDept.ValueMember   = "dept_no";
            this.cbDept.DataSource    = list;

            //状态
            Dictionary <string, string> dic = new Dictionary <string, string>()
            {
                { "1", "在职" },
                { "0", "离职" },
            };

            this.cbStatus.DisplayMember = "Value";
            this.cbStatus.ValueMember   = "Key";
            this.cbStatus.DataSource    = new BindingSource(dic, null);
        }
Beispiel #5
0
        public void LoadItemCls()
        {
            try
            {
                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.IDept bll = new BLL.DeptBLL();
                        var lis        = bll.GetAllList();
                        this.Invoke((MethodInvoker) delegate
                        {
                            Cursor.Current = Cursors.WaitCursor;
                            dept_lis       = lis;

                            this.tvRegion.Nodes[0].Nodes.Clear();
                            LoadTreeView();
                            //
                            this.tvRegion.Nodes[0].Expand();
                            Cursor.Current = Cursors.Default;
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmDept=>LoadItemCls", "获取部门分类出错!");
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                LogHelper.writeLog("frmDept=>LoadItemCls", "获取部门分类出错!");
                MsgForm.ShowFrom(ex);
            }
        }
Beispiel #6
0
 private void frmPeople_Load(object sender, EventArgs e)
 {
     try
     {
         Thread th = new Thread(() =>
         {
             Helper.GlobalData.windows.ShowLoad(this);
             try
             {
                 IBLL.IDept bll = new BLL.DeptBLL();
                 dept_lis       = bll.GetAllList();
                 this.Invoke((MethodInvoker) delegate
                 {
                     Cursor.Current = Cursors.WaitCursor;
                     LoadTv();
                     LoadDataGrid();
                     Cursor.Current = Cursors.Default;
                 });
             }
             catch (Exception ex)
             {
                 LogHelper.writeLog("frmDept=>LoadItemCls", "获取商品分类出错!");
                 MsgForm.ShowFrom(ex);
             }
             Helper.GlobalData.windows.CloseLoad(this);
         });
         th.Start();
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom(ex);
         LogHelper.writeLog("frmPeople=>load", ex.ToString());
     }
     finally
     {
     }
 }