private void button_add_pers_Click(object sender, EventArgs e) { PersonForm addPerson = new PersonForm(Type.CREATE, new Person(null, null, null, 0, null)); addPerson.FormClosing += new FormClosingEventHandler(Ref); addPerson.Show(); }
private void button_Click(object sender, EventArgs e) { Button button = sender as Button; Type type; if (button.Text == "View") { type = Type.VIEW; } else { type = Type.EDIT; } foreach (User user in Program.selected_clients) { if (user is Company) { CompanyForm addCompany = new CompanyForm(type, user as Company); addCompany.FormClosing += new FormClosingEventHandler(Ref); addCompany.ShowDialog(); } if (user is Person) { PersonForm addPerson = new PersonForm(type, user as Person); addPerson.FormClosing += new FormClosingEventHandler(Ref); addPerson.ShowDialog(); } } Program.selected_clients.Clear(); ClearSearch(); ShowUsers(); }