public frmSafe(Guid safeGuid, bool Is_Show) { InitializeComponent(); safe = SafeBussines.Get(safeGuid); 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 = SafeBussines.Get(accGuid); string message = "آیا از حذف حساب " + Acc.Name + " " + "اطمینان دارید؟"; frmMessage frm = new frmMessage(EnumMessageFlag.DeleteFlag, Color.PapayaWhip, message); if (frm.ShowDialog() == DialogResult.OK) { Acc = SafeBussines.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(); } }
public void LoadData(string search = "") { try { if (search == "") { var lst = SafeBussines.GetAll().Where(q => q.Status).OrderBy(q => q.Name).ToList(); SandooqBindingSource.DataSource = lst.ToList(); } else { var list = SafeBussines.Search(search).Where(q => q.Status).OrderBy(q => q.Name).ToList(); SandooqBindingSource.DataSource = list; } lblCounter.Text = SandooqBindingSource.Count.ToString(); } catch (Exception exception) { frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message); frm.ShowDialog(); } }
public frmSafe() { InitializeComponent(); safe = new SafeBussines(); }