//--- fllaypn_InvoiceButtons ---// private void btn_InvoiceView_Click(object sender, EventArgs e) { if (dgv_Invoice.SelectedRows.Count == 1) { //truyền ID_CLient Form_Detail_Invoice f = new Form_Detail_Invoice("", int.Parse(dgv_Invoice.SelectedRows[0].Cells["IdInvoice"].Value.ToString())); f.myDel = LoadData; this.Hide(); f.ShowDialog(); this.Show(); } else { MessageBox.Show("Please choose only 1 row to view!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//----- Booking Events -----// private void btn_BookingExport_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection r = dgv_Booking.SelectedRows; if (r.Count == 1) { if (r[0].Cells["Status"].Value.ToString() != "Processed") { Form_Detail_Invoice f = null; var list = _receiptionistManage.FindInvoice(1, 1, r[0].Cells["Code"].Value.ToString(), "", "", null); if (list.Count != 0) { f = new Form_Detail_Invoice("", list[0].IdInvoice); } else { f = new Form_Detail_Invoice(r[0].Cells["Code"].Value.ToString(), 0); } f.myDel = searchBookData; this.Hide(); f.ShowDialog(); this.Show(); } else { MessageBox.Show("Can't export booking with status 'Processed'", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (r.Count == 0) { MessageBox.Show("Bạn chưa chọn đơn để xem!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Chỉ có thể chọn một đơn trong một lần xem!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }