Пример #1
0
        /// <summary>
        /// Eric Walton
        /// Created: 2017/03/10
        ///
        /// Invokes a method in the product order manager to create an order
        /// and get the order number for the created order from the database
        /// and then sets the order number on the window to the order number.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        private bool createOrder(ProductOrder order)
        {
            bool result = false;

            try
            {
                _orderNum           = _orderManager.createProductOrder(order);
                txtOrderNumber.Text = _orderNum.ToString();
                result = true;
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to initialize an order. " + e);
            }
            return(result);
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "ProductOrderId,CustomerId,EmployeeId,OrderTypeId,AddressType,Address1,City,State,Zip,DeliveryTypeId,Amount,OrderDate,DateExpected,Discount,OrderStatusId,HasArrived")] ProductOrder productOrder)
        {
            if (ModelState.IsValid)
            {
                if (ordMgr.createProductOrder(productOrder) != 0)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable));
                }
            }

            return(View(productOrder));
        }