public DataSet GetRentalCarAgencies(string city, string state) { SqlCommand objCommand = new SqlCommand(); objCommand.CommandType = CommandType.StoredProcedure; objCommand.CommandText = "GetRentalCarAgencies"; objCommand.Parameters.AddWithValue("@city", city); objCommand.Parameters.AddWithValue("@state", state); DBConnect objDB = new DBConnect(); return objDB.GetDataSetUsingCmdObj(objCommand); }
public string GetUserFullName(string email) { DataSet myDS = new DataSet(); SqlCommand objCommand = new SqlCommand(); objCommand.CommandType = CommandType.StoredProcedure; objCommand.CommandText = "GetUserFullName"; objCommand.Parameters.AddWithValue("@email", email); DBConnect objDB = new DBConnect(); myDS = objDB.GetDataSetUsingCmdObj(objCommand); string firstName = myDS.Tables[0].Rows[0]["firstName"].ToString(); string lastName = myDS.Tables[0].Rows[0]["lastName"].ToString(); return firstName + " " + lastName; }
public bool CheckForEmail(string email) { DataSet myDS = new DataSet(); SqlCommand objCommand = new SqlCommand(); objCommand.CommandType = CommandType.StoredProcedure; objCommand.CommandText = "CheckForEmail"; objCommand.Parameters.AddWithValue("@email", email); DBConnect objDB = new DBConnect(); myDS = objDB.GetDataSetUsingCmdObj(objCommand); if (myDS.Tables[0].Rows.Count <= 0) return true; else return false; }
public DataSet FindCars(Requirements requirements, string city, string state) { SqlCommand objCommand = new SqlCommand(); objCommand.CommandType = CommandType.StoredProcedure; objCommand.CommandText = "FindCars"; objCommand.Parameters.AddWithValue("@price", requirements.price); objCommand.Parameters.AddWithValue("@gps", requirements.gps); objCommand.Parameters.AddWithValue("@type", requirements.type); objCommand.Parameters.AddWithValue("@carClass", requirements.carClass); objCommand.Parameters.AddWithValue("@electric", requirements.electric); objCommand.Parameters.AddWithValue("@passengers", requirements.passengers); objCommand.Parameters.AddWithValue("@luggage", requirements.luggage); objCommand.Parameters.AddWithValue("@doors", requirements.doors); objCommand.Parameters.AddWithValue("@mileage", requirements.mileage); objCommand.Parameters.AddWithValue("@city", city); objCommand.Parameters.AddWithValue("@state", state); DBConnect objDB = new DBConnect(); return objDB.GetDataSetUsingCmdObj(objCommand); }
public bool ValidateLogin(string email, string password) { int hash = password.GetHashCode(); password = hash.ToString(); DataSet myDS = new DataSet(); SqlCommand objCommand = new SqlCommand(); objCommand.CommandType = CommandType.StoredProcedure; objCommand.CommandText = "ValidateLogin"; objCommand.Parameters.AddWithValue("@email", email); objCommand.Parameters.AddWithValue("@password", password); DBConnect objDB = new DBConnect(); myDS = objDB.GetDataSetUsingCmdObj(objCommand); if (myDS.Tables[0].Rows.Count == 1) return true; else return false; }