private bool CheckInputValidationForLogin(string PopServer, string PopPort, string LoginUserName, string LoingPassword) { if (PopServer.Equals("")) { MessageBox.Show(this, "You must provide pop server address.", "Email Client", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } else if (PopPort.Equals("")) { MessageBox.Show(this, "You must provide pop port number.", "Email Client", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } else if (LoginUserName.Equals("")) { MessageBox.Show(this, "You must provide username(Email).", "Email Client", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } else if (LoginPassword.Equals("")) { MessageBox.Show(this, "You must provide password.", "Email Client", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
private void Login() { Main.lUser.Username = LoginUser; Main.lUser.Email = LoginUser; Main.lUser.Password = LoginPassword; if (Main.sql && LoginUser.Equals("admin") && LoginPassword.Equals("admin")) { var admin = new FAdmin(); Hide(); admin.Show(); } else if (!Main.con.Login()) { MessageBox.Show("Invalid data."); } else { Hide(); main.Show(); } }