private void btnGuest_Click(object sender, EventArgs e) { if (!panel3.Controls.Contains(GuestForm.Instance())) { panel3.Controls.Add(GuestForm._instance); GuestForm._instance.Dock = DockStyle.Fill; GuestForm._instance.BringToFront(); GuestForm._instance.Visible = true; } GuestForm._instance.BringToFront(); GuestForm._instance.Visible = true; }
private void listView1_DoubleClick(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Bạn có muốn cập nhật thông tin khách hàng ?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { HomeForm hf = HomeForm.Instance(); GuestForm gf = GuestForm.Instance(); tempHoDem = listView1.SelectedItems[0].SubItems[1].Text.ToString(); tempTen = listView1.SelectedItems[0].SubItems[2].Text.ToString(); if (!hf.panel3.Controls.Contains(gf)) { hf.panel3.Controls.Add(gf); gf.Dock = DockStyle.Fill; gf.BringToFront(); gf.Visible = true; gf.txtLastName.Text = tempHoDem.ToString(); gf.txtFirstName.Text = tempTen.ToString(); gf.txtCMND.Text = listView1.SelectedItems[0].Text.ToString(); gf.rbMale.Checked = true; tempHoDem = ""; tempTen = ""; this.Hide(); } else { gf.BringToFront(); gf.Visible = true; gf.txtLastName.Text = tempHoDem.ToString(); gf.txtFirstName.Text = tempTen.ToString(); gf.txtCMND.Text = listView1.SelectedItems[0].SubItems[3].Text.ToString(); gf.rbMale.Checked = true; tempHoDem = ""; tempTen = ""; this.Hide(); } } else { return; } }