public List <EditionTdm> GetAll(IDbSession sess)
        {
            SqlSelect ss = new SqlSelect(sess);

            ss.Sql = SelectEdition;
            return(ss.ExecuteList <EditionTdm>());
        }
Example #2
0
        public List <GradeTdm> GetAll(IDbSession sess)
        {
            SqlSelect ss = new SqlSelect(sess);

            ss.Sql = SelectGrade;
            return(ss.ExecuteList <GradeTdm>());
        }
        public List <PublishTdm> GetAll(IDbSession sess)
        {
            SqlSelect ss = new SqlSelect(sess);

            ss.Sql = SelectPublish;
            return(ss.ExecuteList <PublishTdm>());
        }
        public List <SubjectTdm> GetAll(IDbSession sess)
        {
            SqlSelect ss = new SqlSelect(sess);

            ss.Sql = SelectSubject;
            return(ss.ExecuteList <SubjectTdm>());
        }
Example #5
0
        /// <summary>
        /// All
        /// </summary>
        /// <param name="sess"></param>
        /// <returns></returns>
        public List <ModuleTdm> GetAllModules(IDbSession sess)
        {
            List <ModuleTdm> r  = new List <ModuleTdm>();
            SqlSelect        ss = new SqlSelect(sess);

            ss.Sql     = SelectModule;
            ss.OrderBy = OrderBy;
            return(ss.ExecuteList <ModuleTdm>());
        }
Example #6
0
        public List <TextbookTdm> GetAll(IDbSession sess)
        {
            SqlSelect ss = new SqlSelect(sess);

            ss.Sql   = SelectTextBook;
            ss.Where = "nt_r_state=@nt_r_state";
            ss.AddParam("nt_r_state", 1);
            return(ss.ExecuteList <TextbookTdm>());
        }
Example #7
0
        /// <summary>
        /// 含MENU And API for Anonymous
        /// </summary>
        /// <param name="sess"></param>
        /// <returns></returns>
        public List <ModuleTdm> GetAnonymModules(IDbSession sess)
        {
            List <ModuleTdm> r  = new List <ModuleTdm>();
            SqlSelect        ss = new SqlSelect(sess);

            ss.Sql     = SelectModule;
            ss.Where   = "m.bn_anonym=true";
            ss.OrderBy = OrderBy;
            return(ss.ExecuteList <ModuleTdm>());
        }
Example #8
0
        /// <summary>
        /// For User,Menu And API
        /// </summary>
        /// <param name="sess"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public List <ModuleTdm> GetUserModules(IDbSession sess, long userId)
        {
            string           existsSql = @"
                exists(
	                select mr.ng_mod_id from sys_role_mod_t mr where exists(
		                SELECT ru.ng_role_id from sys_user_role_t ru 
                        where mr.ng_role_id=ru.ng_role_id and ru.ng_user_id=@userId
	                ) and m.ng_id=mr.ng_mod_id
                )";
            List <ModuleTdm> r         = new List <ModuleTdm>();
            SqlSelect        ss        = new SqlSelect(sess);

            ss.Sql     = SelectModule;
            ss.Where   = "m.bn_anonym=true or m.bn_user=true or " + existsSql;
            ss.OrderBy = OrderBy;
            ss.AddParam("@userId", userId);
            return(ss.ExecuteList <ModuleTdm>());
        }