using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Judge.Commons; using Core.StlMes.Client.Judge.Forms; using CoreFS.CA06; using System; using System.Data; using System.Drawing; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Controls { public partial class SteelMakingColligateQueryCtrl : UserControl { private Dal _d; public Dal D { get { return _d; } set { _d = value; } } public SteelMakingColligateQueryCtrl(Control container, OpeBase ob) { InitializeComponent(); _d = new Dal(ob); container.Controls.Add(this); this.Dock = DockStyle.Fill; this.BringToFront(); this.steelMakingColligateQueryGrid.DisplayLayout.Bands[0].Columns["stoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always; } public void Query(string judgeStoveNo, string judgeState, string[] plines, string timeB, string timeE, string chemType, string gpSource, string[] plinesGp, string balYearMonthh, string proTimeB, string proTimeE,String orderNo) { DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.querySteelmakingColligateQuery", judgeStoveNo, judgeState, plines.Length, plines, timeB, timeE, chemType, gpSource, plinesGp.Length, plinesGp, balYearMonthh, proTimeB, proTimeE, orderNo); GridHelper.CopyDataToDatatable(dt, dataTable1, true); Color green = Color.FromArgb(60, 179, 113); foreach (var row in steelMakingColligateQueryGrid.Rows) { if (row.GetValue("cutNum").TryParseInt() && int.Parse(row.GetValue("cutNum")) > 1) { row.Cells["judgeStoveNo"].Appearance.BackColor = green; } } GridHelper.RefreshAndAutoSize(steelMakingColligateQueryGrid); } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { Color red = Color.FromArgb(255, 106, 106); Color gray = Color.FromArgb(205, 201, 201); if (e.Row.GetValue("chemResultCode") == "40740102" || e.Row.GetValue("chemResultCode") == "40740104") { e.Row.RowSelectorAppearance.BackColor = red; } if (e.Row.GetValue("phyResultCode") == "40740204" || e.Row.GetValue("phyResultCode") == "40740205") { e.Row.RowSelectorAppearance.BackColor = red; } if (e.Row.GetValue("isFlag") == "1") { e.Row.Appearance.BackColor = gray; } } private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { try { this.Cursor = Cursors.WaitCursor; var row = steelMakingColligateQueryGrid.ActiveRow; if (row == null) { MessageUtil.ShowWarning("请选择一行记录!"); return; } string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString(); string judgeApplySeq = row.Cells["jugdeApplySqe"].Value.ToString(); string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString(); DataRow drPassApply = _d.GetRowByXmlId("QcmGpPassApplyDAL.queryByGpJudgeApplyPk", judgeApplyCode, judgeApplySeq, judgeStoveNo); if (drPassApply == null || drPassApply["type"].ToString() == "1" || drPassApply["type"].ToString() == "0" && drPassApply["auditResult2"].ToString() == "") { MessageUtil.ShowWarning("没有不合格品评审单可查看!"); return; } else { if (drPassApply["type"].ToString() == "1") { MessageUtil.ShowWarning("紧急放行!"); return; } } string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPdRejectDisposalList.cpt" + "&JUDGE_STOVE_NO=" + judgeStoveNo; FrmOrderRepExcel fBug = new FrmOrderRepExcel(_d.Ob, strurl); fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Text = "不合格品评审处置单"; fBug.Show(); } finally { this.Cursor = Cursors.Default; } } } }