12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
-
- using System.Windows.Forms;
-
- namespace Uninpho.Tools.components.DataManager
- {
- public partial class FrmSetting : DevExpress.XtraEditors.XtraForm
- {
- public Dictionary<string, decimal> Condition = new Dictionary<string, decimal>();
- public FrmSetting(Dictionary<string, decimal> filterCondition)
- {
- InitializeComponent();
- setUI(filterCondition);
- }
- private void setUI(Dictionary<string, decimal> filterCondition)
- {
- foreach (var item in this.Controls)
- {
- if (item is GroupBox)
- {
- foreach (var ctl in (item as GroupBox).Controls)
- {
- if (ctl is CheckBoxInput)
- {
- foreach (KeyValuePair<string, decimal> kvp in filterCondition)
- {
- bool isChecked = kvp.Key == (ctl as CheckBoxInput).ColumnName;
- if (isChecked)
- {
- (ctl as CheckBoxInput).Checked = isChecked;
- (ctl as CheckBoxInput).Value = kvp.Value;
- break;
- }
- }
- }
- }
- }
- }
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- foreach (var item in this.Controls)
- {
- if (item is GroupBox)
- {
- foreach (var ctl in (item as GroupBox).Controls)
- {
- if (ctl is CheckBoxInput&& (ctl as CheckBoxInput).Checked&& (ctl as CheckBoxInput).Value!=0)
- {
- this.Condition.Add((ctl as CheckBoxInput).ColumnName, (ctl as CheckBoxInput).Value);
- }
- }
- }
- }
- this.DialogResult = DialogResult.OK;
- }
- private void btnCancle_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- }
- private void checkBoxInput9_Load(object sender, EventArgs e)
- {
- }
- }
- }
|