public static AdminHome getInstance() { if (l == null) { l = new AdminHome(); l.Show(); return(l); } else { return(l); } }
private void cmdLogin_Click(object sender, EventArgs e) { Server.Service1 server = new Server.Service1(); Boolean isvalid = false; Boolean isvalidpassed = false; server.isvalid(txtUserName.Text, txtPassword.Text, out isvalid, out isvalidpassed); if (!isvalid) { AdminHome l = AdminHome.getInstance(); l.Show(); this.Hide(); MessageBox.Show("valid"); } else { MessageBox.Show("invalid"); } }