private void btnRefresh_Click(object sender, EventArgs e) { InStockDialog f = new InStockDialog(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pnlProgress.Top = (pnlMain.Height - pnlProgress.Height) / 3; pnlProgress.Left = (pnlMain.Width - pnlProgress.Width) / 2; pnlProgress.Visible = true; Application.DoEvents(); string filter = f.filter; DataTable dt = bll.FillDataTable("WCS.SelectStockDetail", new DataParameter[] { new DataParameter("{0}", filter) }); bsMain.DataSource = dt; pnlProgress.Visible = false; } }
private void btnRefresh_Click(object sender, EventArgs e) { InStockDialog f = new InStockDialog(TaskType); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pnlProgress.Top = (pnlMain.Height - pnlProgress.Height) / 3; pnlProgress.Left = (pnlMain.Width - pnlProgress.Width) / 2; pnlProgress.Visible = true; Application.DoEvents(); string filter = string.Format("WCS_TASK.TaskType='{0}' and WCS_TASK.State='2' and {1}", TaskType, f.filter); DataTable dt = bll.FillDataTable("WCS.SelectTaskTotal", new DataParameter[] { new DataParameter("{0}", filter) }); bsMain.DataSource = dt; if (dt.Rows.Count <= 0) { filter = string.Format("1=2"); dt = bll.FillDataTable("WCS.SelectTaskDetail", new DataParameter[] { new DataParameter("{0}", filter) }); this.bsDetail.DataSource = dt; } pnlProgress.Visible = false; } }