private void gridUnits_UserDeletingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { if (Helper.ShowQuestion("Are you sure to delete this item?") != DialogResult.Yes) { e.Cancel = true; } }
private void gridDepartments_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { if (CheckValidation() == false) { e.Cancel = true; } }
private void radGridView1_UserDeletingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { //Remove data from database using (sinarekDataSetTableAdapters.producttotaluserTableAdapter tbl = new sinarekDataSetTableAdapters.producttotaluserTableAdapter()) { try { tbl.DeleteProductTotalUser(int.Parse(e.Rows[0].Cells["totalid"].Value.ToString())); } catch (Exception ex) { MessageBox.Show("Ada masalah dengan penghapusan sisa barang.", "SMS - Error Notification"); e.Cancel = true; } } }
private void gridViewVacations_UserDeletingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { Vacation vacation; if (e.Rows[0].Cells["colStartDate"].Value != null) { DateTime start = (DateTime)e.Rows[0].Cells["colStartDate"].Value; DateTime end = (DateTime)e.Rows[0].Cells["colEndDate"].Value; vacation = new Vacation(start, end, ref employee.holidayManager); } else { int duration = int.Parse(e.Rows[0].Cells["colDuration"].Value.ToString()); vacation = new Vacation(duration, ref employee.holidayManager); } employee.DeleteVacation(vacation); UpdateVacationInfo(); }
private void gvRooms_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { var newRN = new object(); newRN = e.Rows[0].Cells["RoomNumber"].Value; if (newRN != null) { if (rooms.Exists(x => x.RoomNumber == newRN.ToString())) { MessageBox.Show("Room already existed"); e.Cancel = true; } } else { MessageBox.Show("Room Number should not be empty"); e.Cancel = true; } }
private void gridViewVacations_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { if (e.Rows[0].Cells["colEndDate"].Value != null && e.Rows[0].Cells["colStartDate"].Value != null) { DateTime start = (DateTime)e.Rows[0].Cells["colStartDate"].Value; DateTime end = (DateTime)e.Rows[0].Cells["colEndDate"].Value; Vacation newVacation = new Vacation(start, end, ref employee.holidayManager); if (!employee.AddVacation(newVacation)) { MessageBox.Show("Даты отпуска пересекаются с уже существующим отпуском", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Cancel = true; } else { UpdateVacationInfo(); } } else { MessageBox.Show("Заполните обе даты отпуска!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Cancel = true; } }
private void gridEQCategory_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { //if (CheckValidation() == false) // e.Cancel = true; }