Beispiel #1
0
        /// <summary>
        /// 站点管理页面  GET: /PersonManage/SiteManageView
        /// </summary>
        /// <returns></returns>
        public ActionResult SiteManageView()
        {
            PublicUserModel loginUser = this.GetLoginUser();//当前用户

            SiteManageBll          siteManageBll  = new SiteManageBll();
            List <SiteManageModel> siteManageList = siteManageBll.GetSiteList(cityId: loginUser.CityID);//所有站点

            UserSiteManageBll          userSiteManageBll  = new UserSiteManageBll();
            List <UserSiteManageModel> userSiteManageList = userSiteManageBll.GetUserSiteListByUserId(loginUser.UserID);//用户关联的站点

            List <SiteManageViewModel> viewList = (from site in siteManageList
                                                   join userSite in userSiteManageList on site.SiteID equals userSite.SiteID into viewListTemp
                                                   from viewItem in viewListTemp.DefaultIfEmpty()
                                                   select new SiteManageViewModel()
            {
                CityID = site.CityID,
                Logo = site.Logo,
                SiteID = site.SiteID,
                SiteName = site.SiteName,
                Status = site.Status,
                SiteStatus = viewItem == null?1:viewItem.SiteStatus,
                SiteUserID = viewItem == null?0:viewItem.SiteUserID,
                SiteUserName = viewItem == null?"":viewItem.SiteUserName,
                UserID = viewItem == null?0:viewItem.UserID,
                YunRefresh = site.YunRefresh,
                LoginUrl = site.LoginUrl,
                RegisterUrl = site.RegisterUrl
            }).ToList();


            return(View(viewList));
        }
Beispiel #2
0
        public ApiResponse SiteManage(int cityId = 592)
        {
            int                    userId         = GetCurrentUserId();
            SiteManageBll          siteManageBll  = new SiteManageBll();
            List <SiteManageModel> siteManageList = siteManageBll.GetSiteList(cityId: cityId);//所有站点

            UserSiteManageBll          userSiteManageBll  = new UserSiteManageBll();
            List <UserSiteManageModel> userSiteManageList = userSiteManageBll.GetUserSiteListByUserId(userId);//用户关联的站点

            var viewList = (from site in siteManageList
                            join userSite in userSiteManageList on site.SiteID equals userSite.SiteID into viewListTemp
                            from viewItem in viewListTemp.DefaultIfEmpty()
                            select new
            {
                CityID = site.CityID,
                Logo = "http://" + HttpContext.Current.Request.Url.Host + "/" + site.Logo,
                SiteID = site.SiteID,
                SiteName = site.SiteName,
                Status = site.Status,
                SiteStatus = viewItem == null ? 1 : viewItem.SiteStatus,
                SiteUserID = viewItem == null ? 0 : viewItem.SiteUserID,
                SiteUserName = viewItem == null ? "" : viewItem.SiteUserName,
                UserID = viewItem == null ? 0 : viewItem.UserID,
                YunRefresh = site.YunRefresh,
                RegisterUrl = site.RegisterUrl
            }).ToList();

            return(new ApiResponse(Metas.SUCCESS, viewList));
        }
Beispiel #3
0
        public JsonResult GetEnableWebSite(int buildType = 0)
        {
            PublicUserModel loginUser = this.GetLoginUser();//当前用户

            SiteManageBll          siteManageBll  = new SiteManageBll();
            List <SiteManageModel> siteManageList = siteManageBll.GetSiteList(buildType.ToString(), loginUser.CityID);//所有站点



            List <SiteManageViewModel> viewList = (from site in siteManageList

                                                   select new SiteManageViewModel()
            {
                SiteID = site.SiteID,
                Logo = site.Logo,
                SiteName = site.SiteName,
            }).ToList();

            return(Json(viewList));
        }