コード例 #1
0
        public string generateDepotInfoHtml(string pageNumber, string pageSize, string bitParams)
        {
            pageNumber = int.Parse(pageNumber) < 0 ? "0" : pageNumber;
            VdepotinformationPagination pageNationPoco = new VdepotinformationPagination();

            pageNationPoco.Limit = int.Parse(pageSize);

            pageNationPoco.Offset = (int.Parse(pageNumber) - 1) * pageNationPoco.Limit;
            logger.Info("Got offset:" + pageNationPoco.Offset.ToString());
            DepotParamPojo pojo = this.paramBitMapParser(bitParams);

            pageNationPoco.Area = int.Parse(pojo.Area);
            Hashtable areaMap = this.areaMap(pojo.Area);

            pageNationPoco.AreaLow     = int.Parse(areaMap["low"].ToString());
            pageNationPoco.AreaHigh    = int.Parse(areaMap["high"].ToString());
            pageNationPoco.Citycode    = pojo.CityId;
            pageNationPoco.Depottypeid = long.Parse(pojo.TypeId);
            pageNationPoco.Scopeid     = long.Parse(pojo.ScopeId);
            IList <Vdepotinformation> trunksInfoList = this.vDepotInfoDao.DynamicQuery(pageNationPoco);

            logger.Info("Got items:" + trunksInfoList.Count.ToString());
            string tableHtml = this.getTableHtml(this.getTableBodyHtml(trunksInfoList));

            logger.Info("table html:" + tableHtml);
            return(tableHtml);
        }
コード例 #2
0
        /// <summary>
        /// parameters format: cityId-scopeId-typeId-area
        /// </summary>
        /// <param name="bitMap"></param>
        /// <returns></returns>
        private DepotParamPojo paramBitMapParser(string bitMap)
        {
            DepotParamPojo paramPojo = new DepotParamPojo();

            string[] paramArray = bitMap.Split('-');
            if (paramArray.Length != 4)
            {
                return(null);
            }
            paramPojo.CityId  = paramArray[0] == "0" ? null : paramArray[0];
            paramPojo.ScopeId = paramArray[1];
            paramPojo.TypeId  = paramArray[2];
            paramPojo.Area    = paramArray[3];
            return(paramPojo);
        }