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; using Infragistics.Win; namespace Core.StlMes.Client.Judge.Controls { public partial class QcmBcPassConfigCtrl : UserControl { private Dal _d; public QcmBcPassConfigCtrl(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; ValueList list = new ValueList(); ValueListItem[] items = new ValueListItem[] { new ValueListItem("0", "天管"), new ValueListItem("1", "天淮"), }; list.ValueListItems.AddRange(items); ultraGrid1.DisplayLayout.Bands[0].Columns["seamArea"].ValueList = list; } public void Query() { DataTable dt = _d.GetTableByXmlId("JdgQcmBcPassConfig.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); } } }