Пример #1
0
        public ActionResult PublishPost(Guid id)
        {
            try
            {
                var oldEntity = _testimonialService.FindBy(x => x.Id == id).Single();

                oldEntity.UpdatedDate = DateTime.Now;
                oldEntity.UpdatedBy   = Request.IsAuthenticated ? User.Identity.Name : "System";
                oldEntity.IsActive    = true;

                _testimonialService.Edit(oldEntity);
                _testimonialService.Save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }