コード例 #1
0
        /// <summary>
        /// 修改用户
        /// </summary>
        private void EditUser()
        {
            string currentuser = MIS.UserNumber;
            string id          = treeView1.SelectedNode.Name;

            if (currentuser != "admin" && currentuser != id)
            {
                MessageBox.Show("您无权进行此操作!");
                return;
            }
            Smmuser data = UserService.GetOneByKey(id);

            using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new())
            {
                dlg.DataObject  = data;
                dlg.UserNo      = data.Userid;
                dlg.UserName    = data.UserName;
                dlg.currentuser = currentuser;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    UserService.Update(data);

                    CreateView();
                }
                MainForm.CurrentForm.SetStatusLabel();
            }
        }
コード例 #2
0
        /// <summary>
        /// 增加用户
        /// </summary>
        private void AddUser()
        {
            string currentuser = MIS.UserNumber;

            using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new())
            {
                dlg.currentuser = currentuser;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    UserService.Create(dlg.DataObject);
                    CreateView();
                }
            }
        }
コード例 #3
0
ファイル: FrmRightManager.cs プロジェクト: EdgarEDT/myitoppsp
        /// <summary>
        /// �޸��û�
        /// </summary>
        private void EditUser()
        {
            string currentuser = MIS.UserNumber;
            string id = treeView1.SelectedNode.Name;
            if (currentuser != "admin" && currentuser != id)
            {
                MessageBox.Show("����Ȩ���д˲�����");
                return;
            }
            Smmuser data = UserService.GetOneByKey(id);
            using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new())
            {
                dlg.DataObject = data;
                dlg.UserNo = data.Userid;
                dlg.UserName = data.UserName;
                dlg.currentuser = currentuser;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    UserService.Update(data);

                    CreateView();
                }
                MainForm.CurrentForm.SetStatusLabel();
            }
        }
コード例 #4
0
ファイル: FrmRightManager.cs プロジェクト: EdgarEDT/myitoppsp
        /// <summary>
        /// �����û�
        /// </summary>
        private void AddUser()
        {
            string currentuser = MIS.UserNumber;
            using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new())
            {
                dlg.currentuser = currentuser;
                if (dlg.ShowDialog() == DialogResult.OK)
                {

                    UserService.Create(dlg.DataObject);
                    CreateView();
                }
            }
        }