public IActionResult Create(CommissionFormula commissionFormula) { try { _commissionFormulaRepository.Add(commissionFormula); return(RedirectToAction("Index")); } catch { return(View(commissionFormula)); } }
public IActionResult Edit(int id, CommissionFormula commissionFormula) { if (id != commissionFormula.Id) { return(NotFound()); } try { _commissionFormulaRepository.Update(commissionFormula); return(RedirectToAction("Index")); } catch (DbUpdateConcurrencyException) { return(View(commissionFormula)); } }
public void Update(CommissionFormula commissionFormula) { _appDbContext.Update(commissionFormula); _appDbContext.SaveChanges(); }
public void Add(CommissionFormula commissionFormula) { _appDbContext.CommissionFormulas.Add(commissionFormula); _appDbContext.SaveChanges(); }