1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using SourceGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace OTSIncAReportApp._1_UI.OTSReportExport
- {
- public partial class Category : Form
- {
- List<string> CheckTheOptions = new List<string>();
- DataTable ElementList = new DataTable();
- public List<string> OutElementList = new List<string>();
- /// <summary>
- /// 窗体是否修改
- /// </summary>
- public bool IsModify = false;
- public List<string> vs = new List<string>();
- Hashtable table;
-
- public Category(List<string> a_ElementList,DataTable AllList)
- {
- InitializeComponent();
- ElementList = AllList;
- CheckTheOptions = a_ElementList;
- OutElementList = a_ElementList;
- #region 国际化语言
- OTSCommon.Language lan = new OTSCommon.Language(this);
- table = lan.GetNameTable(this.Name);
- #endregion
- }
- private void Category_Load(object sender, EventArgs e)
- {
- for (int i = 0; i < ElementList.Rows.Count; i++)
- {
- checkedListBox1.Items.Add(ElementList.Rows[i]["StrName"].ToString());
- }
- for (int i = 0; i < checkedListBox1.Items.Count; i++)
- {
- if (CheckTheOptions.Count == 0)
- {
- checkedListBox1.SetItemChecked(i, true);
- }
- else
- {
- for (int a = 0; a < CheckTheOptions.Count; a++)
- {
- if (ElementList.Rows[i]["STDId"].ToString() == CheckTheOptions[a].ToString())
- checkedListBox1.SetItemChecked(i, true);
- }
- }
-
- }
- }
- /// <summary>
- /// 确定按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- OutElementList.Clear();
- for (int i=0;i< checkedListBox1.Items.Count;i++)
- {
- if (checkedListBox1.GetItemChecked(i))
- {
- OutElementList.Add(checkedListBox1.Items[i].ToString());
- vs.Add(ElementList.Rows[i]["STDId"].ToString());
- }
-
- }
- IsModify = true;
-
- this.Close();
- }
- /// <summary>
- /// 取消按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|