static void InitManagers()
 {
     locMgr  = new LocationMgr(_iconfiguration);
     ordMgr  = new OrderMgr(_iconfiguration, locMgr);
     custMgr = new CustomerMgr(_iconfiguration, locMgr, ordMgr);
     ordMgr.SetCm(custMgr);
 }
Example #2
0
        /// <summary>
        /// 骑手-抢单(分页)
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult GetOrderNotShippedPager(PageParam page)
        {
            var             res    = OrderMgr.GetOrderNotShippedPager(page);
            LayUITableModel models = new LayUITableModel(res.Total, res.Rows);

            return(Json(models));
        }
Example #3
0
        /// <summary>
        /// 骑手-未完成订单(分页查询)
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult GetOrderUnfinishedPager(PageParam page)
        {
            int             RiderID = int.Parse(Session["RiderID"].ToString());
            var             res     = OrderMgr.GetOrderUnfinishedPager(page, RiderID);
            LayUITableModel models  = new LayUITableModel(res.Total, res.Rows);

            return(Json(models));
        }
Example #4
0
        public void GetOrder()
        {
            IOrderRepo   repo     = new TestOrderRepo();
            DateTime     date     = new DateTime(2000, 11, 11);
            OrderMgr     orderMgr = new OrderMgr(repo);
            List <Order> orders   = orderMgr.GetOrders(date);

            Assert.IsNotNull(orders);
        }
Example #5
0
        public void AddOrder()
        {
            IOrderRepo repo     = new TestOrderRepo();
            DateTime   date     = new DateTime(2000, 11, 11);
            OrderMgr   orderMgr = new OrderMgr(repo);

            Order        order  = new Order();
            List <Order> orders = orderMgr.GetOrders(date);

            orderMgr.AddOrder(order);
            Assert.AreEqual(order, orders.Last());
        }
Example #6
0
    public override void initService()
    {
        XmlConfig xml = ResMgr.getInstance().getRes("dbserver.xml");

        m_httpMonitor = xml.getString("httpMonitor", "");

        initState();

        m_orderMgr = new OrderMgr();
        m_orderMgr.init();

        m_threadWork = new Thread(new ThreadStart(run));
        m_threadWork.Start();
    }
Example #7
0
        public void Start()
        {
            Utility       ut           = new Utility();
            DateTime      dt           = ut.inputDate();
            int           orderNum     = ut.InputOrderNumber();
            OrderMgr      orderManager = Factory.GetOrderRepo();
            OrderResponse oResp        = orderManager.DeleteOrder(dt, orderNum);

            if (!oResp.Success)
            {
                Console.WriteLine(oResp.Message);
                Console.ReadKey();
            }
        }
Example #8
0
        public void Start()
        {
            DateTime date         = ut.inputDate();
            OrderMgr orderManager = Factory.GetOrderRepo();

            List <Order> orders = orderManager.GetOrders(date);


            foreach (Order items in orders)
            {
                Console.WriteLine("**************************************");
                Console.WriteLine(items);
            }
            Console.WriteLine("**************************************");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
            Console.Clear();
        }
Example #9
0
        /// <summary>
        /// 骑手-抢单
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderNotShipped()
        {
            List <TB_ORDER> lstOrder = OrderMgr.GetOrderNotShipped();

            return(Json(lstOrder));
        }
Example #10
0
 public void ClearOrder(int userID)
 {
     OrderMgr.ClearOrder(userID);
 }
Example #11
0
        public JsonResult SubmitOrder(int?orderID)
        {
            bool res = OrderMgr.SubmitOrder(orderID);

            return(Json(res));
        }
Example #12
0
        public JsonResult GetOrderInfoByUserID(int?orderID)
        {
            List <Orders> list = OrderMgr.GetOrderInfoByUserID(orderID);

            return(Json(list));
        }
Example #13
0
        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <returns></returns>
        public ActionResult SearchOrderID(int RiderID, string keyOrderID)
        {
            List <TB_ORDER> list = OrderMgr.SearchOrderID(RiderID, keyOrderID);

            return(Json(list));
        }
Example #14
0
        /// <summary>
        /// 根据订单ID抢单
        /// </summary>
        /// <param name="id"></param>
        public void GrabSingle(int id)
        {
            int RiderID = int.Parse(Session["RiderID"].ToString());

            OrderMgr.GrabSingle(id, RiderID);
        }
Example #15
0
 /// <summary>
 /// 根据订单ID修改订单状态
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public void ConfirmDelivery(int id)
 {
     OrderMgr.ConfirmDelivery(id);
 }
Example #16
0
        public JsonResult GetSellOrderList(SellOrderParam parameter)
        {
            Pager <SellOrderDomain> result = OrderMgr.GetSellOrderByPage(parameter);

            return(Json(result));
        }
Example #17
0
        public void Start()
        {
            OrderMgr orderManager = Factory.GetOrderRepo();

            Utility       ut       = new Utility();
            DateTime      dt       = ut.inputDate();
            int           orderNum = ut.InputOrderNumber();
            OrderResponse oResp    = orderManager.EditOrder(dt, orderNum);

            if (!oResp.Success)
            {
                Console.WriteLine(oResp.Message);
                Console.ReadKey();
                return;
            }

            Order edit = oResp.Order;

            Console.WriteLine("Edit customer name or hit Enter to continue...");
            string userInput = Console.ReadLine();
            string newName;

            if (userInput == "")
            {
                newName = edit.CustName;
            }
            else
            {
                newName = userInput;
            }

            Console.WriteLine("Edit order date or hit Enter to continue...");
            DateTime newDate;
            string   userDate = Console.ReadLine();

            if (userDate == "")
            {
                newDate = edit.Date;
            }
            else
            {
                while (!DateTime.TryParse(userDate, out newDate))
                {
                    Console.WriteLine("Incorrect format. Please input a date (MM/DD/YYYY):");
                    userDate = Console.ReadLine();
                }
            }

            Console.WriteLine("Edit State or hit Enter to continue...");
            userInput = Console.ReadLine();
            StateTax newState;
            TaxMgr   taxManager = Factory.GetTaxRepo();

            if (userInput == "")
            {
                newState = edit.STax;
            }
            else
            {
                while (userInput.Length != 2)
                {
                    Console.WriteLine("Please enter a 2-letter state abbreviation...");
                    userInput = Console.ReadLine();
                }
                TaxResponse taxResponse = taxManager.GetTaxes(userInput);
                if (!taxResponse.Success)
                {
                    orderManager.AddToError(taxResponse.Message);
                    Console.WriteLine(taxResponse.Message);
                    Console.ReadKey();
                    return;
                }
                newState = taxResponse.StateTax;
            }

            Console.WriteLine("Edit product or hit Enter to continue...");
            userInput = Console.ReadLine();
            Product    newProd;
            ProductMgr productManager = Factory.GetProdRepo();

            if (userInput == "")
            {
                newProd = edit.Product;
            }
            else
            {
                ProductResponse pResp = productManager.GetProduct(userInput);
                if (!pResp.Success)
                {
                    orderManager.AddToError(pResp.Message);
                    Console.WriteLine(pResp.Message);
                    Console.ReadKey();
                    return;
                }
                newProd = pResp.Product;
            }

            Console.WriteLine("Edit area or hit enter to continue...");
            userInput = Console.ReadLine();
            decimal newArea;

            if (userInput == "")
            {
                newArea = edit.Area;
            }
            else
            {
                while (!decimal.TryParse(userInput, out newArea) || newArea <= 0)
                {
                    Console.WriteLine("Invalid input.  Please re-try.");
                    userInput = Console.ReadLine();
                }
            }

            Order newOrder = new Order(
                newName,
                newProd,
                newState,
                newArea,
                newDate
                );

            newOrder.OrderNum = orderNum;
            orderManager.DeleteOrder(dt, orderNum);
            orderManager.AddOrder(newOrder);
        }
Example #18
0
        /// <summary>
        /// 骑手-未完成订单
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderUnfinished()
        {
            List <TB_ORDER> lstOrder = OrderMgr.GetOrderUnfinished();

            return(Json(lstOrder));
        }
Example #19
0
        /// <summary>
        /// 骑手-已完成订单(查询)
        /// </summary>
        /// <returns></returns>
        public ActionResult GetOrderCompleted()
        {
            List <TB_ORDER> lstOrder = OrderMgr.GetOrderCompleted();

            return(Json(lstOrder));
        }
Example #20
0
        public void Start()
        {
            OrderMgr orderManager = Factory.GetOrderRepo();

            //1. Customer Name
            Console.WriteLine("Please enter customer's name: ");
            string custName = Console.ReadLine();

            while (custName == "")
            {
                Console.WriteLine("Please input a name: ");
                custName = Console.ReadLine();
            }
            Utility  ut   = new Utility();
            DateTime date = ut.inputDate();

            //2. State info
            Console.WriteLine("Please enter state: ");
            string stateAbb = Console.ReadLine().ToUpper();

            while (stateAbb.Length != 2)
            {
                Console.WriteLine("Please input a 2 letter state abbreviation: ");
                stateAbb = Console.ReadLine().ToUpper();
            }

            // TaxResponse tResp = taxManager.GetTaxes(stateAbb);
            TaxMgr      Tmgr  = Factory.GetTaxRepo();
            TaxResponse tResp = Tmgr.GetTaxes(stateAbb);

            if (!tResp.Success)
            {
                orderManager.AddToError(tResp.Message);
                Console.WriteLine(tResp.Message);
                Console.ReadKey();
                return;
            }

            StateTax newTax = tResp.StateTax;

            //3. Product ordered:
            Console.WriteLine("Input the product ordered: ");
            string productType = Console.ReadLine();

            while (productType == "")
            {
                Console.WriteLine("Please input a product type: ");
                productType = Console.ReadLine();
            }

            ProductMgr      productManager = Factory.GetProdRepo();
            ProductResponse pResp          = productManager.GetProduct(productType);
            Product         newProd        = pResp.Product;

            if (!pResp.Success)
            {
                orderManager.AddToError(pResp.Message);
                Console.WriteLine(pResp.Message);
                Console.ReadKey();
                return;
            }


            //4. Area ordered:
            Console.WriteLine("Please input the area ordered: ");
            decimal area;
            string  userArea = Console.ReadLine();

            while (!decimal.TryParse(userArea, out area) || area <= 0)
            {
                Console.WriteLine("Invalid input. Please re-try. ");
                userArea = Console.ReadLine();
            }

            //Display the order
            Console.WriteLine("\nCustomer name: " + custName);
            Console.WriteLine("Date: " + date);
            Console.WriteLine("State: " + stateAbb);
            Console.WriteLine("Product: " + productType);
            Console.WriteLine("Area: " + userArea);
            Console.WriteLine("Tax: ");
            Console.WriteLine("Confirm to save the information (Y/N)?");
            string confirmation = Console.ReadLine().ToUpper();

            while (confirmation != "Y" && confirmation != "N")
            {
                Console.WriteLine("Invalid input. Please re-try: ");
                confirmation = Console.ReadLine();
            }
            if (confirmation == "Y")
            {
                Order newOrder = new Order(custName, newProd, newTax, area, date);
                orderManager.AddOrder(newOrder);
            }
        }