public void Delete(int MaterialId)
        {
            MaterialDiscount cd = _dbContext.MaterialDiscounts.
                                  Where(c => c.MaterialId == MaterialId).Single();

            _dbContext.MaterialDiscounts.Remove(cd);
            _dbContext.SaveChanges();
        }
 public void Update(MaterialDiscount MaterialDiscount)
 {
     _dbContext.MaterialDiscounts.Update(MaterialDiscount);
     _dbContext.SaveChanges();
 }
示例#3
0
 public void Put(int MaterialId, [FromBody] MaterialDiscount materialDiscount)
 {
     materialDiscount.MaterialId = MaterialId;
     _repository.Update(materialDiscount);
 }
 public void Add(MaterialDiscount MaterialDiscount)
 {
     _dbContext.MaterialDiscounts.Add(MaterialDiscount);
     _dbContext.SaveChanges();
 }
示例#5
0
 public void Post([FromBody] MaterialDiscount materialDiscount)
 {
     _repository.Add(materialDiscount);
 }