public ActionResult ShowProfile()
        {
            BusinessLayerResult <EveryNoteUser> res = everynoteuser_mngr.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel error_notifyobj = new ErrorViewModel()
                {
                    title = "Hoops!Something went wrong.",
                    text  = "Requested operation could not be performed!",
                    Items = res.Errors
                };

                return(View("Error", error_notifyobj));
            }

            return(View(res.Result));
        }
Beispiel #2
0
        public ActionResult ShowProfile()
        {
            EverynoteUser currentuser = Session["login"] as EverynoteUser;

            BusinessLayerResult <EverynoteUser> res = everynoteUserManager.GetUserById(currentuser.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };

                return(View("Error", errorNotifyObj));
            }

            return(View(res.Result));
        }
        /// <summary>
        /// Kullanıcının Profil Sayfasını Açan Action
        /// </summary>
        /// <returns></returns>
        public ActionResult ProfileShow()
        {
            EverynoteUserManager       everynoteUserManager    = new EverynoteUserManager();
            BusinessLayerResult <User> businessLayerResultUser = everynoteUserManager.GetUserById(CurrentSession.User.Id);

            if (businessLayerResultUser.Errors.Count > 0)
            {
                ErrorViewModel errorViewModel = new ErrorViewModel
                {
                    Title = "Hata Oluştu",
                    RedirectingTimeout = 4000,
                    Items = businessLayerResultUser.Errors
                };
                return(View("Error", errorViewModel));                // Shared altındaki 'Error' view'ına gider
            }

            return(View(businessLayerResultUser.Result));
        }