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 Update(int id) { ViewBag.current = _appUserService.GetCurrents().Select(x => new SelectListItem() { Text = x.Name + " " + x.Surname, Value = x.Id.ToString() }).ToList(); var move = _sellingMovesService.GetSellingMovewithProduct(id); SellingMovesUpdateViewModel model = new SellingMovesUpdateViewModel() { Id = move.Id, Date = move.Date, Adet = move.Adet, AppUserId = move.AppUserId, Price = move.Price, ProductId = move.ProductId }; return(View(model)); }