示例#1
0
 public RSOrderItem(RSProduct product, RSOrder order)
     : this()
 {
     Product = product;
     Order = order;
     Price = product.Price;
 }
示例#2
0
 public RSOrderItem(RSProduct product, RSOrder order)
     : this()
 {
     Product = product;
     Order   = order;
     Price   = product.Price;
 }
示例#3
0
 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();
     }
 }
示例#4
0
        public async Task<ActionResult> Create(RSProduct rSProduct)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(rSProduct);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(rSProduct);
        }
示例#5
0
 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);
 }