using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Judge.Commons; using Core.StlMes.Client.Judge.Forms; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Data; using System.Drawing; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Controls { public partial class QcmGpJudgeApplyCtrl : UserControl { private Dal _d; private OpeBase _ob; public QcmGpJudgeApplyCtrl(Control container, OpeBase ob, JudgeType judgeType) { InitializeComponent(); _d = new Dal(ob); _ob = ob; container.Controls.Add(this); this.Dock = DockStyle.Fill; this.BringToFront(); string strJudgeType = ((int)judgeType).ToString(); if (!strJudgeType.EndsWith("1") && !strJudgeType.EndsWith("3")) { GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Chem_Result_Desc"); } if (!strJudgeType.EndsWith("2") && !strJudgeType.EndsWith("3")) { GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Phy_Result_Desc"); } if (!strJudgeType.EndsWith("3")) { GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Judge_Result"); } this.ultraGrid1.DisplayLayout.Bands[0].Columns["stoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always; //初始化下拉框 ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407402", ob, false); ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false); ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407406", ob, false); } public void Query(string applyTimeBegin, string applyTimeEnd, string proOrderNo, string stoveNo, string isJudge) { DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QueryP", applyTimeBegin, applyTimeEnd, proOrderNo, stoveNo, isJudge); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2"); } public void QuerySteelMakingP(string stoveNo, string judgeStoveNo, string applyTimeBegin, string applyTimeEnd, string proOrderNo, string isJudge, string[] plines, string gpSource, string[] plinesGp, string customInfo) { DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QuerySteelMakingP", applyTimeBegin, applyTimeEnd, proOrderNo, stoveNo, judgeStoveNo, plines.Length, plines, isJudge, gpSource, plinesGp.Length, plinesGp, customInfo); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2"); } public void QuerySteelMakingP(string stoveNo,string customInfo) { DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QuerySteelMakingP", "", "", "", stoveNo, "", "0", new string[0], "", "", "0", "", customInfo); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2"); } public void ClearData() { dataTable1.Clear(); } private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { e.Cell.Row.Update(); } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim(); ultraGrid1.ActiveRow.Update(); } } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { Color yellow = Color.FromArgb(238, 238, 0); Color red = Color.FromArgb(255, 106, 106); Color green = Color.FromArgb(60, 179, 113); if (e.Row.GetValue("judgeResultCode").Equals("40740701") || e.Row.GetValue("judgeResultCode").Equals("40740702") || e.Row.GetValue("judgeResultCode").Equals("40740706")) { //e.Row.Appearance.BackColor = green; } else if (e.Row.GetValue("judgeResultCode").Equals("40740704") || e.Row.GetValue("judgeResultCode").Equals("40740705")) { e.Row.RowSelectorAppearance.BackColor = red; } } private void ultraGrid1_MouseUp(object sender, MouseEventArgs e) { foreach (UltraGridRow row in ultraGrid1.Rows) { if (row.Selected) { row.Cells["CHK"].Value = true; } } ultraGrid1.UpdateData(); } private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { try { this.Cursor = Cursors.WaitCursor; var row = ultraGrid1.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(_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; } } } }