private void SetEnable(Object sender, EditModeEventArgs e) { if (User.GetRole() == RolesList.AccountantWayBill) { _workWithForm.SetEnableValue(btnSave, true); } }
private void EnableIfAccountWayBill(Object sender, EditModeEventArgs e) { if (!User.IsFullAccess()) { _workWithForm.SetEnableValue(btnSave, User.GetRole() == RolesList.AccountantWayBill); } }
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); } } }
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)); }