private void refrenshPlaneDictList()
        {
            if (cbJoint.SelectedItem == null)
            {
                return;
            }
            planeDictList = new List <Model.TB_Dict>();
            Model.TB_Dict selectJoint = (Model.TB_Dict)cbJoint.SelectedItem;
            if (!selectJoint.Dict_Key.Equals("-1"))
            {
                planeDictList = dictBLL.GetModelList("dict_groupid=" + jointDictList[1].ID + " and dict_groupid2='1,2,3,4,5,7,8,9'");
            }

            Model.TB_Dict allDict = new Model.TB_Dict()
            {
                Dict_Key   = "-1",
                Dict_Value = "不限"
            };
            planeDictList.Insert(0, allDict);
            cbPlane.SetBinding(ComboBox.ItemsSourceProperty, new Binding()
            {
                Source = planeDictList
            });
            cbPlane.SelectedIndex = 0;
        }
Exemple #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (TestManager != null)
            {
                testManager.SelectedItem = TestManager;
            }

            Model.TB_Dict allDict = new Model.TB_Dict()
            {
                Dict_Key   = "-1",
                Dict_Value = "全部"
            };
            jointDictList = dictBLL.GetModelList("dict_groupid=2");
            jointDictList.Insert(0, allDict);
            jointsideDictList = dictBLL.GetModelList("dict_groupid=3");
            jointsideDictList.Insert(0, allDict);
            testmodeDictList = dictBLL.GetModelList("dict_groupid=1");
            testmodeDictList.Insert(0, allDict);

            Binding dictBind = new Binding()
            {
                Source = jointDictList
            };

            cbJoint.SetBinding(ComboBox.ItemsSourceProperty, dictBind);

            cbJointSide.SetBinding(ComboBox.ItemsSourceProperty, new Binding()
            {
                Source = jointsideDictList
            });

            cbTestMode.SetBinding(ComboBox.ItemsSourceProperty, new Binding()
            {
                Source = testmodeDictList
            });

            menu = new System.Windows.Controls.ContextMenu();

            MenuItem miShowChart = new MenuItem();

            miShowChart.Header = "查看图表";
            menu.Items.Add(miShowChart);
            miShowChart.Click += new RoutedEventHandler(btnShowChart_Click);

            menu.Items.Add(new Separator());

            MenuItem miAddInStandard = new MenuItem();

            miAddInStandard.Header = "加入测试参考值";
            menu.Items.Add(miAddInStandard);
            miAddInStandard.Click += new RoutedEventHandler(btnAddStandard_Click);

            MenuItem miCompare = new MenuItem();

            miCompare.Header = "数据对比";
            menu.Items.Add(miCompare);
            miCompare.Click += new RoutedEventHandler(btnShowCompareChart_Click);

            menu.Items.Add(new Separator());
            MenuItem miDelete = new MenuItem();

            miDelete.Header = "删除";
            menu.Items.Add(miDelete);
            miDelete.Click += new RoutedEventHandler(btnDelete_Click);
        }