private void logoutToolStripMenuItem_Click(object sender, EventArgs e) { AddPost apo = new AddPost(); this.Hide(); apo.Show(); }
private void cmdLogin_Click(object sender, EventArgs e) { bool valid; bool isvalid; bool adminvalid; bool adminisvalid; localhost.Service1 server = new localhost.Service1(); server.Login_user(txtusername.Text, txtpassword.Text, out valid, out isvalid); server.isadmin(txtusername.Text, txtpassword.Text, out adminvalid, out adminisvalid); if (valid) { MessageBox.Show("Welcome User"); AddPost adpost = new AddPost(); this.Hide(); adpost.Show(); } else if (adminvalid) { MessageBox.Show("Welcome Admin"); PendingPostsAdmin adpage = new PendingPostsAdmin(); this.Hide(); adpage.Show(); } else { MessageBox.Show("User Not Found"); } }