Esempio n. 1
0
        public bool UpdateUser(int IDUser, string username, string password, string type)
        {
            string encpassword = HashMD5.Encrypt(password);
            string enctype     = HashMD5.Encrypt(type);
            string query       = string.Format(@"Update User SET Username = '******', Password = '******', Type = '" + enctype + "' WHERE IDUser = '******' ");
            int    result      = DataProvider.Instance.ExecuteNonQuery(query);

            return(result > 0);
        }
Esempio n. 2
0
        public bool InsertUser(string username, string password, string type)
        {
            string encpassword = HashMD5.Encrypt(password);
            string enctype     = HashMD5.Encrypt(type);
            string query       = string.Format(@"Insert Into User ( Username, Password, Type) VALUES ('" + username + "','" + encpassword + "','" + enctype + "')");
            int    result      = DataProvider.Instance.ExecuteNonQuery(query);

            return(result > 0);
        }