using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using System.Collections; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmBcPipeManage.Entity; namespace Core.StlMes.Client.YdmBcPipeManage { public partial class FrmStoreSummary : FrmBase { public FrmStoreSummary() { InitializeComponent(); } ArrayList alistChecked = null; private string[] arr = null;//仓库权限 private string[] belongArr = null;//所属权权限 private void FrmStoreSummary_Load(object sender, EventArgs e) { DateTime now = DateTime.Now; DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天 DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天 this.RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00"); this.RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59"); //getStoreAll(); DateTime d1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); dataYearMoth.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM")); InitBindColumn(); arr = BaseMethod.WarehousePermissionsStore(this.ValidDataPurviewIds, ob); belongArr = this.ValidDataPurviewIds; EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); ultraGrid1.DisplayLayout.Bands[0].Columns["OrderTypDesc"].Hidden = false; try { alistChecked = new ArrayList(); alistChecked.Add("StoveNo"); alistChecked.Add("JudgeStoveNo"); alistChecked.Add("MaterialName"); alistChecked.Add("ProcessDesc"); //alistChecked.Add("FixLen"); } catch { } try { ArrayList alist = new ArrayList(); alist.Add("ActCount"); alist.Add("ActWeight"); alist.Add("ActLen"); CommonMethod.GeneralCheckedListboxItems(ref this.myCheckedListBox1, ref this.ultraGrid1, alist, alistChecked); } catch { } } /// /// 字段绑定 /// private void InitBindColumn() { //材料状态 this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出等待"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编计划(发运控制)"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编计划(发运控制)"); this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂"); //材料类别 this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品"); this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品"); this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品"); DataTable ds = ClsLoad.GetValueListDataTable("8014", this.ob); this.ultraGrid1.DisplayLayout.Bands[0].Columns["ProductFlag"].ValueList = ClsLoad.GeneralValuelist(ref ds, "BASECODE", "BASENAME"); string[] arr = new string[3] { "801501", "801502", "801503" }; DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob); this.ultraGrid1.DisplayLayout.Bands[0].Columns["MatStatus"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME"); } /// /// 获取仓库 /// //private void getStoreAll() //{ // string storeNo = "800201"; // string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo, this.ValidDataPurviewIds, this.ob); // DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.Stuffmanage.FrmStuffBase.getStoreAll", new object[] { storeNo, arr }, this.ob); // if (dt.Rows.Count > 0) // { // cmbStorgeNo.DataSource = dt; // cmbStorgeNo.DisplayMember = "STORAGE_NAME"; // cmbStorgeNo.ValueMember = "STORAGE_NO"; // } //} /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": QueryData(); break; case "Export": ExportData(); break; case "Close": this.Close(); break; } } /// /// 查询 /// private void QueryData() { List listSource = null; if (chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text.Trim())) { MessageUtil.ShowTips("请输入熔炼炉号!"); this.txtStoveNo.Focus(); return; } if (chkJudgeNo.Checked && string.IsNullOrEmpty(this.txtJudgeNo.Text.Trim())) { MessageUtil.ShowTips("请输入判定炉号!"); this.txtJudgeNo.Focus(); return; } if (this.chkFlagStoveNo.Checked && string.IsNullOrEmpty(this.txtFlagStoveNo.Text.Trim())) { MessageUtil.ShowTips("请输入标识炉号!"); this.txtJudgeNo.Focus(); return; } string stoveNo = ""; string judgeNo = ""; string flagStoveNo = ""; string orderNo = ""; string dtStartTime = ""; string dtEndTime = ""; ArrayList list = new ArrayList(); string strSql = ""; string strGroup = ""; string strOut = ""; string bathYear = ""; if (chkStoveNo.Checked) { stoveNo = this.txtStoveNo.Text.Trim(); strOut += " AND T1.STOVE_NO = '" + stoveNo + "'"; } if(chkJudgeNo.Checked) { judgeNo = this.txtJudgeNo.Text.Trim(); strOut += " AND T1.JUDGE_STOVE_NO = '" + judgeNo + "'"; } if(chkFlagStoveNo.Checked) { flagStoveNo = this.txtFlagStoveNo.Text.Trim(); strOut += " AND T1.FLAG_STOVE_NO_ZG = '" + flagStoveNo + "'"; } if (chkOrder.Checked) { orderNo = this.txtOrder.Text.Trim(); strOut += " AND T1.PRO_ORDER_NO LIKE '%" + orderNo + "%'"; } if(chkRegTime.Checked) { dtStartTime = this.RegStartTime.Value.ToString(); dtEndTime = this.RegEndTime.Value.ToString(); strOut += " AND T1.INSTOCK_TIME >= to_date('" + dtStartTime + "', 'yyyy-MM-dd HH24:mi:ss') and T1.INSTOCK_TIME < =to_date('" + dtEndTime + "', 'yyyy-MM-dd HH24:mi:ss')"; } if(chkYearMoth.Checked) { bathYear = this.dataYearMoth.Value.ToString("yyyyMM"); strOut += " AND T1.BAL_YEAR_MONTH = '" + bathYear + "'"; } string strKey = ""; CheckBox item; for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++) { try { item = this.myCheckedListBox1.Controls[i] as CheckBox; if (item != null && item.Checked) { strKey = item.Name; if (strKey.Equals("StoveNo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.STOVE_NO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.STOVE_NO"; } else if (strKey.Equals("FlagStoveNoZg")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.FLAG_STOVE_NO_ZG"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.FLAG_STOVE_NO_ZG"; } else if (strKey.Equals("JudgeStoveNo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_STOVE_NO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_STOVE_NO"; } else if (strKey.Equals("BatchNo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.BATCH_NO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.BATCH_NO"; } else if (strKey.Equals("BatchGroudNo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.Batch_Groud_No"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.Batch_Groud_No"; } else if (strKey.Equals("MaterialName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.MATERIAL_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.MATERIAL_NAME"; } else if (strKey.Equals("Producname")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.PRODUCNAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.PRODUCNAME"; } else if (strKey.Equals("Gradename")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.GRADENAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.GRADENAME"; } else if (strKey.Equals("Steelname")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.STEELNAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.STEELNAME"; } else if (strKey.Equals("StdName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.STD_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.STD_NAME"; } else if (strKey.Equals("StdStyleDesc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.STD_STYLE_DESC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.STD_STYLE_DESC"; } else if (strKey.Equals("SpecName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.SPEC_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.SPEC_NAME"; } else if (strKey.Equals("ModelDesc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.MODEL_DESC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.MODEL_DESC"; } else if (strKey.Equals("JudgeStdDes")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.JUDGE_STD_DES"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.JUDGE_STD_DES"; } else if (strKey.Equals("ActDimater")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.ACT_DIMATER"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ACT_DIMATER"; } else if (strKey.Equals("ActHeight")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.ACT_HEIGHT"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ACT_HEIGHT"; } else if (strKey.Equals("ActLenMin")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.ACT_LEN_MIN"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ACT_LEN_MIN"; } else if (strKey.Equals("ActLenMax")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.ACT_LEN_MAX"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ACT_LEN_MAX"; } //else if (strKey.Equals("ActLen")) //{ // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "t1.ACT_LEN"; // strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ACT_LEN"; //} else if (strKey.Equals("BelongName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.BELONG_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.BELONG_NAME"; } else if (strKey.Equals("JudgeResultCode")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T2.BASENAME FROM COM_BASE_INFO T2 WHERE T2.BASECODE = T1.JUDGE_RESULT_CODE )JUDGE_RESULT_CODE"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE"; } else if (strKey.Equals("InstockTimeS")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(TO_CHAR(T1.INSTOCK_TIME,'YYYY-MM-DD'))INSTOCK_TIME_S"; //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE"; } else if (strKey.Equals("InstockTime")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(TO_CHAR(T1.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS'))INSTOCK_TIME"; //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE"; } else if (strKey.Equals("JudgeResultTime")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(TO_CHAR(T1.JUDGE_RESULT_TIME,'YYYY-MM-DD HH24:MI:SS'))JUDGE_RESULT_TIME"; } else if (strKey.Equals("BalYearMonth")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(T1.BAL_YEAR_MONTH)BAL_YEAR_MONTH"; } else if (strKey.Equals("ProductFlag")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PRODUCT_FLAG"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PRODUCT_FLAG"; } else if (strKey.Equals("MatStatus")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MAT_STATUS"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MAT_STATUS"; } else if (strKey.Equals("PlineName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PLINE_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PLINE_NAME"; } else if (strKey.Equals("QcmStaus")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.QCM_STAUS,'00','合格','11','待处理','22','废品')QCM_STAUS"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.QCM_STAUS"; } else if (strKey.Equals("StorageName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T3.STORAGE_NAME FROM YDM_BS_STORAGE T3 WHERE T3.STORAGE_NO = T2.STORAGE_NO)STORAGE_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.STORAGE_NO"; } else if (strKey.Equals("LocationName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T4.LOCATION_NAME FROM YDM_BS_LOCATION T4 WHERE T4.LOCATION_NO = T2.LOCATION_NO)LOCATION_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LOCATION_NO"; } //else if (strKey.Equals("LocationName")) //{ // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + " T2.LOCATION_NO"; // strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LOCATION_NO"; //} //else if (strKey.Equals("LaryNo")) //{ // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T2.LARY_NO"; // strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LARY_NO"; //} else if (strKey.Equals("InputMaterialName")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.INPUT_MATERIAL_NAME"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.INPUT_MATERIAL_NAME"; } else if (strKey.Equals("ProcessDesc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PROCESS_DESC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PROCESS_DESC"; } else if (strKey.Equals("NextProcessDesc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.NEXT_PROCESS_DESC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.NEXT_PROCESS_DESC"; } else if (strKey.Equals("Target")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.TARGET"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.TARGET"; } else if (strKey.Equals("JudgeResult")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_RESULT"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT"; } else if (strKey.Equals("JudgeTolresult")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_TOLRESULT"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_TOLRESULT"; } else if (strKey.Equals("ProOrderNo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PRO_ORDER_NO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PRO_ORDER_NO"; } else if (strKey.Equals("QcmMemo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.MEMO))QCM_MEMO"; //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ"; } else if (strKey.Equals("JudgeMemo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.JUDGE_MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.JUDGE_MEMO))JUDGE_MEMO"; //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ"; }else if(strKey.Equals("Memo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MEMO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MEMO"; } else if (strKey.Equals("Pipmemo")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PIPMEMO"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PIPMEMO"; } else if (strKey.Equals("Memo1")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MEMO1"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MEMO1"; } else if (strKey.Equals("LoadPline") || strKey.Equals("IsApplyFlag")) { } else if(strKey.Equals("InBc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.IN_BC,'0','常白班','1','早','2','中','3','夜')IN_BC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.IN_BC"; } else if (strKey.Equals("InBz")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.IN_BZ,'1','甲','2','乙','3','丙','4','丁')IN_BZ"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.IN_BZ"; } else if (strKey.Equals("CustomerNm")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T2.CUSTOMER_NM FROM SLM_ORDER_HEAD T2 WHERE T2.ORD_PK = T1.ORD_PK)CUSTOMER_NM"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.ORD_PK"; } else if (strKey.Equals("OrderTypDesc")) { strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "( SELECT ORDER_TYP_DESC FROM SLM_ORDER_HEAD WHERE ORDER_NO = T1.ORDER_NO and VALIDFLAG = '1' AND ROWNUM = 1 )ORDER_TYP_DESC"; strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "t1.ORDER_NO"; } else { strSql += (string.IsNullOrEmpty(strSql) ? "t1." : ",t1.") + strKey; strGroup += (string.IsNullOrEmpty(strGroup) ? "t1." : ",t1.") + strKey; } } } catch { } } strSql += (string.IsNullOrEmpty(strSql) ? "" : ","); strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup; string _sql = strOut + strGroup; list.Add(strSql); list.Add(strOut); list.Add(strGroup); switch (this.CustomInfo) { case "STORAGE_NO": listSource = EntityHelper.GetData( "com.steering.ydm.bc.report.FrmBcStoreSummary.queryData", new object[] { list, arr }, this.ob); break; case "BELONG_CODE": listSource = EntityHelper.GetData( "com.steering.ydm.bc.report.FrmBcStoreSummary.queryDataBelong", new object[] { list, belongArr }, this.ob); break; case"A": if(!chkJudgeNo.Checked && !chkFlagStoveNo.Checked) { MessageUtil.ShowTips("请输入判断炉号或者标识炉号查询!"); return; } listSource = EntityHelper.GetData( "com.steering.ydm.bc.report.FrmBcStoreSummary.queryDataAll", new object[] { list }, this.ob); break; case "": listSource = EntityHelper.GetData( "com.steering.ydm.bc.report.FrmBcStoreSummary.queryDataAll", new object[] { list }, this.ob); break; } matBcMEntity3BindingSource.DataSource = listSource; bool bContains = false, bChecked = false; for (int i = 0; i < this.ultraGrid1.DisplayLayout.Bands[0].Columns.Count; i++) { try { bContains = false; strKey = this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Key; for (int j = 0; j < this.myCheckedListBox1.Controls.Count; j++) { try { item = this.myCheckedListBox1.Controls[j] as CheckBox; if (item.Name.Equals(strKey)) { bContains = true; bChecked = item.Checked; break; } } catch { } } if (bContains) { this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Hidden = !bChecked; } } catch { } } this.SetStaticsInfo(); CommonMethod.SetGridSumArea(this.ultraGrid1); } private void SetStaticsInfo() { try { if (this.ultraGrid1.Rows.Count == 0) { this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear(); } else { ArrayList alist = new ArrayList(); alist.Add("ActCount"); alist.Add("ActWeight"); alist.Add("ActLen"); CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true); } } catch { } } /// /// 导出 /// private void ExportData() { GridHelper.ulGridToExcel(ultraGrid1, "钢管库存汇总"); } /// /// 全选 /// /// /// private void myLinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.myCheckedListBox1.CheckAll(); } /// /// 清除 /// /// /// private void myLinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.myCheckedListBox1.UnCheckAll(); } /// /// 默认 /// /// /// private void myLinkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { CheckBox items; for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++) { try { items = this.myCheckedListBox1.Controls[i] as CheckBox; if (alistChecked.Contains(items.Name)) { items.Checked = true; } else { items.Checked = false; } } catch { } } } private void cbx_GroupBy_CheckedChanged(object sender, EventArgs e) { CommonMethod.SetGridGroupBy(ref this.ultraGrid1, cbx_GroupBy.Checked); CommonMethod.SetGridSumArea(this.ultraGrid1); } private void chkStoveNo_CheckedChanged(object sender, EventArgs e) { this.txtStoveNo.Enabled = this.chkStoveNo.Checked; } private void chkJudgeNo_CheckedChanged(object sender, EventArgs e) { this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked; } private void txtStoveNo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { QueryData(); } } private void txtJudgeNo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { QueryData(); } } private void txtOrder_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { QueryData(); } } private void chkOrder_CheckedChanged(object sender, EventArgs e) { this.txtOrder.Enabled = this.chkOrder.Checked; } private void chkFlagStoveNo_CheckedChanged(object sender, EventArgs e) { this.txtFlagStoveNo.Enabled = this.chkFlagStoveNo.Checked; } private void chkRegTime_CheckedChanged(object sender, EventArgs e) { this.RegStartTime.Enabled = this.RegEndTime.Enabled = this.chkRegTime.Checked; } private void chkYearMoth_CheckedChanged(object sender, EventArgs e) { dataYearMoth.Enabled = this.chkYearMoth.Checked; } } }