Beispiel #1
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     if (WinFormUtil.Confirm("Do you want to delete the employee?", "Delete") == DialogResult.Yes)
     {
         mModel.Delete();
     }
 }
        private void btnDeleteRole_Click(object sender, EventArgs e)
        {
            int RoleID;

            if (WinFormUtil.DataGridView_GetSelectedID(dgvRoles, out RoleID))
            {
                BOUser   current_user = AccountantPool.Instance.CurrentAccountant.User;
                AuthRole role         = current_user.GetAuthRole(RoleID);
                if (role != null)
                {
                    if (current_user.CanDelete(role))
                    {
                        if (WinFormUtil.Confirm("Do you want to delete?", "Delete Warning") == DialogResult.Yes)
                        {
                            current_user.Delete(role);
                            ViewModel();
                        }
                    }
                    else if (WinFormUtil.Confirm("Other roles and users have inherited this role, delete this role will also delete them,\r\n do you still want to delete?", "Delete Warning") == DialogResult.Yes)
                    {
                        current_user.Delete(role);
                        ViewModel();
                    }
                }
            }
        }
Beispiel #3
0
        private void DataGridView_Delete(DataGridView dgv)
        {
            int CardRecordID;

            if (WinFormUtil.DataGridView_GetSelectedID(dgv, out CardRecordID))
            {
                if (WinFormUtil.Confirm("Do you want to delete the card?", "Delete") == DialogResult.Yes)
                {
                    mModel.Delete(CardRecordID);
                }
            }
        }