| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- 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 QCM030609 : FrmBase
- {
- public string flag = "";
- private DataTable table1;
- private DataTable table2;
- public QCM030609()
- {
- InitializeComponent();
- }
- public QCM030609(DataTable table1, DataTable table2)
- {
- this.table1 = table1;
- this.table2 = table2;
- InitializeComponent();
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- flag = this.comboBox1.Text.ToString();
- 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 QCM030609_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);*/
- }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- //flag = this.comboBox1.Text.ToString();
- this.DialogResult = DialogResult.Cancel;
- this.Close();
- }
- }
- }
|