Beispiel #1
0
        public async Task <IActionResult> EditAsync(SiteMap siteMap)
        {
            if (ModelState.IsValid)
            {
                var user = await _userManager.GetUserAsync(HttpContext.User);

                siteMap.ApprovedBy   = user;// user.Id.ToString();
                siteMap.ApprovedById = user.Id.ToString();
                siteMap.ApprovalDate = DateTime.Now;
                siteMap.CreationDate = DateTime.Now;
                SiteMap newSectionCardVersion = _siteMapRepository.Update(siteMap);
                if (newSectionCardVersion != null)
                {
                    _toastNotification.AddSuccessToastMessage(ToasrMessages.EditSuccess);
                    _eventLogger.LogInfoEvent(HttpContext.User.Identity.Name, Common.ActivityEnum.Update, "Definitions > Page SiteMap Details > Edit", siteMap.EnContent);

                    return(RedirectToAction("Index", new { id = newSectionCardVersion.Id }));
                }
                else
                {
                    _eventLogger.LogInfoEvent(HttpContext.User.Identity.Name, Common.ActivityEnum.Warning, "Definitions > Page SiteMap Details > Edit", siteMap.EnContent);
                    _toastNotification.AddErrorToastMessage(ToasrMessages.warning);
                }
            }
            return(View(_siteMapRepository));
        }
Beispiel #2
0
 public void Update(SiteMap _model)
 {
     _Repository.Update(_model);
 }