Example #1
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.textName.Text) || modeList.Count <= 0)
     {
         XtraMessageBox.Show("请填写完整信息!");
     }
     if (vo != null)
     {
         if (DeleteDao.DelPermissionByName(vo.Name) < 1)
         {
             XtraMessageBox.Show("操作失败!");
             return;
         }
     }
     foreach (string name in modeList)
     {
         PermissionVo vo = new PermissionVo()
         {
             Name = this.textName.Text, ModeName = name, CompanyId = SystemConst.companyId
         };
         InsertDao.InsertData(vo, typeof(PermissionVo));
     }
     XtraMessageBox.Show("保存权限组成功!");
     this.DialogResult = DialogResult.OK;
 }
Example #2
0
        private void BtnModifyPermission_Click(object sender, EventArgs e)
        {
            PermissionVo vo = (PermissionVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);

            if (vo == null)
            {
                return;
            }
            PermissionForm form = new PermissionForm(vo);

            if (form.ShowDialog() == DialogResult.OK)
            {
                FillPermission();
            }
        }
Example #3
0
        private void BtnDelPermission_Click(object sender, EventArgs e)
        {
            PermissionVo vo = (PermissionVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);

            if (vo == null)
            {
                return;
            }
            if (DeleteDao.DelPermissionByName(vo.Name) < 0)
            {
                XtraMessageBox.Show("操作失败!");
                return;
            }
            else
            {
                FillPermission();
            }
        }
Example #4
0
 public PermissionForm(PermissionVo vo = null)
 {
     InitializeComponent();
     InitEvents();
     this.vo = vo;
 }