public IList <Vtrunkinformation> PaginationFindByDstcitycode(VtrunkinformationPagination obj)
        {
            String stmtId = "VtrunkinformationPagination.FindByDstcitycode";
            IList <Vtrunkinformation> result = this.sqlMapper.QueryForList <Vtrunkinformation>(stmtId, obj);

            return(result);
        }
        public IList <Vtrunkinformation> PaginationFindByTrunkidentifynumber(VtrunkinformationPagination obj)
        {
            String stmtId = "VtrunkinformationPagination.FindByTrunkidentifynumber";
            IList <Vtrunkinformation> result = this.sqlMapper.QueryForList <Vtrunkinformation>(stmtId, obj);

            return(result);
        }
        public IList <Vtrunkinformation> DescendOrderPaginationFindByNumber(VtrunkinformationPagination obj)
        {
            String stmtId = "VtrunkinformationPagination.DescendOrderFindByNumber";
            IList <Vtrunkinformation> result = this.sqlMapper.QueryForList <Vtrunkinformation>(stmtId, obj);

            return(result);
        }
        public IList <Vtrunkinformation> DynamicQuery(VtrunkinformationPagination obj)
        {
            String stmtId = "Vtrunkinformation.DynamicQuery";
            IList <Vtrunkinformation> result = this.sqlMapper.QueryForList <Vtrunkinformation>(stmtId, obj);

            return(result);
        }
        public int DynamicCount(VtrunkinformationPagination obj)
        {
            String stmtId = "Vtrunkinformation.DynamicCount";
            int    result = this.sqlMapper.QueryForObject <int>(stmtId, obj);

            return(result);
        }
        public IList <Vtrunkinformation> PaginationFindByContactpersonname(VtrunkinformationPagination obj)
        {
            String stmtId = "VtrunkinformationPagination.FindByContactpersonname";
            IList <Vtrunkinformation> result = this.sqlMapper.QueryForList <Vtrunkinformation>(stmtId, obj);

            return(result);
        }
示例#7
0
        public string generateTrunksInfoHtml(string pageNumber, string pageSize, string bitparams)
        {
            VtrunkinformationPagination pageNationPoco = this.bitMap2Poco(bitparams);

            pageNationPoco.Limit  = int.Parse(pageSize);
            pageNationPoco.Offset = (int.Parse(pageNumber) - 1) * pageNationPoco.Limit;
            logger.Info("Got offset:" + pageNationPoco.Offset.ToString());
            IList <Vtrunkinformation> trunksInfoList = this.vTrunkInfoDao.DynamicQuery(pageNationPoco);
            string tableHtml = this.getTableHtml(this.getTableBodyHtml(trunksInfoList));

            logger.Info("table html:" + tableHtml);
            return(tableHtml);
        }
示例#8
0
        private VtrunkinformationPagination transform2Poco(Hashtable data)
        {
            VtrunkinformationPagination poco = new VtrunkinformationPagination();

            poco.Srccitycode = data["srcCityId"] == null ? null : data["srcCityId"].ToString();
            poco.Dstcitycode = data["dstCityId"] == null ? null : data["dstCityId"].ToString();
            poco.Length      = data["length"] == null ? 0 : int.Parse(data["length"].ToString());
            Hashtable segMap = this.lengthMap(poco.Length.ToString());

            poco.Lengthhigh     = int.Parse(segMap["lengthhigh"].ToString());
            poco.Lengthlow      = int.Parse(segMap["lengthlow"].ToString());
            poco.Weightcapacity = data["weight"] == null ? 0 : int.Parse(data["weight"].ToString());
            segMap           = this.weightMap(poco.Weightcapacity.ToString());
            poco.Weighthigh  = int.Parse(segMap["weighthigh"].ToString());
            poco.Weightlow   = int.Parse(segMap["weightlow"].ToString());
            poco.Trunktypeid = data["trunkTypeId"] == null ? 0 : long.Parse(data["trunkTypeId"].ToString());
            poco.Vantypeid   = data["vanTypeId"] == null ? 0 : long.Parse(data["vanTypeId"].ToString());
            return(poco);
        }
示例#9
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);
         VtrunkinformationPagination poco = new VtrunkinformationPagination();
         Hashtable data = (Hashtable)JsonConvert.DeserializeObject <Hashtable>(parameters);
         if (data == null || data.Count < 1)
         {
             data = new Hashtable();
             int count = this.vTrunkInfoDao.GetCount();
             data.Add("item_count", count.ToString());
             logger.Info("got item count:" + count.ToString());
             data.Add("params", "0-0-0-0-0-0");
         }
         else
         {
             string bitMap = this.hashtable2BitMap(data);
             poco = this.transform2Poco(data);
             int count = this.vTrunkInfoDao.DynamicCount(poco);
             logger.Info("Got items count:" + count.ToString());
             data.Add("item_count", count.ToString());
             data.Add("params", bitMap);
             logger.Info("Post back parameters:" + 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 bitparames = context.Request.QueryString["bitparams"].ToString();
         logger.Info("Got bitparams:" + bitparames);
         string tableHtml = this.generateTrunksInfoHtml(pageNumber, pageSize, bitparames);
         context.Response.ContentType = "text/plain";
         context.Response.Write(tableHtml);
     }
 }
示例#10
0
        private VtrunkinformationPagination bitMap2Poco(string bitMap)
        {
            VtrunkinformationPagination poco = new VtrunkinformationPagination();

            string[] paramArray = bitMap.Split('-');
            if (paramArray.Length != 6)
            {
                return(null);
            }
            poco.Srccitycode = paramArray[0] == "0" ? null : paramArray[0];
            poco.Dstcitycode = paramArray[1] == "0" ? null : paramArray[1];
            poco.Vantypeid   = int.Parse(paramArray[2]);
            poco.Trunktypeid = int.Parse(paramArray[3]);
            poco.Length      = int.Parse(paramArray[4]);
            Hashtable segMap = this.lengthMap(poco.Length.ToString());

            poco.Lengthhigh = int.Parse(segMap["lengthhigh"].ToString());
            poco.Lengthlow  = int.Parse(segMap["lengthlow"].ToString());
            segMap          = this.weightMap(poco.Weightcapacity.ToString());
            poco.Weighthigh = int.Parse(segMap["weighthigh"].ToString());
            poco.Weightlow  = int.Parse(segMap["weightlow"].ToString());
            return(poco);
        }