示例#1
0
        public ActionResult ShowProfile()
        {
            if (CurrentSession.User != null)
            {
                BusinessLayerResult <EvernoteUser> result = _evernoteUserManager.GetUserById(CurrentSession.User.Id);

                if (result.Errors.Count > 0)
                {
                    foreach (ErrorMessageObj error in result.Errors)
                    {
                        ErrorViewModel model = new ErrorViewModel()
                        {
                            Title          = "Hata Oluştu",
                            RedirectingUrl = "/Home/Index",
                            List           = result.Errors
                        };
                        return(View("Error", model));
                    }
                }

                return(View(result.Result));
            }

            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult ShowProfile()
        {
            BusinessLayerResult <EverNoteUser> res = evernoteusermanager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
            }
            return(View(res.Result));
        }
示例#3
0
        // GET: Profile
        public ActionResult ShowProfile()
        {
            Result <EvernoteUser> res = eum.GetUserById(SessionManager.User.ID);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel err = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                return(View("Error", err));
            }
            return(View(res.Results));
        }
        public ActionResult ShowProfile(int?id)
        {
            BuisnessLayerResult <EvernoteUser> res = evernoteUserManager.GetUserById(id.Value);


            ProfileViewModel model = new ProfileViewModel()
            {
                ID                   = res.Result.ID,
                Username             = res.Result.Username,
                Name                 = res.Result.Name,
                Surname              = res.Result.Surname,
                ProfileImageFileName = res.Result.ProfileImageFileName,
                Description          = res.Result.Description,
                Job                  = res.Result.Job,
                Country              = res.Result.Country,
                DateOfBirth          = res.Result.DateOfBirth,
                isAdmin              = res.Result.isAdmin,
                Email                = res.Result.Email
            };

            if (res.Errors.Count > 0)
            {
                errorObject.Title = "Hata Oluştu! Hesabınız Silinmiş Olabilir!";
                errorObject.Items = res.Errors;

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


            return(View(model));
        }
示例#5
0
        [Auth]  //filter ekledik.giriş yapmamışsa yönlendirme yapıyoruz bu classta(Filters klasöründe)(authenticationfilterlogin)
        public ActionResult ShowProfile()
        {
            //EvernoteUser currentUser = Session["login"] as EvernoteUser;

            BusinessLayer.EvernoteUserManager eum = new EvernoteUserManager();
            //BusinessLayerResult<EvernoteUser> res = eum.GetUserById(currentUser.Id);
            BusinessLayerResult <EvernoteUser> res = eum.GetUserById(CurrentSession.User.Id);

            //hata var demekki
            if (res.Errors.Count > 0)
            {
                //Kullanıcıyı bir hata ekranına yönlendirmemiz gerekiyor.
                ErrorViewModel errorNotifyObj = new ErrorViewModel
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };


                return(View("Error", errorNotifyObj)); //shareddaki viewi aç
            }


            return(View(res.Result));
        }
示例#6
0
        public ActionResult EditProfile()
        {
            EvernoteUser currentUser = CurrentSession.User;

            if (currentUser != null)
            {
                EvernoteUserManager eum = new EvernoteUserManager();
                BusinessLayerResult <EvernoteUser> blr = eum.GetUserById(currentUser.Id);

                if (blr.Errors.Count > 0)
                {
                    ErrorViewModel errorModel = new ErrorViewModel();

                    blr.Errors.ForEach(x =>
                    {
                        errorModel.Items.Add(x.Value);
                    });

                    return(View("Error", errorModel));
                }
                else
                {
                    return(View(blr.Result));
                }
            }

            return(RedirectToAction("Login"));
        }
示例#7
0
        public ActionResult ShowProfile()
        {
            BusinessResult <EvernoteUser> res = evernoteUserManager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModal ErrnotifyObj = new ErrorViewModal()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                return(View("Error", ErrnotifyObj));
            }

            return(View(res.Result));
        }
示例#8
0
        public ActionResult ShowProfile()
        {
            //EverNoteUser currentUser = Session["login"] as EverNoteUser;

            BusinessLayetResult <EverNoteUser> res = evernoteUserManager.GetUserById(CurrentSession.User.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));
        }
示例#9
0
        public ActionResult ShowProfile()
        {
            //   EvernoteUser currentUser = Session["login"] as EvernoteUser; Yoruma aldım çünkü currentSession classımı yazdım.
            //Sessiondaki kullanıcıyı atadım.

            BusinessLayerResult <EvernoteUser> res = everNoteUserManager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Title = "Geçersiz İşlem",
                    Items = res.Errors
                };
                return(View("Error", errorNotifyObj));
            }

            return(View(res.Result));
        }
示例#10
0
        public ActionResult ShowProfile()
        {
            //EvernoteUser currentUser = Session["login"] as EvernoteUser;

            BusinessLayerResult <EvernoteUser> res = evernoteUserManager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel ErrornotfyError = new ErrorViewModel()
                {
                    Title          = "Hata Oluştu",
                    RedirectingUrl = "/Home/Index",
                    Items          = res.Errors
                };

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

            return(View(res.Result));
        }
        public ActionResult ShowProfile()
        {
            //   EvernoteUser currentUser = Session["login"] as EvernoteUser;

            // Kullanıcının id'sini fonksiyon yardımı ile buluyoruz.
            BusinessLayerResult <EvernoteUser> res = evernoteUserManager.GetUserById(CurrentSession.User.Id);

            // eğer hata var ise
            if (res.Errors.Count > 0)
            {
                // TODO : Kullanıcıyı bir hata ekranına yönlendirmek gerekiyor..
                ErrorViewModel ErrorNotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                // Hata var ise hata ekranına yönlendir.
                return(View("Error", ErrorNotifyObj));
            }
            // Eğer yok ise ShowProfile sayfasını aç ve sonucu yolla
            return(View(res.Result));
        }
示例#12
0
        public ActionResult EditProfile()
        {
            BusinessLayerResult <EvernoteUser> res = evernoteUserManager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                // Kullanıcıyı Hata Ekranına Yönlendiricez
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
            }

            return(View(res.Result));
        }
        public ActionResult EditProfile()
        {
            if (Session["login"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            EvernoteUser        currentUser        = Session["login"] as EvernoteUser;
            EvernoteUserManager eum                = new EvernoteUserManager();
            BusinessLayerResult <EvernoteUser> res = eum.GetUserById(currentUser.Id);

            if (res.Errors.Count > 0)
            {
                //hata
            }


            return(View(res.Result));
        }
示例#14
0
        public ActionResult EditProfile()
        {
            EvernoteUserManager evernoteUserManager = new EvernoteUserManager();
            BusinessLayerResult <EvernoteUser> res  = evernoteUserManager.GetUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };
                TempData["errors"] = res.Errors;
                return(View("Error", errorNotifyObj));
            }

            return(View(res.Result));
        }
示例#15
0
        public ActionResult EditProfile()
        {
            EvernoteUser currentUser = Session["login"] as EvernoteUser;

            BusinessLayer.EvernoteUserManager  eum = new EvernoteUserManager();
            BusinessLayerResult <EvernoteUser> res = eum.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));
        }
示例#16
0
        public ActionResult ShowProfile()
        {
            EvernoteUser currentUser = Session["login"] as EvernoteUser;

            EvernoteUserManager eum = new EvernoteUserManager();

            BusinessLayerResult <EvernoteUser> res = eum.GetUserById(currentUser.Id);

            if (res.Errors.Count > 0)
            {
                // Kullanıcıyı Hata Ekranına Yönlendiricez

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


            return(View(res.Result));
        }