Esempio n. 1
0
        public ActionResult Edit(int?Id)
        {
            var TimekeepingSynthesis = TimekeepingSynthesisRepository.GetTimekeepingSynthesisById(Id.Value);

            if (TimekeepingSynthesis != null && TimekeepingSynthesis.IsDeleted != true)
            {
                var model = new TimekeepingSynthesisViewModel();
                AutoMapper.Mapper.Map(TimekeepingSynthesis, model);

                //if (model.CreatedUserId != Helpers.Common.CurrentUser.Id && 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"));
        }