|
@@ -50,43 +50,33 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
|
|
|
checkedListBox1.SetItemChecked(i, true);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- ////创建右键菜单
|
|
|
-
|
|
|
- //contextMenuStrip1 = new ContextMenuStrip();
|
|
|
- //ToolStripMenuItem deleteItem = new ToolStripMenuItem("规则设置");
|
|
|
- //deleteItem.Click += RuleSettingSelection;
|
|
|
- //contextMenuStrip1.Items.Add(deleteItem);
|
|
|
-
|
|
|
- //// 订阅鼠标按下事件(控制菜单弹出逻辑)
|
|
|
- //checkedListBox1.MouseDown += checkedListBox1_MouseDown;
|
|
|
}
|
|
|
- private void RuleSettingSelection(object sender, EventArgs e)
|
|
|
+
|
|
|
+ private void checkedListBox1_MouseDown(object sender, MouseEventArgs e)
|
|
|
{
|
|
|
- if (checkedListBox1.SelectedIndex != -1)
|
|
|
+ if (e.Button == MouseButtons.Left)
|
|
|
{
|
|
|
- for (int i = 0; i < List_RuleTable.Count;i++)
|
|
|
+ for (int i = 0; i < checkedListBox2.Items.Count; i++)
|
|
|
{
|
|
|
- if (dt.Rows[i]["GroupId"].ToString() == List_RuleTable[listIndex].TableName.ToString())
|
|
|
+ if (checkedListBox2.GetItemChecked(i))
|
|
|
{
|
|
|
- RuleSelector ruleGroupSelector = new RuleSelector(List_RuleTable[listIndex]);
|
|
|
- ruleGroupSelector.ShowDialog();
|
|
|
- List_RuleTable[listIndex] = ruleGroupSelector.RuleTable.Copy();
|
|
|
- continue;
|
|
|
+ List_RuleTable[listIndex].Rows[i]["display"] = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ List_RuleTable[listIndex].Rows[i]["display"] = "0";
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- private void checkedListBox1_MouseDown(object sender, MouseEventArgs e)
|
|
|
- {
|
|
|
- if (e.Button == MouseButtons.Left)
|
|
|
- {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 获取点击位置的项索引
|
|
|
int index = checkedListBox1.IndexFromPoint(e.Location);
|
|
|
- listIndex = index;
|
|
|
+
|
|
|
if (index == -1)
|
|
|
{ return; }
|
|
|
+ listIndex = index;
|
|
|
|
|
|
for (int i = 0; i < List_RuleTable.Count; i++)
|
|
|
{
|
|
@@ -121,6 +111,20 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
|
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
+ for (int i = 0; i < checkedListBox2.Items.Count; i++)
|
|
|
+ {
|
|
|
+ if (checkedListBox2.GetItemChecked(i))
|
|
|
+ {
|
|
|
+ List_RuleTable[listIndex].Rows[i]["display"] = "1";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ List_RuleTable[listIndex].Rows[i]["display"] = "0";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
if (!checkedListBox1.GetItemChecked(i))
|
|
@@ -199,22 +203,22 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
{
|
|
|
// 获取点击位置的项索引
|
|
|
- int index = checkedListBox1.IndexFromPoint(e.Location);
|
|
|
+ int index = checkedListBox2.IndexFromPoint(e.Location);
|
|
|
if (index == -1)
|
|
|
return;
|
|
|
|
|
|
- for (int i = 0; i < List_RuleTable[listIndex].Rows.Count; i++)
|
|
|
- {
|
|
|
- if (checkedListBox1.GetItemChecked(index))
|
|
|
+ //for (int i = 0; i < List_RuleTable[listIndex].Rows.Count; i++)
|
|
|
+ //{
|
|
|
+ if (checkedListBox2.GetItemChecked(index))
|
|
|
{
|
|
|
- List_RuleTable[listIndex].Rows[i]["display"] = "1";
|
|
|
+ List_RuleTable[listIndex].Rows[index]["display"] = "0";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- List_RuleTable[listIndex].Rows[i]["display"] = "0";
|
|
|
+ List_RuleTable[listIndex].Rows[index]["display"] = "1";
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ //}
|
|
|
|
|
|
}
|
|
|
}
|