/// <summary>
        /// 从 IDataReader 中恢复OrdersInfo对象
        /// </summary>
        /// <param name="IDataReader"></param>
        /// <returns></returns>
        public ProductOutBookMySqlInfo RecoverModel(IDataReader dataReader)
        {
            ProductOutBookMySqlInfo productOutBookInfo = new ProductOutBookMySqlInfo();

            productOutBookInfo.OutID       = dataReader["OutID"].ToInt();
            productOutBookInfo.UID         = dataReader["UID"].ToInt();
            productOutBookInfo.ProductID   = dataReader["ProductID"].ToInt();
            productOutBookInfo.ProductName = dataReader["ProductName"].ToString();
            return(productOutBookInfo);
        }
Esempio n. 2
0
        /// <summary>
        /// 商品到货
        /// </summary>
        public void ProductArrival()
        {
            int level1 = 0;
            int level2 = 0;

            GetLevel(SectionSecondType.到货提醒, ref level1, ref level2);
            bool isUse = IsUseToTime(level2);//是否属于8点以后发送的

            if (isUse)
            {
                IList <ProductOutBookMySqlInfo> productOutBookInfoList = null;
                try
                {
                    productOutBookInfoList = productStockMysqlBLL.ProductOutBookMySql_GetAll();
                    PushLog("product商品到货数据已获取,共" + productOutBookInfoList.Count + "条(未匹配推送表)!");
                }
                catch (Exception e)
                {
                    PushLog("product商品到货信息获取异常:" + e.Message);
                }
                if (productOutBookInfoList != null)
                {
                    for (int j = 0; j < productOutBookInfoList.Count; j++)
                    {
                        ProductOutBookMySqlInfo productInfo = productOutBookInfoList[j];
                        //验证是否已推送
                        bool state = mobilePushBLL.MobilePush_IsExist(productInfo.UID, level1, level2, productInfo.ProductID.ToString());
                        if (state)//已推送
                        {
                            continue;
                        }
                        else//if(state==false)
                        {
                            try
                            {
                                PushMessageInfo pushMessageInfo = new PushMessageInfo();
                                pushMessageInfo.ChannelID  = 0;
                                pushMessageInfo.Contents   = GetContentsByLevel2(level2, productInfo.ProductName.ToString(), null);
                                pushMessageInfo.CreateTime = DateTime.Now;
                                pushMessageInfo.DataID     = productInfo.ProductID.ToString();
                                pushMessageInfo.TypeID     = level1;
                                pushMessageInfo.Section    = level2;
                                pushMessageInfo.PushType   = "single";
                                pushMessageInfo.Status     = 0;
                                pushMessageInfo.TargetList = productInfo.UID.ToString();
                                pushMessageInfo.Creator    = "后台推送程序";
                                pushMessageInfo.PushCount  = 0;
                                pushMessageInfo.Template   = 1;
                                pushMessageInfo.Updater    = "后台推送程序";
                                pushMessageInfo.UpdateTime = DateTime.Now;

                                //修改mysql中的推送状态
                                productStockMysqlBLL.ProductOutBookMySql_UpIsPush(productInfo.OutID, 1);

                                //写入推送表
                                mobilePushBLL.InsertMobilePush(pushMessageInfo);
                            }
                            catch (Exception e)
                            {
                                PushLog("ProductOutBook商品到货数据写入异常:" + e.Message);
                            }
                        }
                    }
                }
            }
        }