Exemplo n.º 1
0
        public IList <Vdepotinformation> DescendOrderPaginationFindAll(VdepotinformationPagination obj)
        {
            String stmtId = "Vdepotinformation.DescendOrderFindAllPagination";
            IList <Vdepotinformation> result = this.sqlMapper.QueryForList <Vdepotinformation>(stmtId, obj);

            return(result);
        }
Exemplo n.º 2
0
        public IList <Vdepotinformation> PaginationFindByUsername(VdepotinformationPagination obj)
        {
            String stmtId = "VdepotinformationPagination.FindByUsername";
            IList <Vdepotinformation> result = this.sqlMapper.QueryForList <Vdepotinformation>(stmtId, obj);

            return(result);
        }
Exemplo n.º 3
0
        public int DynamicCount(VdepotinformationPagination obj)
        {
            String stmtId = "Vdepotinformation.DynamicCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
Exemplo n.º 4
0
        public IList <Vdepotinformation> DynamicQuery(VdepotinformationPagination obj)
        {
            String stmtId = "Vdepotinformation.DynamicQuery";
            IList <Vdepotinformation> result = this.sqlMapper.QueryForList <Vdepotinformation>(stmtId, obj);

            return(result);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 public void ProcessRequest(HttpContext context)
 {
     if (context.Request.RequestType == "POST")
     {// POST
         StreamReader streamReader = new StreamReader(context.Request.InputStream);
         string       parameters   = streamReader.ReadToEnd();
         logger.Info("Got post parameters:" + parameters);
         VdepotinformationPagination poco = new VdepotinformationPagination();
         Hashtable data = (Hashtable)JsonConvert.DeserializeObject <Hashtable>(parameters);
         if (data == null || data.Count < 1)
         {
             data = new Hashtable();
             int count = this.vDepotInfoDao.GetCount();
             data.Add("item_count", count.ToString());
             logger.Info("got item count:" + count.ToString());
             data.Add("params", "0-0-0-0");
         }
         else
         {
             string bitMap = this.hashtable2BitMap(data);
             poco.Citycode    = data["cityId"] == null ? null : data["cityId"].ToString();
             poco.Depottypeid = data["typeId"] == null ? 0 : long.Parse(data["typeId"].ToString());
             poco.Scopeid     = data["scopeId"] == null ? 0 : long.Parse(data["scopeId"].ToString());
             string    area    = data["area"] == null ? "0" : data["area"].ToString();
             Hashtable areaMap = this.areaMap(area);
             poco.AreaLow  = int.Parse(areaMap["low"].ToString());
             poco.AreaHigh = int.Parse(areaMap["high"].ToString());
             poco.Area     = int.Parse(area);
             int count = this.vDepotInfoDao.DynamicCount(poco);
             logger.Info("Got items count:" + count.ToString());
             data = new Hashtable();
             data.Add("item_count", count.ToString());
             data.Add("params", bitMap);
             logger.Info("Post back bitMap:" + bitMap);
         }
         context.Response.ContentType = "text/plain";
         context.Response.Write(JsonConvert.SerializeObject(data));
     }
     else
     {// GET
         string pageNumber = context.Request.QueryString["pageNumber"].ToString();
         logger.Info("Got page number:" + pageNumber);
         string pageSize = context.Request.QueryString["pageSize"].ToString();
         logger.Info("Got page size:" + pageSize);
         string bitParams = context.Request.QueryString["bitparams"].ToString();//null
         logger.Info("Got bitmap params:" + bitParams);
         string tableHtml = this.generateDepotInfoHtml(pageNumber, pageSize, bitParams);
         context.Response.ContentType = "text/plain";
         context.Response.Write(tableHtml);
     }
 }