Example #1
0
        public ActionResult Header()
        {
            List <ProductBrowsedHistoryModel> productBrowsedHistoryModels;
            bool currentUser = base.CurrentUser != null;

            base.ViewBag.isLogin        = (currentUser ? "true" : "false");
            base.ViewBag.MemberIntegral = (currentUser ? ServiceHelper.Create <IMemberIntegralService>().GetMemberIntegral(base.CurrentUser.Id).AvailableIntegrals : 0);
            List <FavoriteInfo> favoriteInfos = (currentUser ? ServiceHelper.Create <IProductService>().GetUserAllConcern(base.CurrentUser.Id) : new List <FavoriteInfo>());

            ViewBag.Concern = favoriteInfos.Take(10).ToList();
            List <UserCouponInfo> userCouponInfos = (currentUser ? ServiceHelper.Create <ICouponService>().GetAllUserCoupon(base.CurrentUser.Id).ToList() : new List <UserCouponInfo>());

            userCouponInfos = (userCouponInfos == null ? new List <UserCouponInfo>() : userCouponInfos);
            ViewBag.Coupons = userCouponInfos;
            List <ShopBonusReceiveInfo> shopBonusReceiveInfos = (currentUser ? ServiceHelper.Create <IShopBonusService>().GetCanUseDetailByUserId(base.CurrentUser.Id) : new List <ShopBonusReceiveInfo>());

            shopBonusReceiveInfos       = (shopBonusReceiveInfos == null ? new List <ShopBonusReceiveInfo>() : shopBonusReceiveInfos);
            ViewBag.ShopBonus           = shopBonusReceiveInfos;
            productBrowsedHistoryModels = (currentUser ? BrowseHistrory.GetBrowsingProducts(10, (base.CurrentUser == null ? 0 : base.CurrentUser.Id)) : new List <ProductBrowsedHistoryModel>());
            ViewBag.BrowsingProducts    = productBrowsedHistoryModels;
            ChemCloud.Service.SiteSettingService a = new ChemCloud.Service.SiteSettingService();
            ViewBag.MaterialsMallURL          = a.GetSiteValue("MaterialMallURL");
            ViewBag.DiscuzURL                 = a.GetSiteValue("BBSURL");
            ViewBag.isShowHaoCai              = a.GetSiteValue("isShowHaoCai");
            ViewBag.isShowHuiYiZhongXin       = a.GetSiteValue("isShowHuiYiZhongXin");
            ViewBag.isShowDaShujuZhongXin     = a.GetSiteValue("isShowDaShujuZhongXin");
            ViewBag.isShowJiShuJiaoYiZhongXin = a.GetSiteValue("isShowJiShuJiaoYiZhongXin");
            ViewBag.isShowRenCaiShiChang      = a.GetSiteValue("isShowRenCaiShiChang");
            ViewBag.isShowLunTan              = a.GetSiteValue("isShowLunTan");
            ViewBag.isShowFaLvFaGui           = a.GetSiteValue("isShowFaLvFaGui");
            InitHeaderData();
            ViewBag.HotKey = base.CurrentSiteSetting.Keyword;
            ViewBag.Keys   = base.CurrentSiteSetting.Hotkeywords.Split(',');
            return(base.PartialView("~/Areas/Web/Views/Shared/Header.cshtml"));
        }
Example #2
0
        public ActionResult Foot()
        {
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();
            IArticleService         articleService         = ServiceHelper.Create <IArticleService>();
            ArticleCategoryInfo     specialArticleCategory = articleCategoryService.GetSpecialArticleCategory(27);

            if (specialArticleCategory == null)
            {
                return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
            }
            IQueryable <ArticleCategoryInfo>   articleCategoriesByParentId = articleCategoryService.GetArticleCategoriesByParentId(specialArticleCategory.Id, false);
            IEnumerable <PageFootServiceModel> array =
                from item in articleCategoriesByParentId.ToArray()
                select new PageFootServiceModel()
            {
                CateogryName = item.Name,
                Articles     =
                    from t in articleService.GetArticleByArticleCategoryId(item.Id)
                    where t.IsRelease
                    select t
            };

            ChemCloud.Service.SiteSettingService a = new ChemCloud.Service.SiteSettingService();
            ViewBag.MaterialsMallURL          = a.GetSiteValue("MaterialMallURL");
            ViewBag.DiscuzURL                 = a.GetSiteValue("BBSURL");
            ViewBag.isShowHaoCai              = a.GetSiteValue("isShowHaoCai");
            ViewBag.isShowHuiYiZhongXin       = a.GetSiteValue("isShowHuiYiZhongXin");
            ViewBag.isShowDaShujuZhongXin     = a.GetSiteValue("isShowDaShujuZhongXin");
            ViewBag.isShowJiShuJiaoYiZhongXin = a.GetSiteValue("isShowJiShuJiaoYiZhongXin");
            ViewBag.isShowRenCaiShiChang      = a.GetSiteValue("isShowRenCaiShiChang");
            ViewBag.isShowLunTan              = a.GetSiteValue("isShowLunTan");
            ViewBag.isShowFaLvFaGui           = a.GetSiteValue("isShowFaLvFaGui");
            ViewBag.PlatCall        = a.GetSiteValue("PlatCall");
            ViewBag.PageFootService = array;
            ViewBag.PageFoot        = base.CurrentSiteSetting.PageFoot;
            ViewBag.QRCode          = base.CurrentSiteSetting.QRCode;
            ViewBag.SiteName        = base.CurrentSiteSetting.SiteName;
            return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
        }
Example #3
0
        public ActionResult Index()
        {
            string str;

            string[] strArrays;

            if (!IsInstalled())
            {
                return(RedirectToAction("Agreement", "Installer"));
            }

            ServiceHelper.Create <IMemberService>();
            ViewBag.OAuthValidateContents = GetOAuthValidateContents();
            ViewBag.SiteName = base.CurrentSiteSetting.SiteName;
            dynamic viewBag = base.ViewBag;

            strArrays           = (!string.IsNullOrWhiteSpace(base.CurrentSiteSetting.Hotkeywords) ? base.CurrentSiteSetting.Hotkeywords.Split(new char[] { ',' }) : new string[0]);
            viewBag.HotKeyWords = strArrays;
            str           = (string.IsNullOrWhiteSpace(base.CurrentSiteSetting.Site_SEOTitle) ? "ChemCloud" : base.CurrentSiteSetting.Site_SEOTitle);
            ViewBag.Title = str;
            ViewEngines.Engines.FindView(base.ControllerContext, "Index", null);
            ViewBag.handImage = ServiceHelper.Create <ISlideAdsService>().GetHandSlidAds().ToList();
            List <SlideAdInfo> list = ServiceHelper.Create <ISlideAdsService>().GetSlidAds(0, SlideAdInfo.SlideAdType.PlatformHome).ToList();

            ViewBag.slideImage = list;

            //banner列表(轮播图)
            Result_List <Result_BannersIndex> bannerList = ServiceHelper.Create <IBannersIndexService>().GetBannerList_IndexPage(1);

            ViewBag.Banners = bannerList;
            //交易动态
            Result_List <OrderSynthesis_Index> dynamicTrading = ServiceHelper.Create <IOrderSynthesisService>().GetTopNumOrderSynthesis(26);

            ViewBag.DynamicTrading = dynamicTrading;

            //最近动态报价
            Result_List <ProductInfoSpec> latestPrice = ServiceHelper.Create <IProductService>().Get_Products_Top(30);

            ViewBag.LatestPrice = latestPrice;

            //大家都在忙什么
            Result_List <Result_WhatBusy> whatBusy = ServiceHelper.Create <IWhatBusyService>().Get_WhatBusy_Top(26);

            ViewBag.WhatBusyList = whatBusy;


            //热销产品
            Result_List <OrderSynthesis_Index> HotSelling = ServiceHelper.Create <IOrderSynthesisService>().GetHotSelling();

            ViewBag.HotSelling = HotSelling;


            IEnumerable <ImageAdInfo> imageAds = ServiceHelper.Create <ISlideAdsService>().GetImageAds(0);

            ViewBag.imageAds = imageAds.Where((ImageAdInfo p) =>
            {
                if (p.Id <= 0)
                {
                    return(false);
                }
                return(p.Id <= 4);
            }).ToList();
            dynamic viewBag1 = base.ViewBag;
            IEnumerable <ImageAdInfo> imageAdInfos = ServiceHelper.Create <ISlideAdsService>().GetImageAds(0);

            ViewBag.imageAdsTop = imageAdInfos.Where((ImageAdInfo p) =>
            {
                if (p.Id == 14)
                {
                    return(true);
                }
                return(p.Id == 15);
            }).ToList();
            ChemCloud.Service.SiteSettingService a = new ChemCloud.Service.SiteSettingService();
            ViewBag.FirstAmount       = int.Parse(a.GetSiteValue("FirstAmount"));
            ViewBag.SecondAmount      = int.Parse(a.GetSiteValue("SecondAmount"));
            ViewBag.leijiFirstAmount  = int.Parse(a.GetSiteValue("leijiFirstAmount"));
            ViewBag.leijiSecondAmount = int.Parse(a.GetSiteValue("leijiSecondAmount"));
            DateTime Runtime = DateTime.Parse(a.GetSiteValue("Runtime"));
            DateTime Now     = DateTime.Now.Date;

            System.TimeSpan ts            = Now - Runtime;
            int             OperationDays = ts.Days + 1;

            if (OperationDays <= 0)
            {
                OperationDays = 1;
            }
            ViewBag.OperationDays   = OperationDays;
            ViewBag.Operationreport = a.GetSiteValue("Operationreport");
            if (string.IsNullOrEmpty(ViewBag.Operationreport))
            {
                ViewBag.Operationreport = "http://47.90.8.156:9100/album/yybg.pdf";
            }

            //List<ProductInfo> productInfo = ServiceHelper.Create<IProductService>().RecommendProductList().ToList<ProductInfo>();
            //ViewBag.Products = productInfo;

            List <RecommendInfo> model = ServiceHelper.Create <IRecommendInfoService>().GetRecommendByStatus();

            ViewBag.Products = model;
            int typeid = Convert.ToInt32(ServiceHelper.Create <ISiteSettingService>().GetSiteValue("RecommandIndexImg"));

            List <RecFloorImg> rfiList = ServiceHelper.Create <IRecFloorImgService>().GetAll(4);

            ViewBag.typeid  = typeid;
            ViewBag.rfiList = rfiList;
            List <ArticleInfo> articles = ServiceHelper.Create <IArticleService>().GetArticleByArticleCategoryId(21).ToList <ArticleInfo>();

            foreach (ArticleInfo item in articles)
            {
                item.Content = NoHTML(item.Content);
                if (item.Content.Length > 100)
                {
                    item.Content = item.Content.Substring(0, 100) + "..";
                }
            }
            ViewBag.news = articles;



            return(View());
        }