예제 #1
0
    public Boolean checkPassword()
    {
        string passwordMD5 = userExist();

        if (passwordMD5.Equals(PasswordEncrypt.encryptString(Password)))
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
예제 #2
0
    public void resetPassword(string newpwd)
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["PizzaDBRemote"].ConnectionString);

        conn.Open();
        string     checkUser = "******";
        SqlCommand comd      = new SqlCommand(checkUser, conn);

        comd.Parameters.AddWithValue("@userName", UserName);
        comd.Parameters.AddWithValue("@password", PasswordEncrypt.encryptString(newpwd));
        comd.ExecuteNonQuery();
        conn.Close();
    }
예제 #3
0
    public void insertData()
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["PizzaDBRemote"].ConnectionString);

        conn.Open();

        string     insertQuery = "insert into Customer(UserName, FName, LName, Email, Country, Password, Age, Gender) values (@UserName, @FName, @LName, @Email, @Country, @Password, @Age, @Gender)";
        SqlCommand comd        = new SqlCommand(insertQuery, conn);

        comd.Parameters.AddWithValue("@UserName", UserName);
        comd.Parameters.AddWithValue("@Fname", FName);
        comd.Parameters.AddWithValue("@LName", LName);
        comd.Parameters.AddWithValue("@Email", Email);
        comd.Parameters.AddWithValue("@Country", Country);
        comd.Parameters.AddWithValue("@Password", PasswordEncrypt.encryptString(Password));
        comd.Parameters.AddWithValue("@Age", Convert.ToInt32(Age));
        comd.Parameters.AddWithValue("@Gender", Gender);
        comd.ExecuteNonQuery();
        conn.Close();
    }