private void mnuEdit_Click(object sender, EventArgs e) { try { if (DGrid.RowCount == 0 || DGrid.CurrentRow == null) { return; } if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "نقد") { var str = (ReceptionNaqdBussines)GetRowInfo(DGrid.CurrentRow.Index); var frm = new frmReceptionNaqd(str); if (frm.ShowDialog(this) != DialogResult.OK) { return; } DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index); AddToGrid(frm.cls); } else if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "چک") { var str = (ReceptionCheckBussines)GetRowInfo(DGrid.CurrentRow.Index); var frm = new frmReceptionCheck(str); if (frm.ShowDialog(this) != DialogResult.OK) { return; } DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index); AddToGrid(frm.cls); } else if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "حواله") { var str = (ReceptionHavaleBussines)GetRowInfo(DGrid.CurrentRow.Index); var frm = new frmReceptionHavale(str); if (frm.ShowDialog(this) != DialogResult.OK) { return; } DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index); AddToGrid(frm.cls); } FetchData(); SetLables(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private void mnuAddHavale_Click(object sender, EventArgs e) { try { var frm = new frmReceptionHavale(null); if (frm.ShowDialog(this) != DialogResult.OK) { return; } AddToGrid(frm.cls); FetchData(); SetLables(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }