Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
0
        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, "", "|", "--"));
        }
Ejemplo n.º 7
0
        public JsonResult GetOptions(int qId)
        {
            SqlWhereList sql = new SqlWhereList();

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

            return(new JsonResult(objs));
        }
Ejemplo n.º 8
0
        public virtual List <Questionnaires> GetQuestionnairesListNoCache(int parentId)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

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

            return(list);
        }
Ejemplo n.º 9
0
        public virtual List <QuestionnairesOptions> GetQuestionnairesOptionsList(int QId)
        {
            SqlWhereList sqlwhere = new SqlWhereList();

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

            return(list);
        }
Ejemplo n.º 10
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));
        }
Ejemplo n.º 11
0
        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));
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        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));
        }
Ejemplo n.º 15
0
        public virtual List <TClass> GetAll(SqlWhereList sqlWhereList)
        {
            string strSql = string.Format("Select Top 500 * From {0} {1}", tableName,
                                          isLogicDelete ? "Where DelStatus=0" : "");

            strSql += isLogicDelete ? "" : " WHERE 1=1 ";
            strSql  = sqlWhereList.Aggregate(strSql,
                                             (current, field) =>
                                             current + (" AND " + field.ParaName + " = @" + field.ParaName));
            return(ExecuteDataSet(strSql, sqlWhereList.ToParas()).ToList <TClass>());
        }
Ejemplo n.º 16
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));
        }
Ejemplo n.º 17
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));
        }
Ejemplo n.º 18
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));
        }
Ejemplo n.º 19
0
        /// <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);
        }
Ejemplo n.º 20
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));
        }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
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));
        }
Ejemplo n.º 23
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));
 }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
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);
            }
        }
Ejemplo n.º 26
0
        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);
        }
Ejemplo n.º 27
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));
        }
Ejemplo n.º 28
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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }