Example #1
0
        //浏览模式 下一个 按钮
        void Button6Click(object sender, EventArgs e)
        {
            if (tp != null)
            {
                int sumtu = TestUnitDao.QueryTestUnitCount(tp.Moduleid, tp.Manageid, tp.Level, tp.State,
                                                           tp.Begintime, tp.Endtime);
                List <TestUnit> tulist = TestUnitDao.QueryTestUnit(tp.Moduleid, tp.Manageid, tp.Level, tp.State,
                                                                   tp.Begintime, tp.Endtime, tp.Startindex + 1, 1);
                if (tulist.Count > 0)
                {
                    this.tu = TestUnitDao.gettestUnitById(tulist[0].Id);
                    TestUnitBingData();
                    tp.Startindex = tp.Startindex + 1;
                    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;
                    }
                }
                else
                {
                    MessageBox.Show("没有找到下一条数据", "出错");
                }
            }
        }
Example #2
0
        /// <summary>
        /// 获取所有缺陷单元
        /// </summary>
        void getTestUnitList()
        {
            string moduleid = this.comboBox1.SelectedValue.ToString();
            string manageid = this.comboBox2.SelectedValue.ToString();
            string level    = this.comboBox3.Text;
            string state    = "全部";

            string begin = this.dateTimePicker1.Value.ToShortDateString() + " 00:00:00";
            string end   = this.dateTimePicker2.Value.ToShortDateString() + " 23:59:59";

            if (this.dateTimePicker1.IsDisposed && this.dateTimePicker2.IsDisposed)
            {
                begin = null;
                end   = null;
            }

            this.count = TestUnitDao.QueryTestUnitCount(moduleid, manageid, level, state, begin, end);
            int countpage = (count % pagesize == 0)?count / pagesize:count / pagesize + 1;

            if (this.currentpage > countpage)
            {
                this.currentpage = 1;
            }
            this.label3.Text = string.Format(currentstr, this.currentpage);
            this.label5.Text = string.Format(pagestr, this.pagesize);
            this.label4.Text = string.Format(countstr, countpage, this.count);

            this.listView1.Items.Clear();
            List <TestUnit> alltu = TestUnitDao.QueryTestUnit(moduleid, manageid, level, state, begin, end,
                                                              (currentpage > 1)?((this.currentpage - 1) * pagesize):0
                                                              , pagesize);

            foreach (TestUnit tu in alltu)
            {
                ListViewBing(tu);
            }
        }
Example #3
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();
        }