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 CoreFS.SA06; 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 QcmZcCheckconsignGroupCtrl : UserControl { private OpeBase _ob; private JudgeType _judgeType; private Dal _d; private string _processCode = ""; private string _lotNo = ""; private string _judgeStoveNo = ""; private string _judgeState = ""; private string _judgeTimeB = ""; private string _judgeTimeE = ""; private string[] _plines = new string[]{}; private string _chemType = ""; private string _gpSource = ""; private string _checkNo = ""; private string _isCheck = ""; private string _judgeTimeStart = ""; private string _judgeTimeEnd = ""; private CoreUserInfo _UserInfo; public QcmZcCheckconsignGroupCtrl(Control container, OpeBase ob, JudgeType judgeType, CoreUserInfo UserInfo) { InitializeComponent(); this._ob = ob; _judgeType = judgeType; _UserInfo = UserInfo; container.Controls.Add(this); this.Dock = DockStyle.Fill; this.BringToFront(); _d = new Dal(ob); ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, false); //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格 DataTable dt = (DataTable)ultraComboEditor1.DataSource; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["BASECODE"].ToString() != "40740101" && dt.Rows[i]["BASECODE"].ToString() != "40740102") { dt.Rows[i].Delete(); } } dt.AcceptChanges(); ClsBaseInfo.SetComboItemHeight(ultraComboEditor1); ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407402", ob, false); ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false); ClsBaseInfo.FillComBaseInfo(ultraComboEditor4, "407404", ob, false); ClsBaseInfo.FillComBaseInfo(ultraComboEditor5, "407406", ob, false); if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山,贾忠良,陈宇,冯丽君,宋丹".Contains(_UserInfo.GetUserName())) { ultraGrid1.DisplayLayout.Bands[0].Columns["lotNo"].EditorComponent = null; } } public void Query(string lotNo, string judgeStoveNo, string judgeState, string judgeTimeB, string judgeTimeE, string[] plines, string chemType, string gpSource, string processCode, string checkNo, string isCheck, string judgeTimeStart,string judgeTimeEnd) { _lotNo = lotNo; _judgeStoveNo = judgeStoveNo; _judgeState = judgeState; _judgeTimeB = judgeTimeB; _judgeTimeE = judgeTimeE; _plines = plines; _chemType = chemType; _gpSource = gpSource; _processCode = processCode; _checkNo = checkNo; _isCheck = isCheck; _judgeTimeStart = judgeTimeStart; _judgeTimeEnd = judgeTimeEnd; DataTable dt = _d.GetTableByXmlId("JdgQcmZcCheckconsign.groupQuery", lotNo, judgeStoveNo, judgeState, judgeTimeB, judgeTimeE, plines.Length, plines, chemType, gpSource, processCode, checkNo, isCheck, judgeTimeStart, judgeTimeEnd); GridHelper.CopyDataToDatatable(dt, dataTable1, true); GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo", "judgeMemo"); } public void Clear() { dataTable1.Clear(); } private void ultraTextEditor2_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_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { e.Cell.Row.Update(); } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { Color red = Color.FromArgb(255, 106, 106); Color blue = Color.FromArgb(135, 206, 250); if (e.Row.GetValue("checkResult") == "不合格") { e.Row.RowSelectorAppearance.BackColor = red; } if (e.Row.GetValue("sampleType") == "复验") { e.Row.Cells["sampleType"].Appearance.BackColor = blue; } } FormFileDown askDown; private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (e.Button.Key.Equals("1")) { string filePath = ultraGrid1.ActiveRow.GetValue(ultraGrid1.ActiveCell.Column.Key.Replace("craftNo", "craftPath")); askDown = new FormFileDown(_ob, filePath); askDown.DeleteButton.Visible = false; askDown.Show(); } else { try { var row = ultraGrid1.ActiveRow; CraftSelect craftSelect = new CraftSelect(_ob); string ordLnDlyPk = row.Cells["ordLnDlyPk"].Text.ToString(); string judgeStoveNo = row.Cells["judgeStoveNo"].Text.ToString(); string checkNo = row.Cells["checkNo"].Text.ToString(); //string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3).ToString(); craftSelect.Query(ordLnDlyPk); if (craftSelect.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UltraGridRow ugrow = craftSelect.row; string craftSeq = ugrow.Cells["craftSeq"].Value.ToString(); string craftNo = ugrow.Cells["craftNo"].Value.ToString(); String[] parm = new String[] { craftSeq, craftNo, judgeStoveNo, checkNo, _processCode }; ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateJhyCraftNo", new object[] { parm }, _ob); Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB,_judgeTimeE, _plines, _chemType, _gpSource, _processCode, _checkNo, _isCheck, _judgeTimeStart,_judgeTimeEnd); } } catch (Exception ex) { MessageUtil.ShowTips(ex.Message); } } } private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (e.Button.Key.Equals("bj")) { //if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName())) //{ // throw new Exception("您没有该权限!"); //} PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var row = ultraGrid1.ActiveRow; string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString(); string checkNo = row.Cells["checkNo"].Value.ToString(); String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id","2" }; ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcLotNoGroup", new object[] { parm }, _ob); Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB, _judgeTimeE, _plines, _chemType, _gpSource, _processCode, _checkNo, _isCheck, _judgeTimeStart, _judgeTimeEnd); } return; } LotNoGroupInfoQueryFrm frm = new LotNoGroupInfoQueryFrm(ultraGrid1.GetActiveRowValue("lotNo"), _d.Ob); frm.ShowDialog(); } private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山,贾忠良,陈宇,冯丽君,宋丹".Contains(_UserInfo.GetUserName())) { ultraGrid1.DisplayLayout.Bands[0].Columns["lotNo"].EditorComponent = null; } PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var row = ultraGrid1.ActiveRow; string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString(); string checkNo = row.Cells["checkNo"].Value.ToString(); String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id","1" }; ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcLotNo", new object[] { parm }, _ob); Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB, _judgeTimeE, _plines, _chemType, _gpSource, _processCode, _checkNo, _isCheck, _judgeTimeStart, _judgeTimeEnd); } } private void ultraTextCic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName())) { throw new Exception("您没有该权限!"); } PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var row = ultraGrid1.ActiveRow; string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString(); string checkNo = row.Cells["checkNo"].Value.ToString(); String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "1" }; ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcCic", new object[] { parm }, _ob); ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim(); ultraGrid1.ActiveRow.Update(); } } private void ultraTextPic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName())) { throw new Exception("您没有该权限!"); } PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 40); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var row = ultraGrid1.ActiveRow; string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString(); string checkNo = row.Cells["checkNo"].Value.ToString(); String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "1" }; ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcPic", new object[] { parm }, _ob); ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim(); ultraGrid1.ActiveRow.Update(); } } } }