public string generateLineInfoHtml(string pageNumber, string pageSize, string bitParams) { pageNumber = int.Parse(pageNumber) < 0 ? "0" : pageNumber; logger.Info("Generate line information with pageNumber:" + pageNumber + ", pageSize:" + pageSize + ", bitParams:" + bitParams); VspeciallineinfoPagination pageNationPoco = new VspeciallineinfoPagination(); SpecialineParamPojo paramPojo = this.paramBitMapParser(bitParams); if (null != paramPojo) { pageNationPoco.Departuretypeid = int.Parse(paramPojo.DeparutreId); pageNationPoco.Dstcitycode = paramPojo.DstCityId; pageNationPoco.Srccitycode = paramPojo.CityId; pageNationPoco.Speciallinetypeid = int.Parse(paramPojo.TypeId); } pageNationPoco.Limit = int.Parse(pageSize); pageNationPoco.Offset = (int.Parse(pageNumber) - 1) * pageNationPoco.Limit; logger.Info("Got offset:" + pageNationPoco.Offset.ToString()); logger.Info("Got limit:" + pageNationPoco.Limit.ToString()); IList <Vspeciallineinfo> lineInfoList = this.vLineInfoDao.DynamicQuery(pageNationPoco); logger.Info("Got items:" + lineInfoList.Count.ToString()); string tableHtml = this.getTableHtml(this.getTableBodyHtml(lineInfoList), ""); logger.Info("table html:" + tableHtml); return(tableHtml); }
public IList <Vspeciallineinfo> PaginationFindByDstcitycode(VspeciallineinfoPagination obj) { String stmtId = "VspeciallineinfoPagination.FindByDstcitycode"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public IList <Vspeciallineinfo> PaginationFindAll(VspeciallineinfoPagination obj) { String stmtId = "Vspeciallineinfo.FindAllPagination"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public IList <Vspeciallineinfo> DescendOrderPaginationFindByDstcityname(VspeciallineinfoPagination obj) { String stmtId = "VspeciallineinfoPagination.DescendOrderFindByDstcityname"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public IList <Vspeciallineinfo> PaginationFindBySrccontactcellphone(VspeciallineinfoPagination obj) { String stmtId = "VspeciallineinfoPagination.FindBySrccontactcellphone"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public IList <Vspeciallineinfo> PaginationFindBySrcplaceaddress(VspeciallineinfoPagination obj) { String stmtId = "VspeciallineinfoPagination.FindBySrcplaceaddress"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public int DynamicCount(VspeciallineinfoPagination obj) { String stmtId = "Vspeciallineinfo.DynamicCount"; int result = this.sqlMapper.QueryForObject <int>(stmtId, obj); return(result); }
public IList <Vspeciallineinfo> DynamicQuery(VspeciallineinfoPagination obj) { String stmtId = "Vspeciallineinfo.DynamicQueryPagination"; IList <Vspeciallineinfo> result = this.sqlMapper.QueryForList <Vspeciallineinfo>(stmtId, obj); return(result); }
public void ProcessRequest(HttpContext context) { if (context.Request.RequestType == "POST") {// POST data.params StreamReader streamReader = new StreamReader(context.Request.InputStream); string parameters = streamReader.ReadToEnd(); logger.Info("Got special line type parameter:" + parameters); VspeciallineinfoPagination poco = new VspeciallineinfoPagination(); Hashtable data = (Hashtable)JsonConvert.DeserializeObject <Hashtable>(parameters); if (data == null || data.Count < 1) { data = new Hashtable(); int count = this.vLineInfoDao.GetCount(); data.Add("items_count", count.ToString()); logger.Info("got item count:" + count.ToString()); data.Add("params", "0-0-0-0"); } else { string bitMap = this.hashtable2BitMap(data); poco.Departuretypeid = data["departureId"] == null ? 0 : long.Parse(data["departureId"].ToString()); poco.Dstcitycode = data["dstCityId"] == null ? null : data["dstCityId"].ToString(); poco.Srccitycode = data["cityId"] == null ? null : data["cityId"].ToString(); poco.Speciallinetypeid = data["typeId"] == null ? 0 : long.Parse(data["typeId"].ToString()); int count = this.vLineInfoDao.DynamicCount(poco); logger.Info("Got items count:" + count.ToString()); data = new Hashtable(); data.Add("items_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.generateLineInfoHtml(pageNumber, pageSize, bitParams); context.Response.ContentType = "text/plain"; context.Response.Write(tableHtml); } }
protected void Page_Load(object sender, EventArgs e) { IVspeciallineinfoDao lineDao = new VspeciallineinfoDao(); VspeciallineinfoPagination linePoco = new VspeciallineinfoPagination(); linePoco.Speciallinetypeid = 2; IList <Vspeciallineinfo> pocoList = lineDao.DynamicQuery(linePoco); foreach (Vspeciallineinfo poco in pocoList) { Response.Write(poco.Id); Response.Write(":"); Response.Write(poco.Speciallinetypeid); Response.Write(":"); Response.Write(poco.Speciallinetypename); Response.Write("<br/>"); } }