/// <summary>
 /// Create a new CateringOrder object.
 /// </summary>
 /// <param name="orderID">Initial value of the OrderID property.</param>
 public static CateringOrder CreateCateringOrder(global::System.Int64 orderID)
 {
     CateringOrder cateringOrder = new CateringOrder();
     cateringOrder.OrderID = orderID;
     return cateringOrder;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CateringOrders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCateringOrders(CateringOrder cateringOrder)
 {
     base.AddObject("CateringOrders", cateringOrder);
 }
        public ActionResult Order(CateringOrder order, string PckId)
        {
            if (ModelState.IsValid)
            {
                if(!string.IsNullOrEmpty(PckId))
                    order.PackageID = Convert.ToInt32(PckId);

                aspnet_Membership obMem = db.aspnet_Membership.SingleOrDefault(am => am.Email == User.Identity.Name);
                User_Profile userPro = db.User_Profile.SingleOrDefault(up => up.aspnet_userid == obMem.UserId);
                order.UserID = userPro.UserID;
                order.IsDeleted = false;
                order.OrderDate = DateTime.Now;
                db.CateringOrders.AddObject(order);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(order);
        }