Пример #1
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == dataGridView1.Columns["col_edit"].Index && e.RowIndex >= 0)
     {
         appo_id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["col_id"].Value.ToString());
         AppointmentBooking booking = new AppointmentBooking();
         booking.ShowDialog();
     }
     else if (e.ColumnIndex == dataGridView1.Columns["col_delete"].Index && e.RowIndex >= 0)
     {
         DialogResult dig = MessageBox.Show("Are You Sure To Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dig == DialogResult.Yes)
         {
             appo_id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["col_id"].Value);
             int delete = blgraph.DeleteAppointment(appo_id);
             if (delete > 0)
             {
                 MessageBox.Show("Successfully Deleted", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 LoadAppointment();
             }
         }
     }
     else
     {
         MessageBox.Show("Please Select A Row", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
 private void sch_appointment_EditAppointmentFormShowing(object sender, AppointmentFormEventArgs e)
 {
     DevExpress.XtraScheduler.SchedulerControl         scheduler = ((DevExpress.XtraScheduler.SchedulerControl)(sender));
     POS_System.Customer_Management.AppointmentBooking form      = new AppointmentBooking();
     try
     {
         e.DialogResult = form.ShowDialog();
         e.Handled      = true;
     }
     finally
     {
         form.Dispose();
     }
 }
Пример #3
0
 private void btn_edit_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         foreach (DataGridViewRow dr in dataGridView1.SelectedRows)
         {
             appo_id = Convert.ToInt32(dr.Cells["col_id"].Value);
         }
         AppointmentBooking booking = new AppointmentBooking();
         booking.Show();
     }
     else
     {
         MessageBox.Show("Please Select A Row", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }