public void ShowAuthRole(BORole model)
        {
            if (model == null)
            {
                return;
            }
            BaseView frm = new FrmAuthRole(mApplicationController, model);

            SetCurrentForm(frm);
        }
        public FrmAuthRole(ApplicationPresenter ap, BORole model)
            : base(ap)
        {
            mModel = model;
            InitializeComponent();

            BindViews();
            RegisterEventHandlers();

            DacII.Util.DataGridViewHelper.UpdateColumnHeaderStyles(tgvAuthItems);
        }
Ejemplo n.º 3
0
        public void DeleteAuthRole(AuthRole role)
        {
            if (!mAccountant.CanDeleteAuthRole(role))
            {
                if (MessageBox.Show(
                        "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",
                        MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }
            else if (MessageBox.Show(
                         "Do you want to delete?",
                         "Delete Warning",
                         MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            BORole model = mAccountant.OpenAuthRole(role);

            model.Delete();
        }