private void btn5_Click(object sender, EventArgs e) { switch (deptCode) { case "RM": this.Hide(); EditRest erest = new EditRest(restNo, this); erest.Show(); break; case "WC": this.Hide(); ReleaseMenu releaseMenu = new ReleaseMenu(); releaseMenu.Show(); break; } }
private void button1_Click(object sender, EventArgs e) { if (listViewUser.SelectedItems.Count >= 1 || listViewRest.SelectedItems.Count >= 1) { if (target == 0) { EditAc ea = new EditAc(listViewUser.SelectedItems[0].SubItems[3].Text, "AM", listViewUser.SelectedItems[0].SubItems[0].Text, this); this.Hide(); ea.Show(); } else { EditRest er = new EditRest(listViewRest.SelectedItems[0].SubItems[0].Text, this); this.Hide(); er.Show(); } } else { MessageBox.Show("Please select the target \n that you want to edit.", "Select Target!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }