/// <summary> /// 返回分页列表 /// </summary> /// <param name="serModel"></param> /// <returns></returns> public IList <Eyousoft_yhq.Model.GYSticket> GetList(Eyousoft_yhq.Model.GysTicketSer serModel) { IList <Eyousoft_yhq.Model.GYSticket> list = new List <Eyousoft_yhq.Model.GYSticket>(); StringBuilder query = new StringBuilder(); query.Append("select ID , CusName , CusSex , CusMob , PlaneTicket , IssueTime , Remark, OpertorID,OrderState,TicketState from GYSTicket where 1=1"); if (serModel != null) { if (!string.IsNullOrEmpty(serModel.OpertorID)) { query.AppendFormat(" and OpertorID = '{0}' ", serModel.OpertorID); } } query.Append(" order by IssueTime DESC "); DbCommand cmd = this._db.GetSqlStringCommand(query.ToString()); using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._db)) { while (dr.Read()) { Eyousoft_yhq.Model.GYSticket model = new Eyousoft_yhq.Model.GYSticket(); model.ID = dr.GetString(dr.GetOrdinal("ID"));; model.CusName = dr.GetString(dr.GetOrdinal("CusName")); model.CusSex = (Eyousoft_yhq.Model.sexType)dr.GetByte(dr.GetOrdinal("CusSex")); model.CusMob = dr.GetString(dr.GetOrdinal("CusMob")); model.PlaneTicket = dr.GetString(dr.GetOrdinal("PlaneTicket")); model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime")); model.Remark = dr.GetString(dr.GetOrdinal("Remark")); model.OpertorID = dr.GetString(dr.GetOrdinal("OpertorID")); model.orderState = (Eyousoft_yhq.Model.TickOrderState)dr.GetByte(dr.GetOrdinal("OrderState")); model.payState = (Eyousoft_yhq.Model.PaymentState)dr.GetByte(dr.GetOrdinal("TicketState")); list.Add(model); } } return(list); }
/// <summary> /// 初始化列表 /// </summary> protected void initList() { Eyousoft_yhq.BLL.GYSticket bll = new Eyousoft_yhq.BLL.GYSticket(); #region 查询实体 Eyousoft_yhq.Model.GysTicketSer serchModel = new Eyousoft_yhq.Model.GysTicketSer(); serchModel.cusName = Utils.GetQueryStringValue("cusName"); serchModel.cusMob = Utils.GetQueryStringValue("cusMob"); serchModel.tickNO = Utils.GetQueryStringValue("GysTicket"); pageIndex = UtilsCommons.GetPagingIndex("Page"); #endregion var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel); if (list != null && list.Count > 0) { rpTicket.DataSource = list; rpTicket.DataBind(); BindPage(); litMsg.Visible = false; } }
/// <summary> /// 初始化列表 /// </summary> protected void initList() { Eyousoft_yhq.BLL.GYSticket bll = new Eyousoft_yhq.BLL.GYSticket(); #region 查询实体 Eyousoft_yhq.Model.GysTicketSer serchModel = new Eyousoft_yhq.Model.GysTicketSer(); serchModel.cusName = Utils.GetQueryStringValue("cusName"); serchModel.cusMob = Utils.GetQueryStringValue("cusMob"); serchModel.tickNO = Utils.GetQueryStringValue("GysTicket"); pageIndex = UtilsCommons.GetPagingIndex("Page"); #endregion var list = bll.GetList(pageSize, pageIndex, ref recordCount, serchModel); if (list != null && list.Count > 0) { rpTicket.DataSource = list; rpTicket.DataBind(); BindPage(); litMsg.Visible = false; } }
/// <summary> /// 返回分页列表 /// </summary> /// <param name="serModel"></param> /// <returns></returns> public IList <Eyousoft_yhq.Model.GYSticket> GetList(Eyousoft_yhq.Model.GysTicketSer serModel) { return(dal.GetList(serModel)); }
/// <summary> /// 返回分页列表 /// </summary> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <param name="RecordCount"></param> /// <param name="serModel"></param> /// <returns></returns> public IList <Eyousoft_yhq.Model.GYSticket> GetList(int PageSize, int PageIndex, ref int RecordCount, Eyousoft_yhq.Model.GysTicketSer serModel) { return(dal.GetList(PageSize, PageIndex, ref RecordCount, serModel)); }
/// <summary> /// 返回分页列表 /// </summary> /// <param name="PageSize"></param> /// <param name="PageIndex"></param> /// <param name="RecordCount"></param> /// <param name="serModel"></param> /// <returns></returns> public IList <Eyousoft_yhq.Model.GYSticket> GetList(int PageSize, int PageIndex, ref int RecordCount, Eyousoft_yhq.Model.GysTicketSer serModel) { IList <Eyousoft_yhq.Model.GYSticket> list = new List <Eyousoft_yhq.Model.GYSticket>(); string tableName = "GYSTicket"; string fileds = " ID , CusName , CusSex , CusMob , PlaneTicket , IssueTime , Remark, OpertorID,OrderState,TicketState "; string orderByString = "IssueTime desc"; StringBuilder query = new StringBuilder(); query.Append(" 1=1 "); if (serModel != null) { if (!string.IsNullOrEmpty(serModel.OpertorID)) { query.AppendFormat(" and OpertorID = '{0}' ", serModel.OpertorID); } if (!string.IsNullOrEmpty(serModel.cusName)) { query.AppendFormat(" and CusName LIKE '%{0}%' ", serModel.cusName); } if (!string.IsNullOrEmpty(serModel.cusMob)) { query.AppendFormat(" and CusMob LIKE '%{0}%' ", serModel.cusMob); } if (!string.IsNullOrEmpty(serModel.tickNO)) { query.AppendFormat(" and PlaneTicket LIKE '%{0}%' ", serModel.tickNO); } } using (IDataReader dr = DbHelper.ExecuteReader1(this._db, PageSize, PageIndex, ref RecordCount, tableName, fileds, query.ToString(), orderByString, null)) { while (dr.Read()) { Eyousoft_yhq.Model.GYSticket model = new Eyousoft_yhq.Model.GYSticket(); model.ID = dr.GetString(dr.GetOrdinal("ID"));; model.CusName = dr.GetString(dr.GetOrdinal("CusName")); model.CusSex = (Eyousoft_yhq.Model.sexType)dr.GetByte(dr.GetOrdinal("CusSex")); model.CusMob = dr.GetString(dr.GetOrdinal("CusMob")); model.PlaneTicket = dr.GetString(dr.GetOrdinal("PlaneTicket")); model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime")); model.Remark = dr.GetString(dr.GetOrdinal("Remark")); model.OpertorID = dr.GetString(dr.GetOrdinal("OpertorID")); model.orderState = (Eyousoft_yhq.Model.TickOrderState)dr.GetByte(dr.GetOrdinal("OrderState")); model.payState = (Eyousoft_yhq.Model.PaymentState)dr.GetByte(dr.GetOrdinal("TicketState")); list.Add(model); } } return(list); }