private void mnuDelete_Click(object sender, EventArgs e) { try { if (DGrid.RowCount == 0) { return; } var accGuid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var Acc = CustomersBussines.Get(accGuid); string message = "آیا از حذف " + Acc.Name + " " + "اطمینان دارید؟"; frmMessage frm = new frmMessage(EnumMessageFlag.DeleteFlag, Color.PapayaWhip, message); if (frm.ShowDialog() == DialogResult.OK) { Acc = CustomersBussines.Change_Status(accGuid, false); if (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(); } }
public frmCustomer(Guid guid, bool Is_Show) { InitializeComponent(); Count = listForms.Count(); _cus = CustomersBussines.Get(guid); pnlContent.Enabled = Is_Show; btnFinish.Enabled = Is_Show; }