Exemplo n.º 1
0
        public bool ChangePassword(int userid, string oldPassword, string newPassword)
        {
            StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext();

            try
            {
                var res = dbmlObject.AuthenticationByID(userid, oldPassword).ToList();
                if (res.Count == 0)
                {
                    return(false);
                }
                dbmlObject.ChangePassword(userid, newPassword);
            }
            catch (Exception e) { return(false); }
            return(true);
        }