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));
        }
Esempio n. 3
0
 public void Update(SellingMoves entity)
 {
     _sellingMovesDal.Update(entity);
 }
Esempio n. 4
0
 public void Delete(SellingMoves entity)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
0
 public void Add(SellingMoves entity)
 {
     _sellingMovesDal.Add(entity);
 }