| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- 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 QcmZcCheckconsignCtrl : UserControl
- {
- private OpeBase _ob;
- private JudgeType _judgeType;
- private Dal _d;
- public QcmZcCheckconsignCtrl(Control container, OpeBase ob, JudgeType judgeType)
- {
- InitializeComponent();
- this._ob = ob;
- _judgeType = judgeType;
- container.Controls.Add(this);
- this.Dock = DockStyle.Fill;
- this.BringToFront();
- _d = new Dal(ob);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, true);
- //判定结果只显示内控合格和不合格。 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]["BASECODE"].ToString() != "")
- {
- dt.Rows[i].Delete();
- }
- }
- dt.AcceptChanges();
- ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407402", ob, true);
- DataTable dt2 = (DataTable)ultraComboEditor2.DataSource;
- dt2.DefaultView.RowFilter = "BASECODE IN ('40740201', '40740202') OR BASECODE IS NULL";
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor4, "407404", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor5, "407406", ob, false);
- }
- private string _steelStanrad = "";
- public void Query(string checkNo, string steelStanrad)
- {
- _steelStanrad = steelStanrad;
- DataTable dt = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryByCheckNo", checkNo);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "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();
- }
- FormFileDown askDown;
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- string filePath = ultraGrid1.ActiveRow.GetValue(ultraGrid1.ActiveCell.Column.Key.Replace("craftNo", "craftPath"));
- askDown = new FormFileDown(_ob, filePath);
- askDown.DeleteButton.Visible = false;
- askDown.Show();
- }
- private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- Color yellow = Color.FromArgb(255, 246, 143);
- Color red = Color.FromArgb(255, 106, 106);
- Color green = Color.FromArgb(60, 179, 113);
- if (_steelStanrad.Contains("CIC"))
- {
- if (e.Row.GetValue("chemResultCode") == "40740102")
- {
- e.Row.Cells["chemResultCode"].Appearance.BackColor = red;
- }
- else if (e.Row.GetValue("chemResultCode") == "")
- {
- e.Row.Cells["chemResultCode"].Appearance.BackColor = yellow;
- }
- }
- if (_steelStanrad.Contains("PIC"))
- {
- if (e.Row.GetValue("phyResultCode") == "40740202")
- {
- e.Row.Cells["phyResultCode"].Appearance.BackColor = red;
- }
- else if (e.Row.GetValue("phyResultCode") == "")
- {
- e.Row.Cells["phyResultCode"].Appearance.BackColor = yellow;
- }
- }
- if (e.Row.GetValue("judgeResultCode") == "40740704")
- {
- e.Row.Cells["judgeResultName"].Appearance.BackColor = red;
- }
- else if (e.Row.GetValue("judgeResultCode") == "")
- {
- e.Row.Cells["judgeResultName"].Appearance.BackColor = yellow;
- }
- }
- }
- }
|