void dgw_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement check_editor = sender as GridCommandCellElement; //ARREGLAR dgw_CellClick(dgw, new Telerik.WinControls.UI.GridViewCellEventArgs(dgw.Rows[check_editor.RowIndex], dgw.Columns[check_editor.ColumnIndex])); foreach (Fragancia item in _listFraganciasSeleccionadas) { if (item.idFragancia == int.Parse(dgw.Rows[check_editor.RowIndex].Cells["idFragancia"].Value.ToString())) { MessageBox.Show("La fragancia ya está seleccionada."); refrescarGrillaSeleccionados(); return; } } Fragancia _newFrag = new Fragancia(); _newFrag.idFragancia = int.Parse(dgw.Rows[check_editor.RowIndex].Cells["idFragancia"].Value.ToString()); _newFrag.NombreReal = dgw.Rows[check_editor.RowIndex].Cells["NombreReal"].Value.ToString(); _newFrag.Costo = (txt_Costo.Text != "") ? float.Parse(txt_Costo.Text) : 0; _listFraganciasSeleccionadas.Add(_newFrag); refrescarGrillaSeleccionados(); }
void grdBookingType_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; string name = gridCell.ColumnInfo.Name.ToLower(); GridViewRowInfo row = gridCell.RowElement.RowInfo; }
private void grid_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete Note. ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { //objNotes.GetByPrimaryKey(grdNotes.CurrentRow.Cells["Id"].Value.ToLong()); //if (objNotes.Current != null) //{ // objNotes.Delete(objNotes.Current); // RadGridView grid = gridCell.GridControl; // grid.CurrentRow.Delete(); //} //else //{ RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); // } } } }
private void radGridView2_CommandCellClick(object sender, EventArgs e) { string lappenjid; GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.TextElement.Text == "Input Laporan") { //Create Laporan using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter()) { try { lappenjid = tbl.pInsertLapPenj(int.Parse(cell.RowInfo.Cells["LogID"].Value.ToString()) , DateTime.Now , DateTime.Now , NBConfig.ValidUserName , "UJ").ToString(); EditLaporan(lappenjid , cell.RowInfo.Cells["NOSJ"].Value.ToString() , false); this.uangjalanTableAdapter.FillByNoLap(this.sinarekDataSet.uangjalan); this.vlappenTableAdapter.FillByTanggal(this.sinarekDataSet.vlappen, dtpTanggalLaporan.Value); } catch (Exception ex) { helper.NotifMessage("Laporan UJ untuk " + cell.RowInfo.Cells["NOSJ"].Value.ToString() + " sudah terinput."); helper.SysLog(this.GetType().Name, this.Text, "Create Laporan UJ :" + ex.Message); lappenjid = tbl.GetLapPenID(int.Parse(cell.RowInfo.Cells["LogID"].Value.ToString()) , "UJ").ToString(); } } } }
void grdServiceCharges_CommandCellClick(object sender, EventArgs e) { try { GridCommandCellElement gridCell = (GridCommandCellElement)sender; string name = gridCell.ColumnInfo.Name.ToLower(); GridViewRowInfo row = gridCell.RowElement.RowInfo; if (name == "btndelete") { int Id = row.Cells[COLS.Id].Value.ToInt(); if (Id > 0) { using (TaxiDataContext db = new TaxiDataContext()) { db.stp_RunProcedure("delete from gen_servicecharges where id=" + Id); } grdServiceCharges.CurrentRow.Delete(); } } } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } }
private void grid_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete a Invoice ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { int InvoiceId = grdLister.CurrentRow.Cells["Id"].Value.ToInt(); invoice_Payment obj = General.GetObject <invoice_Payment>(c => c.invoiceId == InvoiceId); if (obj == null) { RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } else { ENUtils.ShowMessage("You Cannot Delete a Record Payment Exits.."); } } } else if (gridCell.ColumnInfo.Name.ToLower() == "btnedit") { ViewDetailForm(); } }
private void dgvBookings_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; int value = (int)cell.RowInfo.Cells["Booking_Id"].Value; MessageBox.Show(value.ToString()); }
private void grid_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete a Record ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { string Transaction = grdLister.CurrentRow.Cells["TransNo"].Value.ToStr(); int DriverId = grdLister.CurrentRow.Cells["DriverID"].Value.ToInt(); var query = General.GetQueryable <Fleet_DriverCommision>(c => c.DriverId == DriverId).OrderByDescending(c => c.Id).FirstOrDefault(); if (query != null) { string Transno = query.TransNo.ToStr(); if (Transno == Transaction) { RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } else { ENUtils.ShowMessage("You Can not delete a record.."); } } } } else if (gridCell.ColumnInfo.Name.ToLower() == "btnedit") { ViewDetailForm(); } }
private void grid_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btncancel") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to Post Regular Booking ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { // booking go to regular Bookings try { long jobId = gridCell.GridControl.CurrentRow.Cells["Id"].Value.ToLong(); (new TaxiDataContext()).stp_TrashBooking(1, jobId); } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } } else if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete a Trash Booking ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { long jobId = gridCell.GridControl.CurrentRow.Cells["Id"].Value.ToLong(); (new TaxiDataContext()).stp_TrashBooking(2, jobId); RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } } }
void grdLister_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; RadGridView grid = gridCell.GridControl; if (gridCell.ColumnInfo.Name == "btnCreateBooking") { GridViewRowInfo row = grid.CurrentRow; if (row != null && row is GridViewRowInfo) { if (gridCell.ColumnInfo.Name == "btnCreateBooking") { string phone = row.Cells["TelephoneNo"].Value.ToStr().Trim(); string mobileNo = row.Cells["MobileNo"].Value.ToStr().Trim(); string email = row.Cells["Email"].Value.ToStr().Trim(); General.ShowBookingForm(0, false, row.Cells["Name"].Value.ToStr(), phone, mobileNo, row.Cells["DoorNo"].Value.ToStr(), row.Cells["Address"].Value.ToStr(), email); } } } else if (gridCell.ColumnInfo.Name == "ColEdit") { ViewDetailForm(); } }
private void grid_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; string name = gridCell.ColumnInfo.Name.ToLower(); GridViewRowInfo row = gridCell.RowElement.RowInfo; long id = row.Cells[COLS.BookingId].Value.ToLong(); if (name == "unprocess") { RadGridView grid = gridCell.GridControl; objMaster = new BookingBO(); objMaster.GetByPrimaryKey(id); if (objMaster.Current != null) { if (General.GetQueryable <DriverRent_Charge>(c => c.BookingId == id).Count() > 0) { ENUtils.ShowMessage("Cannot UnProcess this Job as Driver Rent is generated from it"); return; } objMaster.Current.IsProcessed = false; objMaster.CheckCustomerValidation = false; objMaster.CheckDataValidation = false; objMaster.Save(); row.Delete(); } } }
private void GrdFareIncreament_CommandCellClick(object sender, EventArgs e) { try { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name == "delete") { int id = gridCell.RowInfo.Cells["Id"].Value.ToInt(); if (id > 0) { using (TaxiDataContext db = new TaxiDataContext()) { Fare_IncrementSetting objfare = db.Fare_IncrementSettings.FirstOrDefault(c => c.Id == id); db.Fare_IncrementSettings.DeleteOnSubmit(objfare); db.SubmitChanges(); gridCell.RowInfo.Delete(); } } } } catch { } }
void grdLister_CommandCellClick(object sender, EventArgs e) { try { if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; string name = gridCell.ColumnInfo.Name.ToStr(); if (name == "btnEditAddress") { string Address = string.Empty; Address = grdLister.CurrentRow.Cells["Address"].Value.ToStr(); long Id = grdLister.CurrentRow.Cells["Id"].Value.ToLong(); int? zoneId = grdLister.CurrentRow.Cells["Id"].Value.ToIntorNull(); frmAddNewAddress frm = new frmAddNewAddress(Id, Address, zoneId); frm.ShowDialog(); frm.Dispose(); } } } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } }
private void GrdOnlineBookingSettings_CommandCellClick(object sender, EventArgs e) { try { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete Entery? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { int Id = grdOnlineBookingSettings.CurrentRow.Cells[COL_ZONE.Id].Value.ToInt(); if (Id > 0) { using (TaxiDataContext db = new TaxiDataContext()) { var query = db.OnlineBookingSettings_Details.FirstOrDefault(c => c.Id == Id); db.OnlineBookingSettings_Details.DeleteOnSubmit(query); db.SubmitChanges(); } } RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } } } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } }
void dgw_Seleccionados_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement check_editor = sender as GridCommandCellElement; _listFraganciasSeleccionadas.RemoveAt(check_editor.RowIndex); refrescarGrillaSeleccionados(); }
void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement clickedCommandColumn = sender as GridCommandCellElement; AddEventRoot("CommandCellClick"); AddTextToListBox(string.Format(" CommandCellClick on row with id = {0}", clickedCommandColumn.RowInfo.Cells["Id"].Value)); }
void grdLister_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name == "btnDelete") { GridViewRowInfo row = gridCell.RowInfo; if (row is GridViewDataRowInfo) { long TranId = row.Cells[COLS.TranId].Value.ToLong(); if (TranId > 0) { try { int Id = row.Cells[COLS.Id].Value.ToInt(); int TransId = row.Cells[COLS.TranId].Value.ToInt(); using (TaxiDataContext db = new TaxiDataContext()) { if (db.GetTable <Fleet_DriverCommissionCollectionHistory_Detail>().Count(c => c.TransId == TransId) == 1) { Fleet_DriverCommissionCollectionHistory objHistory = db.GetTable <Fleet_DriverCommissionCollectionHistory>().FirstOrDefault(c => (c.Id == TranId)); if (objHistory != null) { db.Fleet_DriverCommissionCollectionHistories.DeleteOnSubmit(objHistory); db.SubmitChanges(); } } else { Fleet_DriverCommissionCollectionHistory_Detail objDetail = db.Fleet_DriverCommissionCollectionHistory_Details.FirstOrDefault(c => c.Id == Id); if (objDetail != null) { db.Fleet_DriverCommissionCollectionHistory_Details.DeleteOnSubmit(objDetail); db.SubmitChanges(); } } } PopulateData(); } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } } } } }
protected virtual void Grilla_CellFormatting(object sender, CellFormattingEventArgs e) { GridCommandCellElement cmdCell = e.CellElement as GridCommandCellElement; if (cmdCell != null) { cmdCell.CommandButton.ImageAlignment = ContentAlignment.MiddleCenter; } }
private void GrdDriver_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "colviewdetail") { Display(); } }
void grdPaymentHistory_CommandCellClick(object sender, EventArgs e) { try { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "btndelete") { if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete a Record ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question)) { long Id = grdPaymentHistory.CurrentRow.Cells["Id"].Value.ToLong(); if (grdPaymentHistory.CurrentRow != null && grdPaymentHistory.CurrentRow is GridViewDataRowInfo) { if (grdPaymentHistory.Rows.Count > 1 && Id < grdPaymentHistory.Rows.Where(c => c.Index != grdPaymentHistory.CurrentRow.Index) .OrderByDescending((c => c.Cells["Id"].Value.ToLong())).FirstOrDefault().Cells["Id"].Value.ToLong()) { ENUtils.ShowMessage("Expenses History will be Delete in Reverse Order"); return; } } string Type = grdPaymentHistory.CurrentRow.Cells[COLS.Type].Value.ToStr().ToLower(); decimal Amount = grdPaymentHistory.CurrentRow.Cells[COLS.Amount].Value.ToDecimal(); decimal CurrentBalance = numCurrBalance.Value.ToDecimal(); grdPaymentHistory.CurrentRow.Delete(); if (Type == "credit") { //if (CurrentBalance > 0) //{ numCurrBalance.Value = (CurrentBalance - Amount); } else { //if (CurrentBalance > 0) //{ numCurrBalance.Value = (CurrentBalance + Amount); } objDriverRent.GetByPrimaryKey(RentId); objDriverRent.Edit(); objDriverRent.Current.Balance = numCurrBalance.Value.ToDecimal(); objDriverRent.Save(); using (TaxiDataContext db = new TaxiDataContext()) { var query = db.Fleet_DriverRentExpenses.Single(c => c.Id == Id); db.Fleet_DriverRentExpenses.DeleteOnSubmit(query); db.SubmitChanges(); } DisplayRecord(); } } } catch (Exception ex) { ENUtils.ShowMessage(ex.Message); } }
void grdLister_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name == "btnUpdate") { GridViewRowInfo row = gridCell.RowInfo; if (row is GridViewDataRowInfo) { long id = row.Cells[COLS.ID].Value.ToLong(); decimal fare = row.Cells[COLS.Charges].Value.ToDecimal(); decimal parking = row.Cells[COLS.Parking].Value.ToDecimal(); decimal waiting = row.Cells[COLS.Waiting].Value.ToDecimal(); decimal extraDrop = row.Cells[COLS.ExtraDrop].Value.ToDecimal(); decimal meetAndGreet = row.Cells[COLS.MeetAndGreet].Value.ToDecimal(); decimal CongtionCharge = row.Cells[COLS.CongtionCharge].Value.ToDecimal(); decimal TotalCharges = row.Cells[COLS.Total].Value.ToDecimal(); BookingBO objMaster = new BookingBO(); try { objMaster.GetByPrimaryKey(id); if (objMaster.Current != null) { objMaster.Current.FareRate = fare; objMaster.Current.ParkingCharges = parking; objMaster.Current.WaitingCharges = waiting; objMaster.Current.ExtraDropCharges = extraDrop; objMaster.Current.MeetAndGreetCharges = meetAndGreet; objMaster.Current.CongtionCharges = CongtionCharge; objMaster.Current.TotalCharges = TotalCharges; objMaster.Save(); ViewReport(); } } catch (Exception ex) { if (objMaster.Errors.Count > 0) { ENUtils.ShowMessage(objMaster.ShowErrors()); } else { ENUtils.ShowMessage(ex.Message); } } } } }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.Text.ToLower() == "&isi") { //check if the tir is currently empty if not don't allow fill } //RadMessageBox.Show(cell.CommandButton.Text.ToString() + " : " + cell.RowInfo.Cells["Nama"].Value.ToString()); }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.Text.ToLower() == "del") { supTableAdapter.DeleteSupplier(int.Parse(cell.RowInfo.Cells["SupID"].Value.ToString())); this.supTableAdapter.Fill(this.sinarekDataSet.sup); } }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.Text.ToLower() == "del") { this.rinciangajiTableAdapter.DeleteRincianGaji(int.Parse(cell.RowInfo.Cells["rinciangajiid"].Value.ToString())); this.vrinciangajiTableAdapter.FillByStaff(this.sinarekDataSet.vrinciangaji, int.Parse(rddGajiMingguan.SelectedValue.ToString()), 2); } }
private void dgvratecard_CommandCellClick_1(object sender, EventArgs e) { // MessageBox.Show(((sender as GridCommandCellElement)).Value.ToString()); GridCommandCellElement cell = (GridCommandCellElement)sender; int value = (int)cell.RowInfo.Cells["RateCardID"].Value; FrmRateCardByID rateCardById = new FrmRateCardByID(value); rateCardById.Show(); }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.Text.ToLower() == "delete") { this.gajitemplateallTableAdapter.DeleteTemplate(int.Parse(cell.RowInfo.Cells["templateid"].Value.ToString())); this.gajitemplateallTableAdapter.FillByMember(this.sinarekDataSet.gajitemplateall, int.Parse(memberid_)); } }
void grdPostCodes_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement gridCell = (GridCommandCellElement)sender; if (gridCell.ColumnInfo.Name.ToLower() == "coldelete") { RadGridView grid = gridCell.GridControl; grid.CurrentRow.Delete(); } }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.Text.ToLower() == "delete") { this.comissionTableAdapter.DeleteComission(int.Parse(cell.RowInfo.Cells["commisionid"].Value.ToString())); helper.NotifMessage("Komisi telah dihapus"); this.comissionTableAdapter.Fill(this.sinarekDataSet.comission); } }
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); } }
private void radGridView1_CommandCellClick(object sender, EventArgs e) { GridCommandCellElement cell = (GridCommandCellElement)sender; if (cell.CommandButton.TextElement.Text == "Tagih") { vlogpelTableAdapter.UpdatePiutang(1, NBConfig.ValidUserName , int.Parse(cell.RowInfo.Cells["logpelid"].Value.ToString())); RefreshDataReceivable(ref radGridView1, "pgetpenjualan", 0, 1); RefreshDataReceivable(ref radGridView3, "pgetpenjualan", 1, 1); } }