コード例 #1
0
        /// <summary>
        /// 绑定下拉框
        /// </summary>
        /// <param name="where">绑定的数据源的查询条件</param>
        /// <param name="options">下拉框</param>
        /// <param name="leveStr">层级的前缀</param>
        /// <param name="nextStr">层级的前缀的前缀</param>
        public string GetChannelList(SqlWhereList where, string option, string leveStr, string nextStr)
        {
            options += option;
            List <Channel> list = channelBLL.GetAll(where);

            foreach (Channel ch in list)
            {
                string txt = ch.ChannelName;
                if (leveStr.Length != 1)
                {
                    txt = leveStr + ch.ChannelName.ToString();
                }
                options += " <option value='" + ch.ChannelId + "'>" + txt + "</option>";
                SqlWhereList sqllist = new SqlWhereList();
                sqllist.Add("ParentID", ch.ChannelId);
                sqllist.Add("TypeId", 2);
                List <Channel> channelList = channelBLL.GetAll(sqllist);
                if (channelList.Count != 0)
                {
                    string nextLevelStr = leveStr.Insert(0, nextStr);
                    GetChannelList(sqllist, option, nextLevelStr, nextStr);
                }
            }
            return(options);
        }
コード例 #2
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        public string GetChannelNodeNews(int typeID)
        {
            string dropdownStr = "";

            SqlWhereList where = new SqlWhereList();
            where.Add("ParentID", "001");
            where.Add("TypeId", typeID);
            List <Channel> list = channelBLL.GetAll(where);
            int            i    = 0;

            foreach (Channel ch in list)
            {
                string ChannelId = ch.ChannelId;
                string txt       = ch.ChannelName;
                if (i == list.Count - 1)
                {
                    dropdownStr += " {k:\"" + ChannelId + "\",v:\"" + txt + "\"}";
                }
                else
                {
                    dropdownStr += " {k:\"" + ChannelId + "\",v:\"" + txt + "\"}|";
                }
                i++;
            }
            return(dropdownStr);
        }
コード例 #3
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        private void GetTreeEx(SqlWhereList where, JsTreeNode root)
        {
            List <Channel> list = channelBLL.GetAll(where);
            JsTreeNode     node = null;

            root.children = new List <JsTreeNode>();
            foreach (Channel item in list)
            {
                node            = new JsTreeNode();
                node.id         = item.ChannelId;
                node.text       = item.ChannelName;
                node.attributes = new JsTreeNodeCustAttr(node.id);
                SqlWhereList wherelist = new SqlWhereList();
                wherelist.Add("ParentID", node.id);
                if (item.TypeId == 1)
                {
                    wherelist.Add("TypeId", 1);
                }
                else if (item.TypeId == 2)
                {
                    wherelist.Add("TypeId", 2);
                }
                GetTreeEx(wherelist, node);
                root.children.Add(node);
            }
        }
コード例 #4
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        private string GetChildInit(SqlWhereList where, Channel chNode, string option, string leveStr, string nextStr)
        {
            dropdownStr += option;
            List <Channel> list = channelBLL.GetAll(where);

            foreach (Channel ch in list)
            {
                string txt = ch.ChannelName;
                if (leveStr.Length != 1)
                {
                    txt = leveStr + ch.ChannelName.ToString();
                }
                dropdownStr += " <option value='" + ch.ChannelId + "'>" + txt + "</option>";
                SqlWhereList sqllist = new SqlWhereList();
                sqllist.Add("ParentID", ch.ChannelId);
                if (ch.TypeId == 1)
                {
                    sqllist.Add("TypeId", 1);
                }
                else if (ch.TypeId == 2)
                {
                    sqllist.Add("TypeId", 2);
                }
                List <Channel> channelList = channelBLL.GetAll(sqllist);
                if (channelList.Count != 0)
                {
                    string nextLevelStr = leveStr.Insert(0, nextStr);
                    GetChildInit(sqllist, ch, option, nextLevelStr, nextStr);
                }
            }
            return(dropdownStr);
        }
コード例 #5
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        public string LoaddrpData(string channelID, int TypeId)
        {
            ChannelPageModel channelPageModel = new ChannelPageModel();

            SqlWhereList where = new SqlWhereList();
            where.Add("ParentID", "0");
            where.Add("TypeId", TypeId);
            return(channelPageModel.strAll = GetChild(where, channelID, channelPageModel.Channel, "", "|", "--"));
        }
コード例 #6
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        public string GetChannelNodeSelected(int typeID, string ChannelId)
        {
            ChannelPageModel channelPageModel = new ChannelPageModel();

            SqlWhereList where = new SqlWhereList();
            where.Add("ParentID", "0");
            where.Add("TypeId", typeID);
            //return channelPageModel.strAll = GetChildInit(where,"", "|", "--");
            return(channelPageModel.strAll = GetChildInitSelected(where, channelPageModel.Channel, "", "|", "--", ChannelId));
        }
コード例 #7
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        public object GetChannelNodes(int TypeId)
        {
            JsTreeNode root = new JsTreeNode();

            SqlWhereList where = new SqlWhereList();
            where.Add("ParentID", "0");
            where.Add("TypeId", TypeId);
            GetTreeEx(where, root);
            return(new JsonResult(root.children));
        }
コード例 #8
0
        public object GetMenueList(int TypeId)
        {
            FragmentPageModel model    = new FragmentPageModel();
            SqlWhereList      sqlwhere = new SqlWhereList();

            sqlwhere.Add("ParentID", "0");
            sqlwhere.Add("TypeId", 2);
            model.strhtml = GetChannelList(sqlwhere, "", "|", "--");
            model.TypeId  = TypeId;
            return(new PageResult(null, model));
        }
コード例 #9
0
        public string DelOneModule(int moduleid)
        {
            where.Add("ParentId", moduleid);
            int result = MenuModuleBLL.GetAll(where).Count;

            if (result != 0)
            {
                return("000000");  //子记录不能为空,不能删除
            }
            MenuModule.ModuleId = moduleid;
            return(MenuModuleBLL.Delete(MenuModule).ToString());
        }
コード例 #10
0
ファイル: HtmlEngine.cs プロジェクト: luozhiyong520/CMS
        /// <summary>
        /// 生成和channelId有关的模板页面
        /// </summary>
        /// <param name="channelId"></param>
        /// <returns></returns>
        public bool CreateTemplatePageByChannelId(string channelId, Dictionary <string, string> paramDic = null)
        {
            SqlWhereList condition = new SqlWhereList();

            condition.Add("ChannelId", channelId);
            condition.Add("RelationType", 1);//涉及
            List <TemplateDetail> detailList = templateDetailBLL.GetAll(condition);

            foreach (TemplateDetail detail in detailList)
            {
                CreateTemplatePage(detail.TemplateId.Value, paramDic);
            }
            return(true);
        }
コード例 #11
0
        public object GetzTreeData(int templateId, int templeteType)
        {
            zTreeNode root = new zTreeNode();

            root.name          = "栏目列表";
            root.open          = true;
            root.templateId    = templateId;
            SqlWhereList where = new SqlWhereList();
            where.Add("ParentID", "0");
            if (templeteType == 2)
            {
                where.Add("TypeId", 1);
            }
            GetzTree(where, root, templateId, templeteType);
            return(new JsonResult(root.children));
        }
コード例 #12
0
        /// <summary>
        /// 如果栏目被对应的列表页模板所涉及,返回对应的模板ID
        /// </summary>
        /// <param name="ChanelId"></param>
        /// <returns></returns>
        public List <int> GetTemplateIdListByChanel(string ChannelId)
        {
            List <int>        templateIdList    = new List <int>();
            TemplateDetailDAL templateDetailDAL = new TemplateDetailDAL();
            SqlWhereList      conditon          = new SqlWhereList();

            conditon.Add("ChannelId", ChannelId);
            conditon.Add("RelationType", 1);
            List <TemplateDetail> list = templateDetailDAL.GetAll(conditon);

            foreach (TemplateDetail item in list)
            {
                templateIdList.Add(item.TemplateId.Value);
            }
            return(templateIdList);
        }
コード例 #13
0
        /// <summary>
        /// 根据单个权限获取功能列表
        /// </summary>
        /// <param name="permissionId"></param>
        /// <returns></returns>
        public List <PermissionFunction> GetFunctionByPermissionId(int permissionId)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();
            SqlWhereList sql = new SqlWhereList();

            sql.Add("PermissionId", permissionId.ToString());
            return(dal.GetAll(sql));
        }
コード例 #14
0
        public virtual List <QuestionnairesOptions> GetQuestionnairesOptionsList(int QId)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

            sqlwhere.Add("QId", QId);
            List <QuestionnairesOptions> list = dal.GetAll(sqlwhere);

            return(list);
        }
コード例 #15
0
        public virtual List <Questionnaires> GetQuestionnairesListNoCache(int parentId)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

            sqlwhere.Add("ParentId", parentId);
            List <Questionnaires> list = dal.GetAll(sqlwhere);

            return(list);
        }
コード例 #16
0
        public string GetAuthoritydotLook()
        {
            string       shtml = "";
            SqlWhereList str   = new SqlWhereList();

            str.Add("ParentId", 1);
            str.Add("Status", 1);
            List <AuthorityDot> list = AuthorityBLL.GetAll(str);

            if (list != null)
            {
                foreach (AuthorityDot item in list)
                {
                    shtml += "<option value=\"" + item.RelevanceId + "\">" + item.Text + "</option>";
                }
            }
            return(shtml);
        }
コード例 #17
0
        public JsonResult GetOptions(int qId)
        {
            SqlWhereList sql = new SqlWhereList();

            sql.Add("QId", qId);
            List <QuestionnairesOptions> objs = questionnaireOptionBLL.GetAll(sql);

            return(new JsonResult(objs));
        }
コード例 #18
0
        public object GetAdminList()
        {
            SqlWhereList swl = new SqlWhereList();

            swl.Add("GroupId", 10);
            //swl.Add("GroupId", 4);
            model.AdministratorList = adminBLL.GetAll(swl);
            return(new PageResult(null, model));
        }
コード例 #19
0
 public object GetMenueList()
 {
     where.Add("ParentID", 0);
     model.AdminMenuList = menuBLL.GetAll(where);
     if (model.AdminMenuList != null)
     {
         foreach (AdminMenuModule m in model.AdminMenuList)
         {
             SqlWhereList wheretwo = new SqlWhereList();
             wheretwo.Add("ParentID", m.ModuleId);
             if (!model.Dic.ContainsKey(m.ModuleId))
             {
                 model.Dic[m.ModuleId] = menuBLL.GetAll(wheretwo);
             }
         }
     }
     return(new PageResult(null, model));
 }
コード例 #20
0
        public JsonResult ShowAjaxAuthorityDotById(int Id)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

            sqlwhere.Add("ParentId", Id);
            List <AuthorityDot> list = AuthorityBLL.GetAll(sqlwhere);
            JsonResult          json = new JsonResult(list);

            return(json);
        }
コード例 #21
0
        public JsonResult ShwowAuthorityDotAdmin(int adminId)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

            sqlwhere.Add("AdminId", adminId);
            List <AuthorityDotAdmin> list = authorityDotAdminBLL.GetAll(sqlwhere);
            JsonResult json = new JsonResult(list);

            return(json);
        }
コード例 #22
0
        private void GetzTree(SqlWhereList where, zTreeNode root, int templateId, int templeteType)
        {
            List <Channel> list = channelBLL.GetAll(where);
            zTreeNode      node = null;

            root.children = new List <zTreeNode>();
            foreach (Channel item in list)
            {
                node = new zTreeNode();
                DataTable dt = templateDetailBLL.GetTemplateDetailChecked(templateId);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["ChannelId"].Equals(item.ChannelId) && templeteType == 2)
                    {
                        node.@checked    = true;
                        node.chkDisabled = true;//设为禁用
                    }
                }
                node.id   = item.ChannelId;
                node.name = item.ChannelName;
                node.pId  = item.ParentId;
                node.open = true;
                TemplateDetail _TemplateDetail = getIsExistTemplatedetail(templateId, node.id);
                if (_TemplateDetail == null)
                {
                    node.@checked = false;
                }
                else
                {
                    node.@checked = true;
                }
                node.attributes = new zTreeNodeCustAttr(node.id);
                SqlWhereList wherelist = new SqlWhereList();
                wherelist.Add("ParentID", node.id);
                if (templeteType == 2)
                {
                    wherelist.Add("TypeId", 1);
                }
                GetzTree(wherelist, node, templateId, templeteType);
                root.children.Add(node);
            }
        }
コード例 #23
0
        public string GetCourseRecommend(string version)
        {
            SqlWhereList sw = new SqlWhereList();

            sw.Add("SoftVersion", version);
            List <CourseRecommend> cr = crBll.GetAll(sw);

            if (cr == null || cr.Count == 0)
            {
                return("[]");
            }
            return(JsonHelper.ToJson(cr));
        }
コード例 #24
0
        public object GetAdminList(int?analystType)
        {
            analystType = analystType.HasValue ? analystType : 2;
            SqlWhereList sql = new SqlWhereList();

            sql.Add("AnalystType", analystType);
            model.AnalystList = analystBLL.GetAll(sql);
            if (model.AnalystList != null)
            {
                model.AnalystList = model.AnalystList.OrderByDescending(a => a.AnalystSort).ToList();
            }
            return(new PageResult(null, model));
        }
コード例 #25
0
        public int EidtCourseProgram(string cpId, CourseProgram cp)
        {
            //return 123;
            CourseProgram myCp = new CourseProgram();
            SqlWhereList  swl  = new SqlWhereList();

            swl.Add("SoftVersion", cp.SoftVersion);
            swl.Add("CourseType", cp.CourseType);
            myCp = cpBll.GetAll(swl).FirstOrDefault();
            int orderNum = 99;

            if (myCp != null)
            {
                orderNum = myCp.OrderNum ?? 99;
            }
            int res;

            if (cpId == "add")
            {
                cp.CreatedTime = DateTime.Now;
                cp.Editor      = UserCookies.AdminName;
                cp.Status      = 1;
                cp.OrderNum    = orderNum;
                cp.ProgramUrl  = cp.ProgramUrl == null ? "" : cp.ProgramUrl;
                res            = cpBll.Add(cp);
            }
            else
            {
                cp.CreatedTime = DateTime.Now;
                cp.Editor      = UserCookies.AdminName;
                cp.Status      = 1;
                cp.OrderNum    = orderNum;
                cp.ProgramUrl  = cp.ProgramUrl == null ? "" : cp.ProgramUrl;
                res            = cpBll.Update(cp);
            }
            CreateJsonPage(cp.SoftVersion);
            return(res);
        }
コード例 #26
0
        public object GetauthorityList()
        {
            AuthoritydotPageModel myModel         = new AuthoritydotPageModel();
            AuthorityDotBLL       authorityDotBLL = Factory.BusinessFactory.CreateBll <AuthorityDotBLL>();

            SqlWhereList sw = new SqlWhereList();

            sw.Add("ParentId", 0);
            myModel.AuthorityDots = authorityDotBLL.GetAll(sw);
            foreach (var item in myModel.AuthorityDots)
            {
                item.Options = GetOptions(item.Id);
            }
            return(new PageResult(null, myModel));
        }
コード例 #27
0
ファイル: AjaxChannel.cs プロジェクト: luozhiyong520/CMS
        public string deleteChannelByID(string channelID)
        {
            string  msg     = "";
            Channel channel = new Channel();

            channel.ChannelId = channelID;
            SqlWhereList sqlWhere = new SqlWhereList();

            sqlWhere.Add("ParentID", channelID);
            List <Channel> channellist = channelBLL.GetAll(sqlWhere);

            if (channellist.Count > 0)
            {
                msg = "还有子节点,不能直接删除!!!";
            }
            else
            {
                channelBLL.Delete(channel);
            }
            return(msg);
        }
コード例 #28
0
        public object GetTwoMenuList()
        {
            string ucUrl = "~/controls/mainmenu.ascx";

            //  where.Add("ParentID", 0);
            // ControlModel.AdminOneMenuModuleList = menuBLL.GetAll(where);
            ControlModel.AdminOneMenuModuleList = permissionBLL.GetPermissionModuleList(UserCookies.AdminId, UserCookies.GroupId, 4, 0, "TopMenu");
            if (ControlModel.AdminOneMenuModuleList != null)
            {
                foreach (AdminMenuModule m in ControlModel.AdminOneMenuModuleList)
                {
                    SqlWhereList wheretwo = new SqlWhereList();
                    wheretwo.Add("ParentID", m.ModuleId);
                    if (!ControlModel.TwoMenu.ContainsKey(m.ModuleId))
                    {
                        // ControlModel.TwoMenu[m.ModuleId] = menuBLL.GetAll(wheretwo);
                        ControlModel.TwoMenu[m.ModuleId] = permissionBLL.GetPermissionModuleList(UserCookies.AdminId, UserCookies.GroupId, 4, m.ModuleId, "LeftMenu");
                    }
                }
            }
            return(new UcResult(ucUrl, ControlModel));
        }
コード例 #29
0
        private string GetOptions(int parentId)
        {
            string res = string.Empty;
            AuthoritydotPageModel myModel         = new AuthoritydotPageModel();
            AuthorityDotBLL       authorityDotBLL = Factory.BusinessFactory.CreateBll <AuthorityDotBLL>();

            SqlWhereList sw = new SqlWhereList();

            sw.Add("ParentId", parentId);

            List <AuthorityDot> list = authorityDotBLL.GetAll(sw);

            foreach (var item in list)
            {
                res += " , " + item.Text;
            }

            if (string.IsNullOrEmpty(res))
            {
                return("");
            }

            return(res.Substring(3));
        }
コード例 #30
0
        public object GetAdminGroupUserList()
        {
            AuthorityDotBLL       authorityDotBLL    = Factory.BusinessFactory.CreateBll <AuthorityDotBLL>();
            List <MyAuthorityDot> myAuthorityDotList = new List <MyAuthorityDot>();

            SqlWhereList sw = new SqlWhereList();

            sw.Add("ParentId", 0);
            foreach (var authorityDot in authorityDotBLL.GetAll(sw))
            {
                MyAuthorityDot myAuthorityDot = new MyAuthorityDot();
                SqlWhereList   swl            = new SqlWhereList();
                swl.Add("ParentId", authorityDot.Id);

                myAuthorityDot.DotName       = authorityDot.Text;
                myAuthorityDot.AuthorityDots = authorityDotBLL.GetAll(swl);
                myAuthorityDotList.Add(myAuthorityDot);
            }
            model.AuthorityDotList = myAuthorityDotList;

            model.AdminGroupList    = groupBLL.GetAll();
            model.AdministratorList = adminBLL.GetAdministratorList();
            return(new PageResult(null, model));
        }