public RSOrderItem(RSProduct product, RSOrder order) : this() { Product = product; Order = order; Price = product.Price; }
private async void navProductMenu_ProductSelected(RSProduct product) { RSOrderItem orderItem = await Service.AddOrderItem(order.Id, product.Id); if (orderItem != null) { order.Items.Add(orderItem); lstOrderItems.ItemsSource = order.Items.Where(oi => oi.State < 2); } else { MessageDialog md = new MessageDialog("Položku nelze přidat.", "Přidání položky"); await md.ShowAsync(); } }
public async Task<ActionResult> Create(RSProduct rSProduct) { if (ModelState.IsValid) { db.Products.Add(rSProduct); await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(rSProduct); }
public async Task<ActionResult> Edit(RSProduct rSProduct) { if (ModelState.IsValid) { db.Entry(rSProduct).State = System.Data.Entity.EntityState.Modified; await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(rSProduct); }