| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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 Infragistics.Win.UltraWinGrid;
- using System;
- using System.Data;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Controls
- {
- public partial class QcmJhyPassConfigCtrl : UserControl
- {
- private Dal _d;
- public QcmJhyPassConfigCtrl(Control container, OpeBase ob)
- {
- InitializeComponent();
- container.Controls.Add(this);
- this.Dock = DockStyle.Fill;
- this.BringToFront();
- _d = new Dal(ob);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407407", ob, false);
- DataTable dt = (DataTable)ultraComboEditor1.DataSource;
- dt.DefaultView.RowFilter = "BASECODE IN ('40740704', '40740708', '0')";
- DataRow dr = dt.NewRow();
- dr["BASECODE"] = "0";
- dr["BASENAME"] = "未判";
- dt.Rows.InsertAt(dr, 0);
- DataTable dtProcess = _d.GetTableByXmlId("JdgComBaseProcess.QueryProcessInfo");
- ultraComboEditor2.DisplayMember = "processDesc";
- ultraComboEditor2.ValueMember = "processCode";
- dtProcess.DefaultView.RowFilter = "processCode in ('D', 'E', 'F', 'G', '0') ";
- DataRow drProcess = dtProcess.NewRow();
- drProcess["processCode"] = "0";
- drProcess["processDesc"] = "成品";
- dtProcess.Rows.InsertAt(drProcess, 0);
- ultraComboEditor2.DataSource = dtProcess;
- }
- public void Query()
- {
- DataTable dt = _d.GetTableByXmlId("JdgQcmJhyPassConfig.Query");
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- //GridHelper.RefreshAndAutoSize(ultraGrid1);
- foreach (var row in ultraGrid1.Rows)
- {
- ControlEdit(row);
- }
- }
- private void ControlEdit(UltraGridRow row)
- {
- if (row.GetValue("auditStep") == "")
- {
- row.Cells["judgeResult"].Activation = Activation.AllowEdit;
- row.Cells["type"].Activation = Activation.AllowEdit;
- }
- else
- {
- row.Cells["judgeResult"].Activation = Activation.ActivateOnly;
- row.Cells["type"].Activation = Activation.ActivateOnly;
- }
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- var row = ultraGrid1.ActiveRow;
- DataTable dt = _d.GetTableByXmlId("JdgCoreAppDepartment.Query");
- dt.Columns["unitDesc"].Caption = "审核科室";
- dt.Columns["departDesc"].Caption = "审核部门";
- BaseInfoPopup popup = new BaseInfoPopup(dt, "unitDesc", "unitCode");
- popup.LabelTextBox1.Caption = "审核科室";
- if (popup.ShowDialog() == DialogResult.OK)
- {
- row.SetValue("auditUnit", popup.ChoicedRow.GetValue("unitCode"));
- row.SetValue("auditUnitDesc", popup.ChoicedRow.GetValue("unitDesc"));
- row.SetValue("auditDepart", popup.ChoicedRow.GetValue("departDesc"));
- row.Update();
- }
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- e.Cell.Row.Update();
- ControlEdit(e.Cell.Row);
- }
- }
- }
|