public void BtnSubmitReservation_Click(object sender, EventArgs e) { dateReserveToday.Value = DateTime.Now; String[] arrayOfEquipment = { "Projector", "Extension Wire", "System Unit", "Projector Screen", "HDMI Cable", "VGA Cable", "Adaptor", "Router", "Computer Switch", "Hub", "Lan Ethernet Cable", "Cable Modem" }; if (lblTotalQty.Text.Equals("0") || txtQty.Text.Equals("0")) { MessageBox.Show("Invalid", "Reservation", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { connection.connection.DB(); for (int i = 0; i < arrayOfEquipment.Length; ++i) { if (cmbReserveEquipment.SelectedItem.Equals(arrayOfEquipment[i])) { quantity = Int32.Parse(txtQty.Text); retrieveQty(); update = total - quantity; insertEquipment(); updateQty(); editStatus(); MessageBox.Show("Reservation Success!", "Reservation", MessageBoxButtons.OK, MessageBoxIcon.Information); printDetails print = new printDetails(this); print.Show(); connection.connection.conn.Close(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void BtnPrint_Click(object sender, EventArgs e) { printDetails print = new printDetails(); print.PrintPanel(pnlPrintIncidentReport); }