Ejemplo n.º 1
0
        public IActionResult AboutEditOurMission(Mission model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var emailSubj = string.Empty;

            if (model.MissionId == 0)
            {
                model.CreatedBy   = User.Identity.Name;
                model.DateCreated = DateTime.UtcNow;

                _missionRepo.Add(model);
                _missionRepo.SaveAll();
            }
            else
            {
                model.UpdatedBy   = User.Identity.Name;
                model.DateUpdated = DateTime.UtcNow;

                _missionRepo.Update(model);
                _missionRepo.SaveAll();
            }

            return(RedirectToAction("About", "Home"));
        }