using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.ZGMil.Entity; using Core.StlMes.Client.ZGMil.ResultConrtrol; using Core.StlMes.Client.ZGMil.Signature; using CoreFS.CA06; 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.Result { public partial class FrmMeasurePrint : FrmBase { private string departm = ""; private string plineCode = ""; private string userName = ""; private string proPlanId = null;//轧管订单编号 private string gxPlanNo = null;//工序排产序号 public FrmMeasurePrint() { InitializeComponent(); this.IsLoadUserView = true; } private void FrmMeasurePrint_Load(object sender, EventArgs e) { cmbDate.Value = DateTime.Parse(DateTime.Today.ToString()); NativeMethodNew na = new NativeMethodNew(this.ob); userName = UserInfo.GetUserName(); departm = UserInfo.GetDepartment(); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); DateTime now = DateTime.Now; DateTime date = new DateTime(now.Year, now.Month, 1); cmbDate.Value = DateTime.Parse(date.ToString("yyyy-MM-dd")); cmbEndDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": doQuery(); break; case "Print": PrintData(); break; case "Close": this.Close(); break; } } /// /// 查询 /// private void doQuery() { string date = ""; string endDate = ""; string JudgeStoveNo = ""; 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(); } } List listSource = EntityHelper.GetData( "com.steering.mes.zgmil.report.FrmMilDateStatistics.doQueryZyJgxM", new object[] { date, endDate, JudgeStoveNo }, this.ob); bindingSource1.DataSource = listSource; GridHelper.RefreshAndAutoSize(this.ultraGrid1); } /// /// 打印 /// private void PrintData() { string HeatPlanNo = this.ultraGrid1.ActiveRow.Cells["HeatPlanNo"].Value.ToString(); string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMchMeasurePrint.cpt&op=view" + "&HEAT_PLAN_NO=" + HeatPlanNo; FrmRepExcel fre = new FrmRepExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 查询条件 /// /// /// 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 (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { List listSource = EntityHelper.GetData( "com.steering.mes.zgmil.report.FrmMilDateStatistics.doQueryPortMchBatchSampleResult", new object[] { this.ultraGrid1.ActiveRow.Cells["HeatPlanNo"].Value.ToString() }, this.ob); bindingSource2.DataSource = listSource; GridHelper.RefreshAndAutoSize(this.ultraGrid2); } } }