public IActionResult Update(SellingMovesUpdateViewModel model) { if (ModelState.IsValid) { SellingMoves moves = new SellingMoves() { Id = model.Id, Date = model.Date, Adet = model.Adet, AppUserId = model.AppUserId, ProductId = model.ProductId, Price = model.Price, TotalPrice = model.Price * model.Adet }; _sellingMovesService.Update(moves); return(RedirectToAction("Index")); } return(View("Index")); }
public IActionResult Sell(SellingMovesAddViewModel p) { if (ModelState.IsValid) { SellingMoves moves = new SellingMoves() { Adet = p.Adet, Price = p.Price, TotalPrice = p.Price * p.Adet, AppUserId = p.AppUserId, Date = p.Date, ProductId = p.ProductId }; _sellingMovesService.Add(moves); _sellingMovesService.DecreaseStoc(moves.ProductId, moves.Adet); return(RedirectToAction("Index")); } return(View(p)); }
public void Update(SellingMoves entity) { _sellingMovesDal.Update(entity); }
public void Delete(SellingMoves entity) { throw new NotImplementedException(); }
public void Add(SellingMoves entity) { _sellingMovesDal.Add(entity); }