Esempio n. 1
0
        public ActionResult CreateOrder(
            [Bind(Include = "UniqueID, DateCreated, SalesChannel, TermsAndConditions")]
            OrderEditModel k)
        {
            if (!ModelState.IsValid)
            {
                return(View("EditOrder", k));
            }
            var order = new Order();

            k.Update(order);
            Orders.Instance.Add(order);
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult EditOrder(
            [Bind(Include = "UniqueID, DateCreated, SalesChannel, TermsAndConditions")] OrderEditModel e)
        {
            if (!ModelState.IsValid)
            {
                return(View("EditOrder", e));
            }
            var order = Orders.Instance.Find(x => x.IsThisUniqueId(e.UniqueId));

            if (order == null)
            {
                return(HttpNotFound());
            }
            e.Update(order);
            return(RedirectToAction("Index"));
        }