Ejemplo n.º 1
0
        private void Initialize()
        {
            _orderInfoManager = OrderInfoManager.Instance;
            if (!_orderInfoManager.Initialized)
            {
                _orderInfoManager.Initialize();
            }

            _orderInfoManager.GetAll(out _orderInfos);

            Debug.WriteLine("?");
            int startIdx = _currentPage * _maxShow;

            Debug.WriteLine("startIdx : " + startIdx);
            Debug.WriteLine("_orderInfos.Count : " + _orderInfos.Count);
            if (startIdx < _orderInfos.Count)
            {
                Debug.WriteLine("startIdx : " + startIdx);
                Debug.WriteLine("_orderInfos.Count : " + _orderInfos.Count);
                if (startIdx + _maxShow > _orderInfos.Count)
                {
                    Debug.WriteLine("AAAAAA");
                    _orderInfoList = _orderInfos.GetRange(startIdx, _orderInfos.Count - startIdx);
                }
                else
                {
                    Debug.WriteLine("BBBBB");
                    _orderInfoList = _orderInfos.GetRange(startIdx, _maxShow);
                }
                TestList.ItemsSource = _orderInfoList;
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> GetCount()
        {
            IDictionary <string, int> dic = new Dictionary <string, int>();

            IStatisticsManager manager = new StatisticsManager();

            IUserManager manager2 = new UserManager(new UserService());

            IOrderInfoManager manager3 = new OrderInfoManager(new OrderInfoService());

            var count = await manager.GetProductCount();

            var count2 = await manager2.GetAllUser().CountAsync();

            var dateTime = DateTime.Now;

            var count3 = await manager3.QueryAllOrder(false).CountAsync();

            var count4 = manager3.QueryAllOrder(false)
                         .Where(m => m.CreateTime.Month == dateTime.Month)
                         .Sum(m => m.TotalPrice);

            dic.Add("UserCount", count2);
            dic.Add("ProductCount", count);
            dic.Add("OrderCount", count3);
            dic.Add("BusinessMoney", Convert.ToInt32(count4));

            return(Json(dic));
        }
Ejemplo n.º 3
0
        public WelcomePage()
        {
            InitializeComponent();

            OrderInfoManager OIManager = OrderInfoManager.Instance;

            if (!OIManager.Initialized)
            {
                OIManager.Initialize();
            }

            OrderInfo oi  = new OrderInfo("테스트", "010-1111-2222");
            OrderInfo oi2 = new OrderInfo("테스트2", "01011123334");

            Debug.WriteLine(oi.ToString());
            Debug.WriteLine(oi2.ToString());
        }
Ejemplo n.º 4
0
        public async Task <JsonResult> UpdateOrderInfo(OrderInfoDto model)
        {
            IOrderInfoManager manager = new OrderInfoManager(new OrderInfoService());
            var result = await manager.UpdateOrder(model);

            if (result == 1)
            {
                _msg = new MsgResult()
                {
                    IsSuccess = true,
                    Info      = "修改成功"
                };
            }
            else
            {
                _msg = new MsgResult()
                {
                    IsSuccess = false,
                    Info      = "修改失败"
                };
            }
            return(Json(_msg));
        }
Ejemplo n.º 5
0
 public TradeDataManager()
 {
     AccountMgr   = new AccountManager();
     OrderInfoMgr = new OrderInfoManager();
 }