Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            config = bll.GetCompanyWebsiteConfig();

            toolBars = bllCompanyWebSite.GetToolBarList(int.MaxValue, 1, bllCompanyWebSite.WebsiteOwner, null, null, false)
                       .OrderBy(p => p.KeyType).Select(p => p.KeyType).Distinct().ToList();
            slides = bllSlide.GetCurrWebsiteAllTypeList();

            #region 会员标准字段
            List <TableFieldMapping> baseFieldList = bllTableFieldMap.GetTableFieldMap(null, "ZCJ_UserInfo");
            List <TableFieldMapping> webFieldList  = bllTableFieldMap.GetTableFieldMap(bllTableFieldMap.WebsiteOwner, "ZCJ_UserInfo", null, null, true);
            foreach (var item in baseFieldList)
            {
                if (fieldList.Exists(p => p.Value == item.Field))
                {
                    continue;
                }
                TableFieldMapping nWebFieldItem = webFieldList.FirstOrDefault(p => p.Field == item.Field);
                fieldList.Add(new ListItem
                {
                    Value    = item.Field,
                    Text     = nWebFieldItem == null ? item.MappingName : nWebFieldItem.MappingName,
                    Selected = nWebFieldItem != null && nWebFieldItem.IsDelete == 0 ? true:false
                });
            }
            List <string> baseFieldStringList = baseFieldList.Select(p => p.Field).ToList();
            foreach (var item in webFieldList.Where(p => !baseFieldStringList.Contains(p.Field)))
            {
                if (fieldList.Exists(p => p.Value == item.Field))
                {
                    continue;
                }
                fieldList.Add(new ListItem
                {
                    Value    = item.Field,
                    Text     = item.MappingName,
                    Selected = item.IsDelete == 0 ? true : false
                });
            }
            #endregion 会员标准字段

            currentWebsiteInfo = bll.GetWebsiteInfoModelFromDataBase();

            List <CompanyWebsite_ToolBar> dataList = bll.GetColList <CompanyWebsite_ToolBar>(int.MaxValue, 1, string.Format(" WebsiteOwner = '{0}'", bll.WebsiteOwner), "AutoID,KeyType,BaseID");
            ArticleGroups = dataList.OrderBy(p => p.KeyType).Select(p => p.KeyType).Distinct().ToList();

            if (!string.IsNullOrEmpty(config.LoginConfigJson))
            {
                JTokenLogin = JToken.Parse(config.LoginConfigJson);
            }
        }