示例#1
0
        // GET: My/MyEdit
        public ActionResult MyEdit(int id)
        {
            //list of security questions for the select option list
            List <SecurityQuestion> securityQuestions = securityQuestionService.GetMySQs();

            ViewBag.securityQuestions = securityQuestions;
            //get the current user and pass it to the view
            ViewBag.user = userService.GetUser(id);

            return(View(new Models.UserUpdateModel()));
        }
示例#2
0
        // GET: SecurityQuestion
        public ActionResult Index(int page = 1, int pageSize = 5)
        {
            User user       = GetUserSession();                                                                      //set the user session
            var  sqList     = _securityQuestionService.GetMySQs().OrderBy(p => p.qId).OrderByDescending(p => p.qId); //"Security Questions"sorted descending by the "question Id"
            var  sqViewList = AutoMapper.Mapper.Map <IEnumerable <SecurityQuestion>, IEnumerable <SecurityQuestionViewModel> >(sqList);
            var  model      = new SecurityQuestionVm();

            model.Question = sqViewList.ToPagedList(page, pageSize);// five "Security Questions" records display per page
            return(View(model));
        }