using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System.Text.RegularExpressions; using System.Collections; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; namespace Core.LZMes.Client.QCM { public partial class QCM030606 : FrmBase { public string _ischk = ""; public string _noRedSendReason = ""; public string _noRedirectSendReason = ""; public string _memo = ""; private DataTable table1; private DataTable table2; public QCM030606() { InitializeComponent(); } public QCM030606(DataTable table1, DataTable table2) { this.table1 = table1; this.table2 = table2; InitializeComponent(); } private void btnOK_Click(object sender, EventArgs e) { _ischk = checkBox1.Checked ? "1" : "0"; _noRedSendReason = Convert.ToString(ultraComboEditor1.Value); _noRedirectSendReason = Convert.ToString(ultraComboEditor2.Value); _memo = this.checkBoxComboBox2.Text; this.DialogResult = DialogResult.OK; this.Close(); } public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull) { if (cbEdt == null || vlist == null) return false; cbEdt.Items.Clear(); if (bNull) cbEdt.Items.Add(null, ""); for (int i = 0; i < vlist.ValueListItems.Count; i++) { try { cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText); } catch { } } return true; } public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText) { if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText)) return null; ArrayList alist = new ArrayList(); ValueList vlist = new ValueList(); for (int i = 0; i < table.Rows.Count; i++) { try { if (!alist.Contains(table.Rows[i][strKey])) { alist.Add(table.Rows[i][strKey]); vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText])); } } catch { } } return vlist; } private void QCM030606_Load(object sender, EventArgs e) { ValueList valueList1 = GeneralValuelist(ref table1, "SM_CD", "SM_CFNM"); ValueList valueList2 = GeneralValuelist(ref table2, "SM_CD", "SM_CFNM"); ClsControlPack.SetUltraComboEditor(ref ultraComboEditor1, ref valueList1, false); ClsControlPack.SetUltraComboEditor(ref ultraComboEditor2, ref valueList2, false); } } }