//绑定grvKC_HW private void BindgrvKC_HW() { try { string sql = GetSqlstr(); string sortEx = this.grvKC_HW.Attributes["SortExpression"]; string sortDirect = this.grvKC_HW.Attributes["SortDirection"]; string strSort = (!string.IsNullOrEmpty(sortEx)) ? sortEx + " " + sortDirect : ""; DataSet ds = KCQuery.GetQueryKC_HW(sql, strSort, PageControl2.GetPageSize(), PageControl2.GetCurrPage()); this.grvKC_HW.DataSource = ds; this.grvKC_HW.DataBind(); DataSet dsCount = KCQuery.GetCountKC_HW(sql); if (dsCount != null && dsCount.Tables[0].Rows.Count > 0 && dsCount.Tables[0].Rows[0]["HJCOUNT"].ToString() != "0") { this.lblCount.Text = dsCount.Tables[0].Rows[0]["HJCOUNT"].ToString(); this.lblSL.Text = dsCount.Tables[0].Rows[0]["HJSL"].ToString(); this.lblZL.Text = Convert.ToDecimal(dsCount.Tables[0].Rows[0]["HJZL"]).ToString("#0.0000"); } else { this.lblCount.Text = "0"; this.lblSL.Text = "0"; this.lblZL.Text = "0.0000"; } this.SetDisplayList1.InitSetListControl(this.grvKC_PCH, SysBaseConfig.KC_Q_PAGE); this.SetDisplayList1.SetGridViewDisplay(grvKC_PCH); } catch (Exception ex) { String strEx = ex.Message; this.PrintfError("数据访问错误,请重试!"); } }
//重置 protected void imgBtnCancle_Click(object sender, ImageClickEventArgs e) { this.txtBarcode.Text = ""; this.txtHW.Text = ""; this.txtPCH.Text = ""; this.txtWLH.Text = ""; this.txtFree1.Text = ""; this.txtFree2.Text = ""; this.txtFree3.Text = ""; this.hidCK.Value = ""; this.hidCopyGG.Value = ""; this.hidGG.Value = ""; this.hidQuery.Value = ""; this.hidRKPH.Value = ""; this.hidRKRQ.Value = ""; this.hidRKSX.Value = ""; this.hidTSXX.Value = ""; this.drpCK.Items.Clear(); this.drpCopyGG.Items.Clear(); this.drpCopyGG.Text = ""; this.drpGG.Items.Clear(); this.drpGG.Text = ""; this.drpRKPH.Items.Clear(); this.drpRKPH.Text = ""; this.drpRKSX.Items.Clear(); this.drpTSXX.Items.Clear(); this.drpTSXX.Text = ""; this.chkCK.Checked = false; this.chkGG.Checked = false; this.chkHW.Checked = false; this.chkRKPCH.Checked = false; this.chkRKPH.Checked = false; this.chkRKRQ.Checked = false; this.chkRKSX.Checked = false; this.chkTM.Checked = false; this.chkTSXX.Checked = false; this.chkWLH.Checked = false; this.chkFree1.Checked = false; this.chkFree2.Checked = false; this.chkFree3.Checked = false; this.grvKC_HW.DataSource = null; this.grvKC_PCH.DataSource = null; this.grvKC_TM.DataSource = null; this.grvKC_WLH.DataSource = null; this.grvKC_PCH.DataBind(); this.grvKC_TM.DataBind(); this.grvKC_HW.DataBind(); this.grvKC_WLH.DataBind(); PageControl1.SetInitView(0, 0); PageControl2.SetInitView(0, 0); PageControl3.SetInitView(0, 0); PageControl4.SetInitView(0, 0); }
//设置分页控件显示 private void SetPageCountView() { try { string sql = GetSqlTHD(); int outCount; int pageCount = THDQuery.GetPageCount(sql, PageControl2.GetPageSize(), out outCount); PageControl2.SetInitView(pageCount, outCount); } catch { this.PrintfError("数据访问错误,请重试!"); return; } }
private void SetPageCountView2() { try { string sqlWhere = GetSqlStr(); int outCount; int pageCount = PICIQuery.GetPageCount2(sqlWhere, PageControl2.GetPageSize(), out outCount); PageControl2.SetInitView(pageCount, outCount); } catch { this.PrintfError("数据访问错误,请重试!"); return; } }
//绑定 private void BindgrvCKJL() { try { string sql = GetSqlStr(); DataSet ds = PICIQuery.GetCKJL(sql, "", PageControl2.GetPageSize(), PageControl2.GetCurrPage()); this.grvCKJL.DataSource = ds; this.grvCKJL.DataBind(); } catch (Exception ex) { String strEx = ex.Message; this.PrintfError("数据访问错误,请重试!"); } }
//帮定grvTHD private void BindGridView() { try { string sql = GetSqlTHD(); string sortEx = this.grvTHD.Attributes["SortExpression"]; string sortDirect = this.grvTHD.Attributes["SortDirection"]; string strSort = (!string.IsNullOrEmpty(sortEx)) ? sortEx + " " + sortDirect : ""; DataSet ds = THDQuery.GetQueryTHD(sql, strSort, PageControl2.GetPageSize(), PageControl2.GetCurrPage()); this.grvTHD.DataSource = ds; this.grvTHD.DataBind(); this.SetDisplayList1.InitSetListControl(this.grvTHD, SysBaseConfig.THD_Q_PAGE); this.SetDisplayList1.SetGridViewDisplay(grvTHD); } catch (Exception ex) { String strEx = ex.Message; this.PrintfError("数据访问错误,请重试!"); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BodyScore)); this.查询条件 = new System.Windows.Forms.GroupBox(); this.dateTimePicker4 = new System.Windows.Forms.DateTimePicker(); this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker(); this.dateTimePicker2 = new System.Windows.Forms.TextBox(); this.dateTimePicker1 = new System.Windows.Forms.TextBox(); this.userName = new System.Windows.Forms.TextBox(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.btnClear = new System.Windows.Forms.Button(); this.btnQuery = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); this.pageCtrl = new LoginFrame.PageControl2(); this.label5 = new System.Windows.Forms.Label(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label6 = new System.Windows.Forms.Label(); this.查询条件.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // 查询条件 // this.查询条件.Controls.Add(this.comboBox2); this.查询条件.Controls.Add(this.label6); this.查询条件.Controls.Add(this.userName); this.查询条件.Controls.Add(this.comboBox1); this.查询条件.Controls.Add(this.label2); this.查询条件.Controls.Add(this.label1); this.查询条件.Controls.Add(this.btnClear); this.查询条件.Controls.Add(this.btnQuery); resources.ApplyResources(this.查询条件, "查询条件"); this.查询条件.Name = "查询条件"; this.查询条件.TabStop = false; // // dateTimePicker4 // resources.ApplyResources(this.dateTimePicker4, "dateTimePicker4"); this.dateTimePicker4.Name = "dateTimePicker4"; this.dateTimePicker4.ValueChanged += new System.EventHandler(this.dateTimePicker4_ValueChanged); // // dateTimePicker3 // resources.ApplyResources(this.dateTimePicker3, "dateTimePicker3"); this.dateTimePicker3.Name = "dateTimePicker3"; this.dateTimePicker3.ValueChanged += new System.EventHandler(this.dateTimePicker3_ValueChanged); // // dateTimePicker2 // resources.ApplyResources(this.dateTimePicker2, "dateTimePicker2"); this.dateTimePicker2.Name = "dateTimePicker2"; // // dateTimePicker1 // resources.ApplyResources(this.dateTimePicker1, "dateTimePicker1"); this.dateTimePicker1.Name = "dateTimePicker1"; // // userName // resources.ApplyResources(this.userName, "userName"); this.userName.Name = "userName"; // // comboBox1 // this.comboBox1.FormattingEnabled = true; resources.ApplyResources(this.comboBox1, "comboBox1"); this.comboBox1.Name = "comboBox1"; // // label4 // resources.ApplyResources(this.label4, "label4"); this.label4.Name = "label4"; // // label3 // resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // // label2 // resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; // // label1 // resources.ApplyResources(this.label1, "label1"); this.label1.Name = "label1"; // // btnClear // this.btnClear.FlatAppearance.BorderSize = 0; resources.ApplyResources(this.btnClear, "btnClear"); this.btnClear.Name = "btnClear"; this.btnClear.UseVisualStyleBackColor = true; this.btnClear.Click += new System.EventHandler(this.btnClear_Click); // // btnQuery // this.btnQuery.FlatAppearance.BorderSize = 0; resources.ApplyResources(this.btnQuery, "btnQuery"); this.btnQuery.Name = "btnQuery"; this.btnQuery.UseVisualStyleBackColor = true; this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click); // // panel1 // this.panel1.Controls.Add(this.pageCtrl); resources.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; // // pageCtrl // this.pageCtrl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pageCtrl.Cols = new string[0]; this.pageCtrl.CurPage = 1; resources.ApplyResources(this.pageCtrl, "pageCtrl"); this.pageCtrl.Name = "pageCtrl"; this.pageCtrl.PageSize = 15; this.pageCtrl.StartIndex = 0; this.pageCtrl.TotalPage = 1; this.pageCtrl.TotalRecord = 0; this.pageCtrl.Widths = new int[0]; this.pageCtrl.Load += new System.EventHandler(this.pageControl2_Load); // // label5 // resources.ApplyResources(this.label5, "label5"); this.label5.Name = "label5"; // // comboBox2 // this.comboBox2.FormattingEnabled = true; resources.ApplyResources(this.comboBox2, "comboBox2"); this.comboBox2.Name = "comboBox2"; // // label6 // resources.ApplyResources(this.label6, "label6"); this.label6.Name = "label6"; // // BodyScore // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.Controls.Add(this.dateTimePicker4); this.Controls.Add(this.label5); this.Controls.Add(this.dateTimePicker3); this.Controls.Add(this.panel1); this.Controls.Add(this.dateTimePicker2); this.Controls.Add(this.dateTimePicker1); this.Controls.Add(this.查询条件); this.Controls.Add(this.label3); this.Controls.Add(this.label4); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "BodyScore"; this.Load += new System.EventHandler(this.BodyScore_Load); this.查询条件.ResumeLayout(false); this.查询条件.PerformLayout(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }