public ActionResult Edit(int?Id) { var Tax = TaxRepository.GetTaxById(Id.Value); if (Tax != null && Tax.IsDeleted != true) { var model = new TaxViewModel(); AutoMapper.Mapper.Map(Tax, 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")); }
public async Task <Tax> GetTaxByIdAsync(int id) { return(await _taxRepository.GetTaxById(id)); }
public override void ProcessDTOPostPut(TaxDTO dto, int id, Client currentClient) { orig = TaxRepository.GetTaxById(dto == null ? id : (int)dto.Id, currentClient.Id); }