Exemple #1
0
        public User Login(String UserName, String Pwd)
        {
            var db   = new Soway.Model.SqlServer.ObjectContext <User>(this.Con, this.ConFac);
            var user = db.GetDetail(UserName);

            if (user.PassWord == ToMD5(Pwd))
            {
                user.PassWord = Pwd;
                return(user);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public bool ChangePassWord(String userName, string oldPwd, String newPwd)
        {
            var db   = new Soway.Model.SqlServer.ObjectContext <User>(this.Con, this.ConFac);
            var user = db.GetDetail(userName);

            if (user.PassWord == ToMD5(oldPwd))
            {
                user.PassWord = newPwd;
                db.Save(user);
                return(true);
            }
            else
            {
                return(false);
            }
        }