Login (LID,UName,UPasword,UserType_ID) UserType(UserType_ID,UserType)
Error 58 The type or namespace name 'UserInformation' could not be found (are you missing a using directive or an assembly reference?)
public string LogOn(UserInformation objLogOnUserInformation) { // ConnectionManager conCm = new ConnectionManager(); try { MySqlConnection con = conn.Open(); MySqlCommand cmd, cmdOne; MySqlDataReader dr; // SqlDataReader dr; string _str = "U"; cmd = new MySqlCommand("select LID from Credentials", con); dr = cmd.ExecuteReader(); while (dr.Read()) { //checking user name is present in database if (dr.GetValue(0).ToString() == objLogOnUserInformation.UserId) { dr.Close(); //retriving Password for the existing user cmd = new MySqlCommand("select Pasword from login where LID='" + objLogOnUserInformation.UserId + "'", con); dr = cmd.ExecuteReader(); while (dr.Read()) { //checking the password is matching with the database if (dr.GetValue(0).ToString() == objLogOnUserInformation.Password) { dr.Close(); cmd = new MySqlCommand("select UserType_ID from login where LID='" + objLogOnUserInformation.UserId + "'", con); dr = cmd.ExecuteReader(); while (dr.Read()) { //checking user type if (dr.GetValue(0).ToString() == _str) { dr.Close(); cmdOne = new MySqlCommand("select UName from login where LID='" + objLogOnUserInformation.UserId + "'", con); dr = cmdOne.ExecuteReader(); dr.Read(); objLogOnUserInformation.SessionUserName = dr.GetValue(0).ToString(); dr.Close(); //if usertype is customer, U is returned Response.Redirect("gallery.aspx"); } else { dr.Close(); cmdOne = new MySqlCommand("select UName from login where LID='" + objLogOnUserInformation.UserId + "'", con); dr = cmdOne.ExecuteReader(); dr.Read(); objLogOnUserInformation.SessionUserName = dr.GetValue(0).ToString(); dr.Close(); //If usertype is Admin, A is returned Response.Redirect("Reports.aspx"); } } } else { return " Either User Name or Password is not Valid"; } } } } } catch { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)