using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; namespace Core.StlMes.Client.PlnSaleOrd.工序排产.control { public partial class PagingControl : UserControl { /// /// sql语句ID /// string sqlId = ""; /// /// sql参数(此参数必须与sql一致) /// string[] parameters = null; /// /// 每页显示行数 /// int pageSize = 0; /// /// ob /// OpeBase ob = null; /// /// 绑定数据源 /// BindingSource bs = null; /// /// 总页数 /// int pageCount = 0; /// /// 当前页 /// int pageCurrent = 0; Object T = null; public PagingControl() { this.Dock = DockStyle.Bottom; InitializeComponent(); } public void InitData(string sqlId, string[] parameters, int pageSize, BindingSource bs,Object T, OpeBase ob) { this.sqlId = sqlId; this.parameters = parameters; this.pageSize = pageSize; this.bs = bs; this.ob = ob; this.T = T; } private void PagingControl_Load(object sender, EventArgs e) { } private void InitPage() { ultraLabel3.Text = pageCurrent + "/" + pageCount; ultraLabel6.Text = pageSize.ToString(); double pageAll = pageCount / pageSize; ultraLabel8.Text = Math.Ceiling(pageAll).ToString(); } private void ControlPage() { double pageN = pageCount / pageSize; if (pageCurrent <= 1) { this.buttonFrist.Enabled = false; this.buttonUp.Enabled = false; } if (pageCurrent == Math.Ceiling(pageN)) { } } private void QueryPageSize() { DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.PageingControl.queryPageSize", new object[] { sqlId, parameters }, this.ob); if (dt != null && dt.Rows.Count > 0) { pageCount = Convert.ToInt32(dt.Rows[0][0].ToString()); } } private void Query(int beSize, int endSize) { List listSource = EntityHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.PageingControl.queryPageSize", new object[] { }, this.ob); bs.DataSource = listSource; } private void buttonFrist_Click(object sender, EventArgs e) { } private void buttonUp_Click(object sender, EventArgs e) { } private void buttonDown_Click(object sender, EventArgs e) { } private void buttonEnd_Click(object sender, EventArgs e) { } private void buttonGo_Click(object sender, EventArgs e) { } } }