Beispiel #1
0
        void ListVew_DoubleClick(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count == 1)
            {
                TestUnit          tu = ListViewSelect(this.listView1.SelectedItems[0]);
                TestResult        tr = null;
                TestListParameter tp = new TestListParameter();

                if (this.dateTimePicker1.IsDisposed && this.dateTimePicker2.IsDisposed)
                {
                    tp.Begintime = null;
                    tp.Endtime   = null;
                }
                else
                {
                    tp.Begintime = this.dateTimePicker1.Value.ToShortDateString() + " 00:00:00";
                    tp.Endtime   = this.dateTimePicker2.Value.ToShortDateString() + " 23:59:59";;
                }
                tp.Level    = this.comboBox3.Text;
                tp.Manageid = this.comboBox2.SelectedValue.ToString();
                tp.Moduleid = this.comboBox1.SelectedValue.ToString();

                tp.Pagesize   = pagesize;
                tp.Startindex = (currentpage - 1) * pagesize + this.listView1.SelectedItems[0].Index;
                tp.State      = this.treeView1.SelectedNode.Text;
                //tr.Tp = tp;
                tr = new TestResult(TestUnitDao.gettestUnitById(tu.Id), tp);
                tr.ShowDialog();
            }
            else
            {
                MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            getTestUnitList();
        }
Beispiel #2
0
        /// <summary>
        /// 编辑窗口
        /// </summary>
        /// <param name="tuint"></param>
        public TestResult(TestUnit tuint, TestListParameter tp)
        {
            this.tu = tuint;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            if (tp == null)
            {
                this.Text            = "缺陷编辑";
                this.button3.Enabled = false;
                this.button5.Dispose();
                this.button6.Dispose();
                this.linkLabel1.Dispose();
                TestUnitBingDS();
                TestUnitBingData_Edit();
            }
            else
            {
                this.Text                = "缺陷浏览";
                this.Tp                  = tp;
                this.button5.Location    = this.button1.Location;
                this.button6.Location    = this.button2.Location;
                this.linkLabel1.Location = this.checkBox1.Location;

                this.button1.Dispose();
                this.button2.Dispose();
                this.button3.Dispose();
                this.button4.Dispose();
                this.checkBox1.Dispose();

                this.comboBox1.DropDownStyle = ComboBoxStyle.Simple;
                this.comboBox2.DropDownStyle = ComboBoxStyle.Simple;
                this.comboBox3.DropDownStyle = ComboBoxStyle.Simple;
                this.comboBox4.DropDownStyle = ComboBoxStyle.Simple;
                this.comboBox5.DropDownStyle = ComboBoxStyle.Simple;
                this.comboBox6.DropDownStyle = ComboBoxStyle.Simple;

                int sumtu = TestUnitDao.QueryTestUnitCount(tp.Moduleid, tp.Manageid, tp.Level, tp.State,
                                                           tp.Begintime, tp.Endtime);
                if (tp.Startindex - 1 < 0)
                {
                    this.button5.Enabled = false;
                }
                else
                {
                    this.button5.Enabled = true;
                }

                if (tp.Startindex + 2 > sumtu)
                {
                    this.button6.Enabled = false;
                }
                else
                {
                    this.button6.Enabled = true;
                }

                TestUnitBingData();
            }
            this.CenterToParent();
        }