protected override int Query( ) { strWhere = "1=1"; if (!string.IsNullOrEmpty(txtMAI002.Text)) { strWhere += " AND MAI002='" + txtMAI002.Text + "'"; } if (!string.IsNullOrEmpty(txtMAI003.Text)) { strWhere += " AND MAI003='" + txtMAI003.Text + "'"; } if (!string.IsNullOrEmpty(txtMAI001.Text)) { strWhere += " AND MAI001='" + txtMAI001.Text + "'"; } tableView = _bll.getTableView(strWhere); gridControl1.DataSource = tableView; gridView1.OptionsBehavior.Editable = false; QueryTool( ); toolPrint.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; idxList.Clear( ); return(base.Query( )); }
protected override int Query( ) { if (string.IsNullOrEmpty(txtDEL015.Text) && string.IsNullOrEmpty(txtRAA001.Text) && string.IsNullOrEmpty(txtRAA015.Text)) { XtraMessageBox.Show("请选择配方单号或订单号和主件品号"); return(0); } if (!string.IsNullOrEmpty(txtDEL015.Text)) { txtDEL015.Tag = txtDEL015.Text; strWhere = "1=1"; strWhere += " AND DEL015='" + txtDEL015.Text + "'"; } else { if (string.IsNullOrEmpty(txtRAA001.Text)) { XtraMessageBox.Show("请选择订单号"); return(0); } if (string.IsNullOrEmpty(txtRAA015.Text)) { XtraMessageBox.Show("请选择主件品号"); return(0); } strWhere = "1=1"; strWhere += " AND DEL016='" + txtDEA002.Text + "' AND DEL017='" + txtRAA001.Text + "' AND DEL018='" + txtDEL018.Text + "'"; } cancelWhere = strWhere; tableView = _bll.getTableView(strWhere); gridControl1.DataSource = tableView; if (tableView == null || tableView.Rows.Count < 1) { return(0); } //editState = tableView . Rows [ 0 ] [ "LIA961" ] . ToString ( ); txtDEL015.Tag = txtDEL015.Text = tableView.Rows [0] ["DEL015"].ToString( ); txtDEL013.Text = tableView.Rows [0] ["DEL013"].ToString( ); btn.Text = string.IsNullOrEmpty(tableView.Rows [0] ["DEL014"].ToString( )) == true ? "审核" : (Convert.ToBoolean(tableView.Rows [0] ["DEL014"].ToString( )) == true ? "反审核" : "审核"); txtRAA001.EditValue = txtRAA001.Text = tableView.Rows [0] ["DEL017"].ToString( ); //txtRAA015 . EditValue = txtRAA015 . Text = tableView . Rows [ 0 ] [ "DEL011" ] . ToString ( ); txtDEL018.EditValue = txtDEL018.Text = string.Empty; txtDEL018.EditValue = txtDEL018.Text = tableView.Rows [0] ["DEL018"].ToString( ); QueryTool( ); toolPrint.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; toolExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; txtDEL015.Enabled = true; btn.Enabled = true; if (btn.Text.Equals("反审核")) { toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; } else { toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; } //getQueryForColumn ( ); return(base.Query( )); }
protected override int Query( ) { if (string.IsNullOrEmpty(txtRAA001.Text) && string.IsNullOrEmpty(txtDEL015.Text)) { XtraMessageBox.Show("请选择订单号或配方单号"); return(0); } if (!string.IsNullOrEmpty(txtRAA001.Text) && string.IsNullOrEmpty(txtDEA002.Text)) { XtraMessageBox.Show("请选择主件品号"); return(0); } strWhere = "1=1"; if (!string.IsNullOrEmpty(txtDEL015.Text)) { strWhere += " AND DEL015='" + txtDEL015.Text + "'"; } else { if (!string.IsNullOrEmpty(txtRAA001.Text)) { strWhere += " AND DEL017='" + txtRAA001.Text + "'"; } if (!string.IsNullOrEmpty(txtDEA002.Text)) { strWhere += " AND DEL016='" + txtDEA002.Text + "'"; } if (!string.IsNullOrEmpty(txtDEL018.Text)) { strWhere += " AND DEL018='" + txtDEL018.Text + "'"; } } tableView = _bll.getTableView(strWhere); gridControl1.DataSource = tableView; if (tableView == null || tableView.Rows.Count < 1) { return(0); } txtRAA001.EditValue = txtRAA001.Text = tableView.Rows [0] ["DEL017"].ToString( ); //txtRAA015 . EditValue = txtRAA015 . Text = tableView . Rows [ 0 ] [ "DEL011" ] . ToString ( ); txtDEL018.EditValue = txtDEL018.Text = string.Empty; txtDEL018.EditValue = txtDEL018.Text = tableView.Rows [0] ["DEL018"].ToString( ); //txtDEA002 . Text = tableView . Rows [ 0 ] [ "DEL016" ] . ToString ( ); txtDEL013.Text = tableView.Rows [0] ["DEL013"].ToString( ); string txtExamin = tableView.Rows [0] ["DEL014"].ToString( ); layoutControlItem13.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; if (string.IsNullOrEmpty(txtExamin)) { btn.Text = "审核"; } else { if (txtExamin.Equals("True")) { btn.Text = "反审核"; layoutControlItem13.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; } else { btn.Text = "审核"; layoutControlItem13.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; } } QueryTool( ); toolPrint.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; toolExport.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; return(base.Query( )); }