Ejemplo n.º 1
0
        private void button_add_comp_Click(object sender, EventArgs e)
        {
            CompanyForm addCompany = new CompanyForm(Type.CREATE, new Company(null, null, null, null, 0));

            addCompany.FormClosing += new FormClosingEventHandler(Ref);
            addCompany.Show();
        }
Ejemplo n.º 2
0
        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();
        }