示例#1
0
        private static string BuildQuery(ADZoneSearchType listType, string keywords)
        {
            switch (listType)
            {
            case ADZoneSearchType.ZoneName:
                return("ZoneName LIKE '%" + DBHelper.FilterBadChar(keywords) + "%'");

            case ADZoneSearchType.ZoneIntro:
                return("ZoneIntro LIKE '%" + DBHelper.FilterBadChar(keywords) + "%'");
            }
            return(null);
        }
示例#2
0
 public static int GetTotalOfADZone(ADZoneSearchType listType, string keyword)
 {
     return(dal.GetTotalOfADZone());
 }
示例#3
0
 public static IList <ADZoneInfo> GetADZoneList(int startRowIndex, int maximumRows, ADZoneSearchType listType, string keyword)
 {
     return(dal.GetAllADZone(startRowIndex, maximumRows, listType, keyword));
 }
示例#4
0
        public IList <ADZoneInfo> GetAllADZone(int startRowIndexId, int maxNumberRows, ADZoneSearchType listType, string keywords)
        {
            Database           database            = DatabaseFactory.CreateDatabase();
            IList <ADZoneInfo> list                = new List <ADZoneInfo>();
            string             storedProcedureName = "PR_Common_GetList";
            string             str2                = BuildQuery(listType, keywords);
            DbCommand          storedProcCommand   = database.GetStoredProcCommand(storedProcedureName);

            database.AddInParameter(storedProcCommand, "@StartRows", DbType.Int32, startRowIndexId);
            database.AddInParameter(storedProcCommand, "@PageSize", DbType.Int32, maxNumberRows);
            database.AddInParameter(storedProcCommand, "@SortColumn", DbType.String, "ZoneID");
            database.AddInParameter(storedProcCommand, "@StrColumn", DbType.String, "*");
            database.AddInParameter(storedProcCommand, "@Sorts", DbType.String, "DESC");
            database.AddInParameter(storedProcCommand, "@Filter", DbType.String, str2);
            database.AddInParameter(storedProcCommand, "@TableName", DbType.String, "PE_AdZone");
            database.AddOutParameter(storedProcCommand, "@Total", DbType.Int32, maxNumberRows);
            using (NullableDataReader reader = new NullableDataReader(database.ExecuteReader(storedProcCommand)))
            {
                while (reader.Read())
                {
                    list.Add(GetAdZoneInfoFromrdr(reader));
                }
            }
            this.m_NumADZones = (int)database.GetParameterValue(storedProcCommand, "@Total");
            return(list);
        }