Пример #1
0
 private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (customer == null)
     {
         if (treeView1.SelectedNode.Name == "allColumnHeader")
         {
             myDataGridView.DataSource = SqlManage.showAllUserOrder(0).Tables[0];
         }
         else if (treeView1.SelectedNode.Name == "dealedHeader")
         {
             myDataGridView.DataSource = SqlManage.showAllUserOrder(1).Tables[0];
         }
         else if (treeView1.SelectedNode.Name == "undealedHeader")
         {
             myDataGridView.DataSource = SqlManage.showAllUserOrder(2).Tables[0];
         }
     }
     else
     {
         if (treeView1.SelectedNode.Name == "allColumnHeader")
         {
             myDataGridView.DataSource = SqlManage.showUserOrder(customer, 0).Tables[0];
         }
         else if (treeView1.SelectedNode.Name == "dealedHeader")
         {
             myDataGridView.DataSource = SqlManage.showUserOrder(customer, 1).Tables[0];
         }
         else if (treeView1.SelectedNode.Name == "undealedHeader")
         {
             myDataGridView.DataSource = SqlManage.showUserOrder(customer, 2).Tables[0];
         }
     }
 }