public ActionResult EditBataRate(int id) { BataRateViewModel model = new BataRateViewModel(); BataRate bata = _bataRateService.GetBataRateById(id); model = Mapper.Map <BataRateViewModel>(bata); return(View(model)); }
public ActionResult EditBataRate(int id, BataRate models) { try { BataRateViewModel model = new BataRateViewModel(); BataRate bata = _bataRateService.GetBataRateById(id); bata.Description = models.Description; bata.Amount = models.Amount; _bataRateService.SaveBataRates(bata); return(RedirectToAction("Index")); } catch { return(View()); } }