public frmBank(Guid bankGuid, bool Is_Show) { InitializeComponent(); bank = BanksBussines.Get(bankGuid); grpAccount.Enabled = Is_Show; btnFinish.Enabled = Is_Show; }
private void mnuDelete_Click(object sender, EventArgs e) { try { if (DGrid.RowCount == 0) { return; } Guid accGuid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var Acc = BanksBussines.Get(accGuid); string message = "آیا از حذف حساب " + Acc.Name + " " + "اطمینان دارید؟"; frmMessage frm = new frmMessage(EnumMessageFlag.DeleteFlag, Color.PapayaWhip, message); if (frm.ShowDialog() == DialogResult.OK) { Acc = BanksBussines.Change_Status(accGuid, false); var a = Acc.Save(); frmMessage f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Green, "عملیات با موفقیت انجام شد"); f.ShowDialog(); LoadData(); } } catch (Exception exception) { frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message); frm.ShowDialog(); } }