public void PaginationAccessibilitySetCurrent() { tlog.Debug(tag, $"PaginationAccessibilitySetCurrent START"); var testingTarget = new MyPagination(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <Pagination>(testingTarget, "Should return Pagination instance."); testingTarget.IndicatorCount = 8; try { testingTarget.MyAccessibilitySetCurrent(5.0f); testingTarget.MyAccessibilityGetMinimumIncrement(); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } testingTarget.Dispose(); tlog.Debug(tag, $"PaginationAccessibilitySetCurrent END (OK)"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["intype"] == null) { //导出商品详细 DataBind(Request["oID"].ToString()); } else { string tbName = string.Empty; string tb = string.Empty; string strwhere = (Request["searchValue"] + ""); //var ostate = Request["OState"]; //string strwhereOState = string.Empty; //if (ostate != "-2") //{ // if (ostate.ToInt(0) == 0) // strwhereOState += " and o.OState in (1,2,3,4) "; // else if (ostate.ToInt(0) == 1) // strwhereOState += " and o.OState=5 "; // else // strwhereOState += " and o.OState=6 "; //} //strwhere += strwhereOState; string orderby = string.Empty; int PageSize = Request["p"] != null ? Request["p"].ToString().ToInt(0) : 12; int CurrentPageIndex = Request["c"] != null ? Request["c"].ToString().ToInt(0) : 1; int intype = Request["intype"] != null ? Request["intype"].ToInt(0) : 1; string str = string.Empty; string strwhat = toExcel(intype, out tb, out tbName, out str, out orderby); //DataTable dt = new Hi.BLL.DIS_Order().GetList(strwhat,tbName, "o.ID in(2074,2075)", ""); string sql = "select " + strwhat + " from " + tbName + " where 1=1 " + str; if (!string.IsNullOrEmpty(strwhere)) { sql += strwhere; } sql += orderby; MyPagination mypag = new MyPagination(); DataTable dt = mypag.GetDt(CurrentPageIndex, PageSize, sql, sql); Bind(dt, tb); } } }
public void PaginationSelectedIndex() { tlog.Debug(tag, $"PaginationSelectedIndex START"); var testingTarget = new MyPagination(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <Pagination>(testingTarget, "Should return Pagination instance."); testingTarget.IndicatorCount = 8; testingTarget.SelectedIndex = 9; tlog.Debug(tag, "SelectedIndex : " + testingTarget.SelectedIndex); testingTarget.Dispose(); tlog.Debug(tag, $"PaginationSelectedIndex END (OK)"); }
public void PaginationIndicatorColor() { tlog.Debug(tag, $"PaginationIndicatorColor START"); var testingTarget = new MyPagination(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <Pagination>(testingTarget, "Should return Pagination instance."); testingTarget.IndicatorCount = 8; testingTarget.SelectedIndex = 5; testingTarget.IndicatorColor = Color.Black; tlog.Debug(tag, "IndicatorColor : " + testingTarget.IndicatorColor); testingTarget.IndicatorColor = Color.Yellow; tlog.Debug(tag, "IndicatorColor : " + testingTarget.IndicatorColor); testingTarget.Dispose(); tlog.Debug(tag, $"PaginationIndicatorColor END (OK)"); }
/// <summary> /// 绑定销售订单信息列表 /// </summary> public void Bind() { int Counts = 0; string strwhere = " and cm.CompID=" + this.CompID + ""; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } string str = string.Empty; if (Request["type"] + "" == "1") { strwhere += " and fcnum>0"; str += " and State<>2"; } string sql = string.Format(@"select * from ( select cm.ID,cm.CMCode,cm.CompID,cm.CMName,g.CategoryID,cm.GoodsID,info.BarCode GoodsCode,g.GoodsName,cm.ProvideData,info.ValueInfo,cm.InvalidDate,cm.ForceDate,(select COUNT(*) from YZT_FirstCamp fc where fc.CMID=cm.ID {1}) fcnum from YZT_CMerchants cm left join BD_GoodsInfo info on info.ID=cm.GoodsID left join BD_Goods g on info.GoodsID=g.ID where cm.dr=0 ) cm where 1=1 {0}", strwhere, str); if (strwhere != "") { sql += strwhere; } sql += " order by cm.ID desc"; MyPagination mypag = new MyPagination(); DataTable dt = mypag.GetDt(Pager.CurrentPageIndex, Pager.PageSize, sql, sql, out Counts); this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定销售订单信息列表 /// </summary> public void Bind() { int pageCount = 0; int Counts = 0; string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere = ViewState["strwhere"].ToString(); } string sql = @"select fc.ID,fc.State,fc.CompID,fc.ForceDate,fc.InvalidDate,cm.CMCode,cm.CMName, g.CategoryID,info.BarCode GoodsCode,g.GoodsName,cm.ProvideData,info.ValueInfo,fc.HtID,h.HospitalName from YZT_FirstCamp fc left join YZT_CMerchants cm on fc.CMID=cm.ID left join BD_GoodsInfo info on info.ID=cm.GoodsID left join BD_Goods g on info.GoodsID=g.ID left join SYS_Hospital h on fc.HtID=h.ID where fc.dr=0 and fc.DisID=" + this.DisID + " and (ISNULL(cm.ForceDate,0)=0 or cm.ForceDate <= getdate() ) and (ISNULL(cm.InvalidDate,0)=0 or cm.InvalidDate>=getdate()) and 1=1 "; if (strwhere != "") { sql += strwhere; } if (this.ddrComp.Value != "") { sql += " and fc.CompID=" + this.ddrComp.Value; } sql += " order by fc.ID desc"; MyPagination mypag = new MyPagination(); DataTable dt = mypag.GetDt(Pager.CurrentPageIndex, Pager.PageSize, sql, sql, out Counts); this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); }
public TotoPagination(MyPagination pagi) { Pagi = pagi; }