public ActionResult Create(int vendorId, string orderDescription, string orderBread, string orderPastry, string orderPrice) { Dictionary <string, object> model = new Dictionary <string, object>(); Vendor foundVendor = Vendor.Find(vendorId); Order newOrder = new Order(orderDescription, orderBread, orderPastry, orderPrice); foundVendor.AddItem(newOrder); List <Order> vendorOrders = foundVendor.Orders; model.Add("orders", vendorOrders); model.Add("vendor", foundVendor); return(View("Show", model)); }
public ActionResult Create(int vendorId, string NewOrder, string orderDesc, int price, string orderDate) { Dictionary <string, object> model = new Dictionary <string, object>(); Vendor foundVendor = Vendor.Find(vendorId); Order newOrder = new Order(NewOrder, orderDesc, price, orderDate); foundVendor.AddItem(newOrder); List <Order> vendorOrder = foundVendor.Orders; model.Add("order", vendorOrder); model.Add("vendor", foundVendor); return(View("Show", model)); }
public ActionResult Create(int vendorId, string title, string description, int price, string date) { Dictionary <string, object> model = new Dictionary <string, object>(); Vendor foundVendor = Vendor.Find(vendorId); Order newOrder = new Order(title, description, price, date); foundVendor.AddItem(newOrder); List <Order> categoryItems = foundVendor.Orders; model.Add("order", categoryItems); model.Add("vendor", foundVendor); return(View("Show", model)); }