public ActionResult Show(int vendorId, int orderId)
        {
            Orders  order  = Orders.Find(orderId);
            Vendors vendor = Vendors.Find(vendorId);
            Dictionary <string, object> model = new Dictionary <string, object>();

            model.Add("order", order);
            model.Add("vendors", vendor);
            return(View(model));
        }
        public ActionResult Show(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Vendors       selectedVendors     = Vendors.Find(id);
            List <Orders> vendorsOrders       = selectedVendors.Orders;

            model.Add("vendors", selectedVendors);
            model.Add("orders", vendorsOrders);
            return(View(model));
        }
Beispiel #3
0
        public void Find_ReturnsCorrectVendor_Vendor()
        {
            string  name01     = "Dill Rye the Sandwich Guy";
            string  name02     = "The Sand-Witch";
            Vendors newVendor1 = new Vendors(name01);
            Vendors newVendor2 = new Vendors(name02);

            Vendors result = Vendors.Find(2);

            Assert.AreEqual(newVendor2, result);
        }
        public ActionResult Create(int vendorId, string orderDescription, double orderPrice)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Vendors foundVendors = Vendors.Find(vendorId);
            Orders  newOrder     = new Orders(orderDescription, orderPrice);

            foundVendors.AddOrder(newOrder);
            List <Orders> vendorsOrders = foundVendors.Orders;

            model.Add("orders", vendorsOrders);
            model.Add("vendors", foundVendors);
            return(View("show", model));
        }
 public VendorDTO GetVendor(int ID)
 {
     return(Vendors.Find(ID));
 }
        public ActionResult New(int vendorId)
        {
            Vendors vendor = Vendors.Find(vendorId);

            return(View(vendor));
        }