public List <Bulletin> GetOrderBulletin()
        {
            List <Bulletin>  list        = new List <Bulletin>();
            List <XMProject> projectList = null;

            var data = IoC.Resolve <IXMOrderInfoService>().getUnusualOrder();

            if (HozestERPContext.Current.User.CustomerID == 7 || HozestERPContext.Current.User.CustomerID == 84 || HozestERPContext.Current.User.CustomerID == 658 || HozestERPContext.Current.User.CustomerID == 682 || HozestERPContext.Current.User.CustomerID == 670)
            {
                projectList = IoC.Resolve <IXMProjectService>().GetXMProjectList();
            }
            else
            {
                projectList = IoC.Resolve <IXMProjectService>().GetXMProjectListSS(HozestERPContext.Current.User.CustomerID, 0);
            }

            foreach (var item in projectList)
            {
                int count = data.Where(a => a.ProjectId == item.Id).Count();
                if (count != 0)
                {
                    Bulletin bulletin = new Bulletin();
                    bulletin.BulletinTitle = item.ProjectName + "异常订单:" + count;
                    bulletin.BulletinID    = item.Id;
                    list.Add(bulletin);
                }
            }



            return(list);
        }
        public Bulletin GetOrderWarning()
        {
            var data = IoC.Resolve <IXMOrderInfoProductDetailsService>().GetWarningOrderList();

            Bulletin bulletin = new Bulletin();

            bulletin.BulletinTitle = "订单信息异常:" + data.Count;

            return(bulletin);
        }
        /// <summary>
        /// 新增公告信息
        /// </summary>
        /// <param name="Bulletin"></param>
        public Bulletin InsertBulletin(Bulletin bulletin)
        {
            if (bulletin == null)
            {
                throw new ArgumentNullException("bulletin");
            }

            _context.Bulletins.AddObject(bulletin);
            _context.SaveChanges();
            return(bulletin);
        }
 /// <summary>
 /// 更新公告信息
 /// </summary>
 /// <param name="Bulletin"></param>
 public void UpdateBulletin(Bulletin bulletin)
 {
     if (bulletin == null)
     {
         throw new ArgumentNullException("bulletin");
     }
     if (!_context.IsAttached(bulletin))
     {
         _context.Bulletins.Attach(bulletin);
     }
     _context.SaveChanges();
 }
        public List <Bulletin> GetProductMin()
        {
            List <Bulletin> list = new List <Bulletin>();

            var data = IoC.Resolve <IXMProductService>().getProductByMinPriceUnSet(-1);

            List <int?> countlist = data.GroupBy(a => a.BrandTypeId).Select(b => b.Key).ToList();

            foreach (var item in countlist)
            {
                Bulletin bulletin = new Bulletin();
                List <UnSetMinPriceProduct> productlist = data.Where(a => a.BrandTypeId == item).ToList();
                bulletin.BulletinTitle = productlist[0].BrandTypeCodeName + " 未设置最低售价商品:" + productlist.Count;
                bulletin.BulletinID    = (int)item;
                list.Add(bulletin);
            }
            return(list);
        }