private void GUI_CTHD_FormClosing(object sender, FormClosingEventArgs e) { if (GUI.Equals("Create")) { DialogResult dlr = MessageBox.Show("Bạn có chắc chắn Hủy hóa đơn này?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dlr == DialogResult.OK) { if (ctl.deleteHD(HD.SOHD)) { MessageBox.Show("Hủy hóa đơn thành công!"); GUI_QLHD qlhd = new GUI_QLHD(TK, POS); this.Hide(); qlhd.ShowDialog(); e.Cancel = false; } else { e.Cancel = true; } } else { e.Cancel = true; } } else if (GUI.Equals("Cancel") || GUI.Equals("Edit")) { GUI_QLHD form = new GUI_QLHD(TK, POS); this.Hide(); form.ShowDialog(); e.Cancel = false; } }
private void btnSave_Click(object sender, EventArgs e) { GUI_QLHD hd = new GUI_QLHD(TK, cbPOS.Text); this.Hide(); hd.ShowDialog(); this.Close(); }