Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
 public async Task <Tax> GetTaxByIdAsync(int id)
 {
     return(await _taxRepository.GetTaxById(id));
 }
Ejemplo n.º 3
0
 public override void ProcessDTOPostPut(TaxDTO dto, int id, Client currentClient)
 {
     orig = TaxRepository.GetTaxById(dto == null ? id : (int)dto.Id, currentClient.Id);
 }