| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- 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>();
- List<string> ElementList = new List<string>();
- public List<string> OutElementList = new List<string>();
- /// <summary>
- /// 窗体是否修改
- /// </summary>
- public bool IsModify = false;
- Hashtable table;
-
- public Category(List<string> a_ElementList, List<string> 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.Count; i++)
- {
- checkedListBox1.Items.Add(ElementList[i]);
- }
- 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 (checkedListBox1.Items[i].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());
- }
- }
- IsModify = true;
- this.Close();
- }
- /// <summary>
- /// 取消按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
|