Exemple #1
0
        public ActionResult Index(string option, string userType)
        {
            if (option != null)
            {
                switch (option.ToLower())
                {
                case "updateinfo":
                {
                    _viewModel = new UpdateInfoViewModel();
                    CreateLayoutView("Cập nhật thông tin");
                    break;
                }

                case "updatepassword":
                {
                    _viewModel = new UpdatePasswordViewModel();
                    CreateLayoutView("Cập nhật mật khẩu");
                    break;
                }

                case "updatesetting":
                {
                    _viewModel = new UpdateSettingViewModel();
                    CreateLayoutView("Cài đặt");
                    break;
                }

                case "notification":
                {
                    _viewModel = new NotificationViewModel();
                    CreateLayoutView("Thông báo");
                    break;
                }

                case "requests":
                {
                    _viewModel = new RequestsViewModel();
                    CreateLayoutView("Lời mời kết bạn");
                    break;
                }

                default:
                {
                    _viewModel = new UpdateInfoViewModel();
                    CreateLayoutView("Cập nhật thông tin");
                    break;
                }
                }
            }
            else
            {
                _viewModel = new UpdateInfoViewModel();
                CreateLayoutView("Cập nhật thông tin");
            }
            ViewBag.newMember        = userType;
            ViewBag.listRequest      = _friendService.GetRelationship(User.Identity.GetUserId()).Count - 1;
            ViewBag.listNotification = _notificationService.getAllNotification(User.Identity.GetUserId()).Count - 1;

            return(View(_viewModel));
        }
Exemple #2
0
        public ActionResult UpdateSetting()
        {
            _viewModel               = new UpdateSettingViewModel();
            ViewBag.listRequest      = _friendService.GetRelationship(User.Identity.GetUserId()).Count - 1;
            ViewBag.listNotification = _notificationService.getAllNotification(User.Identity.GetUserId()).Count - 1;

            return(PartialView("_UpdateSetting"));
        }