Пример #1
0
 public IActionResult Create(CommissionFormula commissionFormula)
 {
     try
     {
         _commissionFormulaRepository.Add(commissionFormula);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(commissionFormula));
     }
 }
Пример #2
0
        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();
 }