コード例 #1
0
 private void SetEnable(Object sender, EditModeEventArgs e)
 {
     if (User.GetRole() == RolesList.AccountantWayBill)
     {
         _workWithForm.SetEnableValue(btnSave, true);
     }
 }
コード例 #2
0
 private void EnableIfAccountWayBill(Object sender, EditModeEventArgs e)
 {
     if (!User.IsFullAccess())
     {
         _workWithForm.SetEnableValue(btnSave, User.GetRole() == RolesList.AccountantWayBill);
     }
 }
コード例 #3
0
 private void save_Click(object sender, EventArgs e)
 {
     if (User.GetRole() == RolesList.AccountantWayBill)
     {
         if (btnSave.Text == "Редактировать")
         {
             _workWithForm.SetEnableValue(tbSuppyAddress, true);
             btnSave.Text = "Сохранить";
         }
         else
         {
             if (trySave())
             {
                 DialogResult = System.Windows.Forms.DialogResult.OK;
             }
         }
     }
     else
     {
         if (_workWithForm.IsEditMode())
         {
             if (trySave())
             {
                 DialogResult = System.Windows.Forms.DialogResult.OK;
             }
         }
         else
         {
             _workWithForm.SetEditMode(true);
         }
     }
 }
コード例 #4
0
        private void aeAccount_Load(object sender, EventArgs e)
        {
            LoadDictionary();

            LoadData();

            ChangeEnableBtnAddPolicy();
            ChangeEnableComboBoxes();

            _workWithForm = new WorkWithForm(this.Controls, btnSave, btnClose);
            _workWithForm.SetEditMode(_account.Id == 0);
            _workWithForm.SetEnableValue(btnSave, (!_account.Agreed));
        }