private void LoginBtn_Click(object sender, EventArgs e) { string department = departmentName.Text; if (!proxy.CheckDepartment(department)) { proxy.AddDepartment(department); } Hide(); new DepartmentPage(department).ShowDialog(); Show(); }