Exemplo n.º 1
0
        public ActionResult EditAbout()
        {
            var repository       = new AboutRepository();
            var aboutInformation = repository.GetAboutInformation();

            if (aboutInformation == null)
            {
                return(View(new AboutInformationViewModel()));
            }
            var model = new AboutInformationViewModel();

            return(View(model));
        }
Exemplo n.º 2
0
 public ActionResult EditAbout(AboutInformationViewModel viewmodel)
 {
     if (ModelState.IsValid)
     {
         _repository.EditAboutInformation(new AboutInformation
         {
             AboutMe   = viewmodel.AboutMe,
             BirthDate = viewmodel.BirthDate,
             FirstName = viewmodel.FirstName,
             LastName  = viewmodel.LastName,
         });
         return(RedirectToAction("About"));
     }
     return(View(viewmodel));
 }
Exemplo n.º 3
0
        public ActionResult About()
        {
            var repository = new AboutRepository();

            var aboutInformation = repository.GetAboutInformation();
            var model            = new AboutInformationViewModel();

            if (aboutInformation != null)
            {
                model.AboutMe   = aboutInformation.AboutMe;
                model.BirthDate = aboutInformation.BirthDate;
                model.FirstName = aboutInformation.FirstName;
                model.LastName  = aboutInformation.LastName;
            }

            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult EditAbout()
        {
            var aboutInformation = _repository.GetAboutInformation();

            if (aboutInformation == null)
            {
                return(View(new AboutInformationViewModel()));
            }
            var model = new AboutInformationViewModel()
            {
                AboutMe   = aboutInformation.AboutMe,
                FirstName = aboutInformation.FirstName,
                LastName  = aboutInformation.LastName,
                BirthDate = aboutInformation.BirthDate,
            };

            return(View(model));
        }
Exemplo n.º 5
0
 public ActionResult EditAbout(AboutInformationViewModel viewmodel)
 {
     return(null);
 }