Esempio n. 1
0
        //FrmMain2业务逻辑//
        #region 保存数据
        public void SaveOrder_count(int dataType, string pcColor, string LicensePlateNo, DateTime dateTime, string RoadRateNo)
        {
            OrderCountModel mode             = new OrderCountModel();
            string          LicensePlateType = "1";

            switch (pcColor)
            {
            case "蓝色":
                LicensePlateType = "1";
                break;

            case "黄色":
                LicensePlateType = "2";
                break;

            case "黑色":
                LicensePlateType = "3";
                break;

            case "白绿色":
                LicensePlateType = "4";
                break;

            case "黄绿色":
                LicensePlateType = "5";
                break;

            case "绿色":
                LicensePlateType = "6";
                break;

            case "白色":
                LicensePlateType = "7";
                break;

            default:
                LicensePlateType = "8";    //8是不在识别的颜色中
                break;
            }


            mode.LicensePlateType = Convert.ToInt32(LicensePlateType);
            mode.LicensePlateNo   = LicensePlateNo;
            if (dataType == 1)
            {
                mode.EntranceNo = RoadRateNo;
                mode.InDate     = dateTime;
            }
            else
            {
                mode.RoadRateNo = RoadRateNo;
                mode.OutDate    = dateTime;
            }

            //int Result =
            PDAL.SaveOrder_Count(dataType, mode);
            //return Result;
        }
Esempio n. 2
0
        public IActionResult GetOrderCount()
        {
            var orderRsp = _unitOfWork.GetRepository <Order>();
            var result   = new OrderCountModel()
            {
                TotalCount     = orderRsp.Count(),
                CompleteCount  = orderRsp.Count(i => i.OrderState == 3),
                NoConfirmCount = orderRsp.Count(i => i.OrderState == 1),
                ReceiveCount   = orderRsp.Count(i => i.OrderState == 2)
            };

            return(Json(result));
        }
Esempio n. 3
0
        public static OrderCountModel GetCurrOrderCount()
        {
            ICriteria       icr        = CreateCriteria <OrderModel>();
            OrderCountModel orderCount = new OrderCountModel();

            orderCount.id       = "system";
            orderCount.allCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_CANCEL));
            orderCount.cancelCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_COMMENTED));
            orderCount.commentedCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_DEAL));
            orderCount.dealCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_ELONG_SUCCESS));
            orderCount.elongSuccessCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_FAIL));
            orderCount.failCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_NEW));
            orderCount.newCount = Count(icr, "id");

            icr = CreateCriteria <OrderModel>();
            icr.Add(Restrictions.Eq("orderStatus", OrderModel.ORDER_STATUS_ZD_SUCCESS));
            orderCount.zdSuccessCount = Count(icr, "id");

            return(orderCount);
        }
Esempio n. 4
0
        public OrderCountModel GetOrderSaleInfo()
        {
            OrderCountModel omodel = new OrderCountModel();

            omodel.ProName = "订单";
            StringBuilder sqlstr = new StringBuilder();

            sqlstr.AppendFormat("select Number,Stuts,CreateTime from Fx_Orders where UserId = '{0}'", ManageProvider.Provider.Current().UserId);
            sqlstr.AppendFormat(" and CreateTime > '{0}'", DateTime.Now.AddDays(-29).ToString("yyyy-MM-dd HH:mm:ss"));
            IDatabase database = DataFactory.Database();
            var       list     = database.FindListBySql <Fx_Orders>(sqlstr.ToString());
            var       datelist = new List <string>();
            var       prolist  = new List <int>();

            for (int i = 29; i >= 0; i--)
            {
                datelist.Add(DateTime.Now.AddDays(-i).ToString("MM.dd"));
                prolist.Add(list.Where(o => (o.CreateTime > Convert.ToDateTime(DateTime.Now.AddDays(-i).ToString("yyyy-MM-dd") + " 00:00:00") &&
                                             o.CreateTime < Convert.ToDateTime(DateTime.Now.AddDays(-i + 1).ToString("yyyy-MM-dd") + " 00:00:00"))).ToList().Count);
            }
            omodel.CurrDate = datelist.ToArray <string>();
            omodel.ProNum   = prolist.ToArray <int>();
            return(omodel);
        }