public ActionResult Edit(int?Id) { var Holidays = HolidaysRepository.GetHolidaysById(Id.Value); if (Holidays != null && Holidays.IsDeleted != true) { var model = new HolidaysViewModel(); AutoMapper.Mapper.Map(Holidays, model); //if (model.CreatedUserId != Erp.BackOffice.Helpers.Common.CurrentUser.Id && Erp.BackOffice.Helpers.Common.CurrentUser.UserTypeId != 1) //{ // TempData["FailedMessage"] = "NotOwner"; // return RedirectToAction("Index"); //} return(View(model)); } if (Request.UrlReferrer != null) { return(Redirect(Request.UrlReferrer.AbsoluteUri)); } return(RedirectToAction("Index")); }