Example #1
0
        public int TestPassword(string password)
        {
            string encPassword = AccountsPrincipal.EncryptPassword(password);

            SM.YuQing.BLL.Person bll = new BLL.Person();
            return(bll.TestPassword(this.FID, encPassword));
        }
        /// <summary>
        /// 通过用户名和密码从新取得用户详细信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public static AccountsPrincipal ValidateLogin(string userName, string password)
        {
            SM.YuQing.BLL.Person bll = new BLL.Person();
            string encPassword       = EncryptPassword(password);
            int    userID            = bll.ValidateLogin(userName, encPassword);//返回用户内码

            if (userID > 0)
            {
                return(new AccountsPrincipal(userID));//取得用户信息
            }
            return(null);
        }
Example #3
0
 public SiteIdentity(string currentCode)
 {
     SM.YuQing.BLL.Person   bll   = new BLL.Person();
     SM.YuQing.Model.Person model = bll.GetModelFromCode(currentCode);
     this._fid   = model.ID;
     this._fcode = model.Code;
     this._fname = model.Name;
     //this._fpermission = model.FPermission;
     //this._ftenantcode = model.FTenantCode;
     this._fpwd = model.Pwd;
     //this._fstoreno = model.FStoreNo;
 }
Example #4
0
        public void CastPersonToUser(BLL.Person person)
        {
            ID       = person.Id.ToString();
            Name     = person.Name;
            Surname  = person.Surname;
            Email    = person.Email;
            Gender   = person.Gender;
            Birthday = person.Birthday;

            LikedMovies = new List <SimpleMovieViewModel>();
            foreach (var movie in person.Profile.LikedMovies)
            {
                var movieView = new SimpleMovieViewModel();
                movieView.CastSimpleFromMovie(movie);
                LikedMovies.Add(movieView);
            }

            var movieRepo = new BLL.MovieRepository();

            Watches = new List <SimpleMovieViewModel>();
            if (person.Watches.Count > 0)
            {
                var watches = movieRepo.GetMoviesByFB(person.Watches);
                foreach (var movie in watches)
                {
                    var movieView = new SimpleMovieViewModel();
                    movieView.CastSimpleFromMovie(movie);
                    Watches.Add(movieView);
                }
            }

            Wants = new List <SimpleMovieViewModel>();
            if (person.Wants.Count > 0)
            {
                var wants = movieRepo.GetMoviesByFB(person.Wants);
                foreach (var movie in wants)
                {
                    var movieView = new SimpleMovieViewModel();
                    movieView.CastSimpleFromMovie(movie);
                    Wants.Add(movieView);
                }
            }

            // FavActors
            FavActors = person.Profile.TopActors(5);

            // FavDirectors
            FavDirectors = person.Profile.TopDirectors(5);

            // FavGenres
            FavGenres = person.Profile.TopGenres(5);
        }
Example #5
0
 public bool CanViewMenu(string menuid)
 {
     SM.YuQing.BLL.Person bll = new BLL.Person();
     return(bll.CanViewMenu(this._fid, menuid));
 }