Ejemplo n.º 1
0
        /// <summary>
        /// 自动下载订单
        /// </summary>
        /// <returns></returns>
        public string DownSortingOrder()
        {
            string tag = "true";

            using (PersistentManager dbpm = new PersistentManager())
            {
                DownSortingOrderDao dao = new DownSortingOrderDao();
                dao.SetPersistentManager(dbpm);
                try
                {
                    DataTable orderdt   = this.GetOrderId();
                    string    orderlist = UtinString.StringMake(orderdt, "ORDER_ID");
                    orderlist = UtinString.StringMake(orderlist);
                    orderlist = "ORDER_ID NOT IN(" + orderlist + ")";

                    DataTable masterdt = this.GetSortingOrder(orderlist);
                    DataTable detaildt = this.GetSortingOrderDetail(orderlist);
                    if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0)
                    {
                        DataSet masterds = this.SaveSortingOrder(masterdt);
                        DataSet detailds = this.SaveSortingOrderDetail(detaildt);
                        this.Insert(masterds, detailds);
                    }
                    else
                    {
                        return("没有可用的数据下载!");
                    }
                }
                catch (Exception e)
                {
                    tag = e.Message;
                }
            }
            return(tag);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 手动下载
        /// </summary>
        /// <param name="billno"></param>
        /// <returns></returns>
        public string GetSortingOrderById(string orderid)
        {
            string tag = "true";

            using (PersistentManager dbPm = new PersistentManager())
            {
                DownSortingOrderDao dao = new DownSortingOrderDao();
                dao.SetPersistentManager(dbPm);
                try
                {
                    orderid = "ORDER_ID IN (" + orderid + ")";
                    DataTable masterdt = this.GetSortingOrder(orderid);
                    DataTable detaildt = this.GetSortingOrderDetail(orderid);
                    if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0)
                    {
                        DataSet masterds = this.SaveSortingOrder(masterdt);
                        DataSet detailds = this.SaveSortingOrderDetail(detaildt);
                        this.Insert(masterds, detailds);
                    }
                    else
                    {
                        return("没有数据可下载!");
                    }
                }
                catch (Exception e)
                {
                    tag = e.Message;
                }
            }
            return(tag);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 根据用户选择的订单下载分拣线订单明细表 创联
 /// </summary>
 /// <returns></returns>
 public DataTable GetSortingOrderDetails(string orderid)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(dbpm);
         return(dao.GetSortingOrderDetails(orderid));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 查询4天之内的分拣订单
 /// </summary>
 /// <returns></returns>
 public DataTable GetOrderId()
 {
     using (PersistentManager dbpm = new PersistentManager())
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(dbpm);
         return(dao.GetOrderId());
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 查询营销系统分拣明细表数据
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="inBillNo"></param>
 /// <returns></returns>
 public DataTable GetSortingOrderDetail(int pageIndex, int pageSize, string inBillNo)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(dbpm);
         inBillNo = "ORDER_ID = '" + inBillNo + "'";
         return(dao.GetSortingOrderDetail(inBillNo));
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 查询营销系统分拣订单主表数据进行下载
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <returns></returns>
 public DataTable GetSortingOrder(int pageIndex, int pageSize)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(dbpm);
         DataTable orderdt   = this.GetOrderId();
         string    orderlist = UtinString.StringMake(orderdt, "ORDER_ID");
         orderlist = UtinString.StringMake(orderlist);
         orderlist = "ORDER_ID NOT IN(" + orderlist + ")";
         return(dao.GetSortingOrder(orderlist));
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 把下载的数据添加到数据库。
 /// </summary>
 /// <param name="masterds"></param>
 /// <param name="detailds"></param>
 public void Insert(DataSet masterds, DataSet detailds)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(pm);
         if (masterds.Tables["DWV_OUT_ORDER"].Rows.Count > 0)
         {
             dao.InsertSortingOrder(masterds);
         }
         if (detailds.Tables["DWV_OUT_ORDER_DETAIL"].Rows.Count > 0)
         {
             dao.InsertSortingOrderDetail(detailds);
         }
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 根据时间查询营销系统分拣订单主表数据进行下载
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <returns></returns>
 public DataTable GetSortingOrder(int pageIndex, int pageSize, string startDate, string endDate)
 {
     using (PersistentManager dbpm = new PersistentManager("YXConnection"))
     {
         DownSortingOrderDao dao = new DownSortingOrderDao();
         dao.SetPersistentManager(dbpm);
         DataTable orderdt   = this.GetOrderId();
         string    orderlist = UtinString.StringMake(orderdt, "ORDER_ID");
         orderlist = UtinString.StringMake(orderlist);
         //orderlist = "ORDER_DATE>='" + startDate + "' AND ORDER_DATE<='" + endDate + "' AND ORDER_ID NOT IN(" + orderlist + ")";
         orderlist = "ORDER_ID NOT IN(" + orderlist + ")";
         DataTable masert  = dao.GetSortingOrder("ORDER_ID NOT IN('')");
         DataRow[] orderdr = masert.Select(orderlist);
         return(this.SaveSortingOrder(orderdr).Tables[0]);
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 选择日期从营销系统下载分拣信息
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public string GetSortingOrderDate(string startDate, string endDate)
        {
            string tag = "true";

            using (PersistentManager dbpm = new PersistentManager())
            {
                DownSortingOrderDao dao = new DownSortingOrderDao();
                dao.SetPersistentManager(dbpm);
                try
                {
                    //查询仓库7天内的订单号
                    DataTable orderdt   = this.GetOrderId();
                    string    orderlist = UtinString.StringMake(orderdt, "ORDER_ID");
                    orderlist = UtinString.StringMake(orderlist);
                    string    orderlistDate = "ORDER_DATE>='" + startDate + "' AND ORDER_DATE<='" + endDate + "' AND ORDER_ID NOT IN(" + orderlist + ")";
                    DataTable masterdt      = this.GetSortingOrder(orderlistDate);        //根据时间查询订单信息

                    string ordermasterlist = UtinString.StringMake(masterdt, "ORDER_ID"); //取得根据时间查询的订单号
                    string ordermasterid   = UtinString.StringMake(ordermasterlist);
                    ordermasterid = "ORDER_ID IN (" + ordermasterid + ")";
                    DataTable detaildt = this.GetSortingOrderDetail(ordermasterid);//根据订单号查询明细
                    if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0)
                    {
                        DataSet masterds = this.SaveSortingOrder(masterdt);
                        DataSet detailds = this.SaveSortingOrderDetail(detaildt);
                        this.Insert(masterds, detailds);
                    }
                    else
                    {
                        return("没有可用的数据下载!");
                    }
                }
                catch (Exception e)
                {
                    tag = e.Message;
                }
            }
            return(tag);
        }