private void _下一步_Button_Click(object sender, RoutedEventArgs e)
        {
            var o = GetValues();

            _题.难度系数  = o.难度系数;
            _题.考核意图  = o.考核意图;
            _题.知识面编号 = o.知识面编号;
            _题.备注    = o.备注;
            _题.是否启用  = o.是否启用;

            _下一步_Button.IsEnabled = false;

            switch (_题.类型编号)
            {
            case 1:
            {
                _题_选择_选项 = null;
                _题_选择_答案 = null;

                _s.题_选择_选项_获取Async(query.题.题_选择_选项.New(a => a.题编号 == _题.题编号).GetBytes());
                _s.题_选择_答案_获取Async(query.题.题_选择_答案.New(a => a.题编号 == _题.题编号).GetBytes());
                break;
            }

            case 2:
            {
                _s.题_填空_答案_获取Async(query.题.题_填空_答案.New(a => a.题编号 == _题.题编号).GetBytes());
                break;
            }

            case 3:
            {
                _s.题_判断_答案_获取Async(query.题.题_判断_答案.New(a => a.题编号 == _题.题编号).GetBytes());
                break;
            }

            case 4:
            {
                _s.题_问答_答案_获取Async(query.题.题_问答_答案.New(a => a.题编号 == _题.题编号).GetBytes());
                break;
            }

            case 5:
            {
                break;
            }
            }
        }
Exemple #2
0
        void EnableControls()
        {
            if (_selected_row == null)
            {
                _修改_Button.IsEnabled = _删除_Button.IsEnabled = _加入试卷_Button.IsEnabled = false;
                _考核意图_TextBox.Text   = "";
                _备注_TextBox.Text     = "";
                _预览_RichTextBox.Blocks.Clear();
            }
            else
            {
                _修改_Button.IsEnabled = _删除_Button.IsEnabled = _加入试卷_Button.IsEnabled = true;
                _考核意图_TextBox.Text   = _selected_row.考核意图;
                _备注_TextBox.Text     = _selected_row.备注;
                _DataGrid.IsEnabled  = false;

                #region 生成预览
                switch (_selected_row.类型编号)
                {
                case 1:
                {
                    _选择题 = new  择题 {
                        题 = _selected_row
                    };
                    _选择题_数据获取次数 = 0;

                    _s.题_选择_选项_获取Async(query.题.题_选择_选项.New(where : o => o.题编号 == _选择题.题.题编号).GetBytes());
                    _s.题_选择_答案_获取Async(query.题.题_选择_答案.New(where : o => o.题编号 == _选择题.题.题编号).GetBytes());
                }
                break;

                case 2:
                {
                    _填空题 = new 填空题 {
                        题 = _selected_row
                    };
                    _s.题_填空_答案_获取Async(query.题.题_填空_答案.New(where : o => o.题编号 == _填空题.题.题编号).GetBytes());
                }
                break;

                case 3:
                {
                    _判断题 = new 判断题 {
                        题 = _selected_row
                    };
                    _s.题_判断_答案_获取Async(query.题.题_判断_答案.New(where : o => o.题编号 == _判断题.题.题编号).GetBytes());
                }
                break;

                case 4:
                {
                    _问答题 = new 问答题 {
                        题 = _selected_row
                    };
                    _s.题_问答_答案_获取Async(query.题.题_问答_答案.New(where : o => o.题编号 == _问答题.题.题编号).GetBytes());
                }
                break;

                case 5:
                {
                }
                break;
                }
                #endregion
            }
        }