private void btnAcceptAll_Click(object sender, EventArgs e) { try { if (DialogResult.Yes == MessageBox.Show("Are you sure you want to ALLOW All Bookings?", "Authorization", MessageBoxButtons.YesNo)) { int rowCount = grdLister.Rows.Count; using (TaxiDataContext db = new TaxiDataContext()) { for (int i = 0; i < rowCount; i++) { db.stp_AuthUnavailAllocDrvs(grdLister.Rows[i].Cells["ONLINEBOOKINGID"].Value.ToLong(), "", AppVars.LoginObj.UserName.ToStr()); } } grdLister.Rows.Clear(); RefreshDashBoardBookings(); CloseForm(); } } catch { } }
void grdLister_CommandCellClick(object sender, EventArgs e) { try { GridCommandCellElement gridCell = (GridCommandCellElement)sender; string name = gridCell.ColumnInfo.Name.ToLower(); GridViewRowInfo row = gridCell.GridControl.CurrentRow; if (row != null) { if (name == "accept") { using (TaxiDataContext db = new TaxiDataContext()) { db.stp_AuthUnavailAllocDrvs(row.Cells["ONLINEBOOKINGID"].Value.ToLong(), "", AppVars.LoginObj.UserName.ToStr()); } } else { if (AppVars.denyAllocatedBookingIds.ToStr().Trim().Length == 0) { AppVars.denyAllocatedBookingIds += "," + row.Cells["ONLINEBOOKINGID"].Value.ToLong() + ","; } else { AppVars.denyAllocatedBookingIds += row.Cells["ONLINEBOOKINGID"].Value.ToLong() + ","; } } row.Delete(); SleepAction(); if (name == "accept") { RefreshDashBoardBookings(); } if (grdLister.Rows.Count == 0) { CloseForm(); } } } catch (Exception ex) { // ENUtils.ShowMessage(ex.Message); } }