예제 #1
0
        public ActionResult StoreBouquetOrder(BouquetView bouquetview) /*Save Customer Bouquet Order*/
        {
            Customer customer = new Customer();

            customer.CustomerName = bouquetview.CustomerName;
            customer.Telephone    = bouquetview.Telephone;
            customer.Address      = bouquetview.Address;
            customer.Email        = bouquetview.Email;
            customer.DeliveryDate = bouquetview.DeliveryDate;

            OrderBouquet orderbouquet = new OrderBouquet();

            orderbouquet.FlowerForBouquet = bouquetview.FlowerForBouquet;


            using (var db = new FlowerContext())
            {
                var bouquet = db.Bouquets.FirstOrDefault(b => b.BouquetName.Equals(bouquetview.BouquetName, StringComparison.InvariantCultureIgnoreCase));
                orderbouquet.BouquetId  = bouquet.Id;
                orderbouquet.CustomerId = customer.Id;
                db.Customers.Add(customer);
                db.OrderBouquets.Add(orderbouquet);
                db.SaveChanges();
            }



            return(RedirectToAction("CustomerList", "Storage"));
        }
예제 #2
0
 public ActionResult BouquetDetails(BouquetView bouquetview) // display data of bouquets
 {
     return(View(bouquetview));
 }