using com.steering.mes.zgmil.entity; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.ZGMil.Common; using Core.StlMes.Client.ZGMil.Entity; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.ZGMil.Report { public partial class FrmMilDateStatistics2 : FrmBase { private string departm = ""; private string plineCode = ""; private string[] plineCodes = { }; public FrmMilDateStatistics2() { InitializeComponent(); this.IsLoadUserView = true; } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": doQuery(); break; case"CloseMilPlan": closeMilPlan(); break; case "CancelCloseMilPlan": cancelCloseMilPlan(); break; case "Refresh": doRefresh(); break; case "Print": doPrint(); break; case "Export": ExportData(); break; case "Close": this.Close(); break; } } /// /// 刷新 /// private void doRefresh() { this.ultraGrid3.UpdateData(); IQueryable checkMag = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMag.Count() == 0) { MessageUtil.ShowTips("请选择需要关闭的炉计划信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMag) { MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject; string milProcessTity = JSONFormat.Format(milProsess); parm.Add(milProcessTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics"; ccp.MethodName = "doRefresh"; ccp.ServerParams = new object[] { parm }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("刷新成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 关闭炉计划 /// private void closeMilPlan() { this.ultraGrid3.UpdateData(); IQueryable checkMag = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMag.Count() == 0) { MessageUtil.ShowTips("请选择需要关闭的炉计划信息!"); return; } ArrayList parm = new ArrayList(); foreach(UltraGridRow uRow in checkMag) { MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject; string milProcessTity = JSONFormat.Format(milProsess); parm.Add(milProcessTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics"; ccp.MethodName = "closeMilPlan"; ccp.ServerParams = new object[] { parm }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("关闭炉计划成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销关闭炉计划 /// private void cancelCloseMilPlan() { this.ultraGrid3.UpdateData(); IQueryable checkMags = this.ultraGrid3.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMags.Count() == 0) { MessageUtil.ShowTips("请选择需要撤销关闭的炉计划信息!"); return; } ArrayList parm = new ArrayList(); foreach (UltraGridRow uRow in checkMags) { MilProcessesEntity milProsess = (MilProcessesEntity)uRow.ListObject; string milProcessTity = JSONFormat.Format(milProsess); parm.Add(milProcessTity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.zgmil.report.FrmMilDateStatistics"; ccp.MethodName = "cancelCloseMilPlan"; ccp.ServerParams = new object[] { parm }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销成功!")) { doQuery(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 进程表数据查询 /// private void doQueryMilDateStatisticsBatchSample() { string date = ""; string endDate = ""; string JudgeStoveNo = ""; string LotNo = ""; string ContractNo = ""; string PlineCode = ""; int n = 0; if (chkDate.Checked) { if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0) { MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!"); return; } else { date = cmbDate.Value.ToString(); endDate = cmbEndDate.Value.ToString(); } n += 1; } if (chkJudgeStoveNo.Checked) { if (uteJudgeStoveNo.Text.Trim() == "") { JudgeStoveNo = ""; } else { JudgeStoveNo = uteJudgeStoveNo.Text.Trim().ToString(); } n += 1; } if (chkLotNo.Checked) { if (uteLotNo.Text.Trim() == "") { LotNo = ""; } else { LotNo = uteLotNo.Text.Trim().ToString(); } n += 1; } if (chkContractNo.Checked) { if (uteContractNo.Text.Trim() == "") { ContractNo = ""; } else { ContractNo = uteContractNo.Text.Trim().ToString(); } n += 1; } if (chkPlineCode.Checked) { if (cobPlineCode.Text.Trim() == "") { PlineCode = ""; } else { PlineCode = cobPlineCode.Value.ToString(); } n += 1; } if (n == 0) { MessageUtil.ShowTips("请您选择至少一个查询条件,否则会查不到数据!"); return; } WaitingForm2 wf = new WaitingForm2("正在加载,请稍候...."); try { DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSample", new Object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, plineCodes, PlineCode }, this.ob); GridHelper.CopyDataToDatatable(dt, this.dataTable1, true); GridHelper.RefreshAndAutoSize(this.ultraGrid1); //数据处理 foreach (UltraGridRow ugr in ultraGrid1.Rows) { //结炉验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 离线支 + 返线支 - 下线【实时】支 int a = Int32.Parse(ugr.Cells["YJZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["undeterminedNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["ScrapNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) + Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["HGZ12"].Value.ToString3()); if (a == 0) { ugr.Cells["Verify"].Value = "可结炉"; } else { ugr.Cells["Verify"].Value = "不可结炉"; } //平衡验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 离线支 + 返线支 - 下线支【结炉】 int b = Int32.Parse(ugr.Cells["YJZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["undeterminedNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["ScrapNum"].Value.ToString3()) - Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) + Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["XXZ"].Value.ToString3()); //离线待处理支:离线支 - 返线支 - 组炉支 - 委外废品支 int c = Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["FXZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["ZLZ"].Value.ToString3()) - Int32.Parse(ugr.Cells["WWFPZ"].Value.ToString3()); if (Int32.Parse(ugr.Cells["XXZ"].Value.ToString3()) > 0) { if (b == 0) { ugr.Cells["PH"].Value = "OK"; } else { if (Int32.Parse(ugr.Cells["LXZ"].Value.ToString3()) == 0) { ugr.Cells["PH"].Value = "清线不齐"; } else { if (c != 0) { if (b > 0) { ugr.Cells["PH"].Value = "清线不齐"; } else { ugr.Cells["PH"].Value = "返线不齐"; } } else { ugr.Cells["PH"].Value = "清线不齐"; } } } } else { ugr.Cells["PH"].Value = "无"; } //重量差 ugr.Cells["ZLC"].Value = double.Parse(ugr.Cells["YJD"].Value.ToString3()) - double.Parse(ugr.Cells["XXD"].Value.ToString3()); if (ugr.Cells["PH"].Value.ToString().Contains("线不齐")) { ugr.Appearance.BackColor = Color.IndianRed; } if (ugr.Cells["NODE_STATUS1"].Value.ToString() != "下线") { ugr.Appearance.BackColor = Color.SkyBlue; } } wf.Close(); } catch { } finally { wf.Close(); } } /// /// 静态进程表查询 /// private void doQueryMilDateStatisticsBatchSampleNew() { string date = ""; string endDate = ""; string JudgeStoveNo = ""; string LotNo = ""; string ContractNo = ""; string PlineCode = ""; int n = 0; if (chkDate1.Checked) { if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate1.Value.ToString()), DateTime.Parse(cmbEndDate1.Value.ToString())) == 0) { MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!"); return; } else { date = cmbDate1.Value.ToString(); endDate = cmbEndDate1.Value.ToString(); } n += 1; } if (chkJudgeStoveNo1.Checked) { if (uteJudgeStoveNo1.Text.Trim() == "") { JudgeStoveNo = ""; } else { JudgeStoveNo = uteJudgeStoveNo1.Text.Trim().ToString(); } n += 1; } if (chkLotNo1.Checked) { if (uteLotNo1.Text.Trim() == "") { LotNo = ""; } else { LotNo = uteLotNo1.Text.Trim().ToString(); } n += 1; } if (chkContractNo1.Checked) { if (uteContractNo1.Text.Trim() == "") { ContractNo = ""; } else { ContractNo = uteContractNo1.Text.Trim().ToString(); } n += 1; } if (chkPlineCode2.Checked) { if (cobPlineCode2.Text.Trim() == "") { PlineCode = ""; } else { PlineCode = cobPlineCode2.Value.ToString(); } n += 1; } if (n == 0) { MessageUtil.ShowTips("请您选择至少一个查询条件,否则会查不到数据!"); return; } WaitingForm2 wf = new WaitingForm2("正在加载,请稍候...."); try { List listSource = EntityHelper.GetData( "com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSampleNew", new object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, plineCodes, PlineCode }, this.ob); MilProcessesEntitybindingSource.DataSource = listSource; //DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilDateStatisticsBatchSample", new Object[] { date, endDate, JudgeStoveNo, LotNo, ContractNo, getPlineCode() }, this.ob); //GridHelper.CopyDataToDatatable(dt, this.dataTable1, true); //GridHelper.RefreshAndAutoSize(this.ultraGrid1); //数据处理 foreach (UltraGridRow ugr in ultraGrid3.Rows) { //结炉验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 委外废品支 - 离线支 + 返线支 - 下线【实时】支 int a = Int32.Parse(ugr.Cells["Yjz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Undeterminednum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Scrapnum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Wwfpz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) + Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3()); if (a == 0) { ugr.Cells["Verify"].Value = "可结炉"; } else { ugr.Cells["Verify"].Value = "不可结炉"; } //平衡验证:预计产出支 - 热轧剔除支 - 精整剔除支 - 委外废品支 - 离线支 + 返线支 - 下线支【结炉】 int b = Int32.Parse(ugr.Cells["Yjz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Undeterminednum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Scrapnum"].Value.ToString3()) - Int32.Parse(ugr.Cells["Wwfpz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) + Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3()); //离线待处理支:离线支 - 返线支 - 组炉支 int c = Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Fxz"].Value.ToString3()) - Int32.Parse(ugr.Cells["Zlz"].Value.ToString3()); if (Int32.Parse(ugr.Cells["Hgz12"].Value.ToString3()) > 0) { if (b == 0) { ugr.Cells["Ph"].Value = "OK"; } else { if (Int32.Parse(ugr.Cells["Lxz"].Value.ToString3()) == 0) { ugr.Cells["Ph"].Value = "清线不齐"; } else { if (c != 0) { if (b > 0) { ugr.Cells["Ph"].Value = "清线不齐"; } else { ugr.Cells["Ph"].Value = "返线不齐"; } } else { ugr.Cells["Ph"].Value = "清线不齐"; } } } } else { ugr.Cells["Ph"].Value = "无"; } //重量差 //ugr.Cells["ZLC"].Value = double.Parse(ugr.Cells["YJD"].Value.ToString3()) - double.Parse(ugr.Cells["XXD"].Value.ToString3()); if (ugr.Cells["Ph"].Value.ToString().Contains("线不齐")) { ugr.Appearance.BackColor = Color.IndianRed; } if (ugr.Cells["NodeStatus1"].Value.ToString() != "下线") { ugr.Appearance.BackColor = Color.SkyBlue; } } wf.Close(); } catch { } finally { wf.Close(); } } /// /// 组炉数据查询 /// private void doQueryFurnace() { string ZpJudgeStoveNo = ""; string ZpLotNo = ""; string OldJudgeStoveNo = ""; string ph = ""; string date = ""; string endDate = ""; if (ultraCheckEditor2.Checked) { if (DataTimeUtil.JudgeTime(DateTime.Parse(dateTimePicker1.Value.ToString()), DateTime.Parse(dateTimePicker2.Value.ToString())) == 0) { MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!"); return; } else { date = dateTimePicker1.Value.ToString(); endDate = dateTimePicker2.Value.ToString(); } } if (chkZpJudgeStoveNo.Checked) { if (uteZpJudgeStoveNo.Text.Trim() == "") { ZpJudgeStoveNo = ""; } else { ZpJudgeStoveNo = uteZpJudgeStoveNo.Value.ToString(); } } if (chkZpLotNo.Checked) { if (uteZpLotNo.Text.Trim() == "") { ZpLotNo = ""; } else { ZpLotNo = uteZpLotNo.Value.ToString(); } } if (chkOldJudgeStoveNo.Checked) { if (uteOldJudgeStoveNo.Text.Trim() == "") { OldJudgeStoveNo = ""; } else { OldJudgeStoveNo = uteOldJudgeStoveNo.Value.ToString(); } } if (ultraCheckEditor1.Checked) { if (ultraComboEditor1.Value.Equals("0")) { ph = "OK"; } else if (ultraComboEditor1.Value.Equals("1")) { ph = "清线不齐"; } } WaitingForm2 wf = new WaitingForm2("正在加载,请稍候...."); DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getMilOfflineGroup", new Object[] { date, endDate, ZpJudgeStoveNo, ZpLotNo, plineCodes, OldJudgeStoveNo, ph }, this.ob); GridHelper.CopyDataToDatatable(dt, this.dataTable2, true); GridHelper.RefreshAndAutoSize(this.ultraGrid2); wf.Close(); } /// /// 查询 /// private void doQuery() { if (this.ultraTabControl1.Tabs[0].Active) { doQueryMilDateStatisticsBatchSample(); } else if (this.ultraTabControl1.Tabs[1].Active) { doQueryFurnace(); }else if(this.ultraTabControl1.Tabs[2].Active) { doQueryMilDateStatisticsBatchSampleNew(); } } /// /// 打印 /// private void doPrint() { string date = ""; string endDate = ""; string JudgeStoveNo = ""; string LotNo = ""; string ContractNo = ""; if (chkDate.Checked) { if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0) { MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!"); return; } else { date = cmbDate.Value.ToString(); endDate = cmbEndDate.Value.ToString(); } } if (chkJudgeStoveNo.Checked) { if (uteJudgeStoveNo.Text.Trim() == "") { JudgeStoveNo = ""; } else { JudgeStoveNo = uteJudgeStoveNo.Value.ToString(); } } if (chkLotNo.Checked) { if (uteLotNo.Text.Trim() == "") { LotNo = ""; } else { LotNo = uteLotNo.Value.ToString(); } } if (chkContractNo.Checked) { if (uteContractNo.Text.Trim() == "") { ContractNo = ""; } else { ContractNo = uteContractNo.Value.ToString(); } } doQuery(); string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilDateStatistics.cpt&__bypagesize__=false&LOT_NO=" + LotNo + "&JUDGE_STOVE_NO=" + JudgeStoveNo + "&DATE=" + date + "&DATE2=" + endDate + "&PLINE_CODE=" + plineCode + "&CONTRACT_NO=" + ContractNo; FrmRepExcel fre = new FrmRepExcel(this.ob, url); //fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.Text = "轧管生产数据统计"; fre.ShowDialog(); } /// /// 查询条件 /// /// /// private void chkDate_CheckedChanged(object sender, EventArgs e) { if (chkDate.Checked) { cmbDate.Enabled = true; } else { cmbDate.Enabled = false; } if (chkDate.Checked) { cmbEndDate.Enabled = true; } else { cmbEndDate.Enabled = false; } if (chkLotNo.Checked) { uteLotNo.Enabled = true; } else { uteLotNo.Enabled = false; } if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; } if (chkContractNo.Checked) { uteContractNo.Enabled = true; } else { uteContractNo.Enabled = false; } if (chkOldJudgeStoveNo.Checked) { uteOldJudgeStoveNo.Enabled = true; } else { uteOldJudgeStoveNo.Enabled = false; } if (chkZpJudgeStoveNo.Checked) { uteZpJudgeStoveNo.Enabled = true; } else { uteZpJudgeStoveNo.Enabled = false; } if (chkZpLotNo.Checked) { uteZpLotNo.Enabled = true; } else { uteZpLotNo.Enabled = false; } if (ultraCheckEditor1.Checked) { ultraComboEditor1.Enabled = true; } else { ultraComboEditor1.Enabled = false; } if (ultraCheckEditor2.Checked) { dateTimePicker1.Enabled = true; } else { dateTimePicker1.Enabled = false; } if (ultraCheckEditor2.Checked) { dateTimePicker2.Enabled = true; } else { dateTimePicker2.Enabled = false; } if (chkPlineCode.Checked) { cobPlineCode.Enabled = true; } else { cobPlineCode.Enabled = false; } if (chkPlineCode2.Checked) { cobPlineCode2.Enabled = true; } else { cobPlineCode2.Enabled = false; } } private void chkDate1_CheckedChanged(object sender, EventArgs e) { this.cmbDate1.Enabled = this.cmbEndDate1.Enabled = chkDate1.Checked; } private void FrmMilDateStatistics2_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid3.DisplayLayout.Bands[0]); cmbDate.Value = DateTime.Parse(DateTime.Today.ToString()); cmbDate1.Value = DateTime.Parse(DateTime.Today.ToString()); NativeMethodNew na = new NativeMethodNew(this.ob); departm = UserInfo.GetDepartment(); plineCode = na.GetPCode(departm);//获取 用户 对应的产线 plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob); DateTime now = DateTime.Now; DateTime date = new DateTime(now.Year, now.Month, 1); cmbDate.Value = DateTime.Parse(date.ToString("yyyy-MM-dd 07:00")); cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")); cmbDate1.Value = DateTime.Parse(date.ToString("yyyy-MM-dd 07:00")); cmbEndDate1.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")); dateTimePicker1.Value = DateTime.Parse(date.ToString("yyyy-MM-dd 07:00")); dateTimePicker2.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")); //加载产线 DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilDateStatistics.getPlineNameZG", new object[] { plineCodes }, ob); if (dt != null && dt.Rows.Count > 0) { cobPlineCode.DataSource = dt; cobPlineCode.ValueMember = "PLINE_CODE"; cobPlineCode.DisplayMember = "PLINE_NAME"; cobPlineCode2.DataSource = dt; cobPlineCode2.ValueMember = "PLINE_CODE"; cobPlineCode2.DisplayMember = "PLINE_NAME"; } } /// /// 导出 /// private void ExportData() { if (this.ultraTabControl1.Tabs[0].Active) { GridHelper.ulGridToExcel(ultraGrid1, "轧管生产数据汇总"); } else if (this.ultraTabControl1.Tabs[1].Active) { GridHelper.ulGridToExcel(ultraGrid2, "组炉数据"); } else if (this.ultraTabControl1.Tabs[2].Active) { GridHelper.ulGridToExcel(ultraGrid3, "轧管生产数据汇总"); } } /// /// 非250、258、168、460的产线代码都为空 /// /// private string getPlineCode() { if (plineCode.Equals("C008") || plineCode.Equals("C009") || plineCode.Equals("C010") || plineCode.Equals("C017")) { return plineCode; } else { return ""; } } private void chkLotNo1_CheckedChanged(object sender, EventArgs e) { this.uteLotNo1.Enabled = chkLotNo1.Checked; } private void chkJudgeStoveNo1_CheckedChanged(object sender, EventArgs e) { this.uteJudgeStoveNo1.Enabled = chkJudgeStoveNo1.Checked; } private void chkContractNo1_CheckedChanged(object sender, EventArgs e) { this.uteContractNo1.Enabled = chkContractNo1.Checked; } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { if (toolMenu == null) return; if (this.ultraTabControl1.Tabs[0].Active) { if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan")) { toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan")) { toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Refresh")) { toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False; } } else if (this.ultraTabControl1.Tabs[1].Active) { if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan")) { toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan")) { toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Refresh")) { toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False; } } else { if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan")) { toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan")) { toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.True; } if (toolMenu.Toolbars[0].Tools.Exists("Refresh")) { toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.True; } } } private void FrmMilDateStatistics2_Shown(object sender, EventArgs e) { if (toolMenu == null) return; if (toolMenu.Toolbars[0].Tools.Exists("CloseMilPlan")) { toolMenu.Toolbars[0].Tools["CloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("CancelCloseMilPlan")) { toolMenu.Toolbars[0].Tools["CancelCloseMilPlan"].InstanceProps.Visible = DefaultableBoolean.False; } if (toolMenu.Toolbars[0].Tools.Exists("Refresh")) { toolMenu.Toolbars[0].Tools["Refresh"].InstanceProps.Visible = DefaultableBoolean.False; } } } }