Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        bool TestuiSave()
        {
            MemoryStream stream = new MemoryStream();

            richTextBox1.SaveFile(stream, RichTextBoxStreamType.RichText);
            //richTextBox1.SaveFile(@"D:\tttt.rtf");
            tu.Testcontent = stream.ToArray();
            if (this.comboBox1.SelectedItem != null && this.comboBox1.SelectedIndex != 0)
            {
                tu.Adminname = this.comboBox1.Text;
                tu.Adminid   = (int)this.comboBox1.SelectedValue;
            }
            else
            {
                MessageBox.Show("请选择责任人", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            if (this.comboBox2.SelectedItem != null && this.comboBox2.SelectedIndex != 0)
            {
                tu.Modulename = this.comboBox2.Text;
                tu.Moduleid   = (int)this.comboBox2.SelectedValue;
            }
            else
            {
                MessageBox.Show("请选择模块", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            tu.Buglevel    = this.comboBox5.Text;
            tu.Bugtype     = this.comboBox6.Text;
            tu.Packagename = this.multiColumnFilterComboBox1.Text;           //his.textBox3.Text;
            if (this.multiColumnFilterComboBox1.SelectedValue != null)
            {
                tu.Packageid = (int)this.multiColumnFilterComboBox1.SelectedValue;
            }
            tu.Projectname = this.comboBox3.Text;
            tu.State       = Enum.GetName(typeof(CommonConst.TestState), CommonConst.TestState.已确认);
            //Enum.GetNames(typeof(CommonConst.TestState)))
            tu.Testorname = comboBox4.Text;
            tu.Testtime   = DateTime.Now.ToString();
            if (tu.Id == 0 && !isSaved)
            {
                if (!TestUnitDao.getNewUnitNO().Equals(this.textBox1.Text))
                {
                    tu.Unitno = TestUnitDao.getNewUnitNO();
                    MessageBox.Show("缺陷编号被占用,系统重新分配的编号为:" + tu.Unitno, "提示");
                }
                else
                {
                    tu.Unitno = this.textBox1.Text;
                }
            }
            else
            {
                tu.Unitno = this.textBox1.Text;
            }
            tu.Testtitle = this.textBox9.Text;
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 新建窗口
        /// </summary>
        public TestResult()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.Text = "缺陷新建";
            this.button5.Dispose();
            this.button6.Dispose();
            this.linkLabel1.Dispose();

            this.comboBox1.DataSource         = Source_Person;
            this.comboBox1.DisplayMember      = "fullname";
            this.comboBox1.ValueMember        = "id";
            this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBox1.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            this.textBox1.Text = TestUnitDao.getNewUnitNO();

            this.comboBox2.DataSource         = Source_Module;
            this.comboBox2.DisplayMember      = "fullname";
            this.comboBox2.ValueMember        = "id";
            this.comboBox2.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBox2.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;

            this.comboBox3.DataSource         = Source_Project;
            this.comboBox3.DisplayMember      = "projectname";
            this.comboBox3.ValueMember        = "id";
            this.comboBox3.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBox3.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;

            this.comboBox4.DataSource         = Source_testor;
            this.comboBox4.DisplayMember      = "fullname";
            this.comboBox4.ValueMember        = "id";
            this.comboBox4.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBox4.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;

            this.comboBox5.DataSource    = CommonConst.BUGLEVEL;
            this.comboBox5.DropDownStyle = ComboBoxStyle.DropDownList;

            this.comboBox6.DataSource    = CommonConst.BUGTYPE;
            this.comboBox6.DropDownStyle = ComboBoxStyle.DropDownList;

            this.multiColumnFilterComboBox1.DataSource = PackageDao.getAllUnTestPack();

            this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packagename", 200, true));
            this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packtime", 60, true));
            this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("code", 60, true));
            this.multiColumnFilterComboBox1.DisplayMember = "packagename";
            this.multiColumnFilterComboBox1.ValueMember   = "id";
            this.multiColumnFilterComboBox1.Validated    += new EventHandler(Package_SelectedValueChanged);

            this.CenterToParent();
            //InsertImage();
            //read();
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
Ejemplo n.º 4
0
        void ThreadFunc(object obj)
        {
            ReportPara       rp           = (ReportPara)obj;
            string           begin        = rp.Begintime;
            string           end          = rp.Endtime;
            string           path         = rp.Path;
            del_do_changetxt delchangetxt = new del_do_changetxt(do_changetxt);

            this.BeginInvoke(delchangetxt, new object[] { "正在启动WORD", 10 });
            WordDocumentMerger wm = new WordDocumentMerger();

            try {
                if (unitDOCpath == null || "".Equals(unitDOCpath))
                {
                    unitDOCpath = this.defaultpath;
                }
                this.BeginInvoke(delchangetxt, new object[] { "正在打开模版", 20 });
                //打开模版
                wm.Open(defaultpath + @"\temp\TestReport.doc");
                //查询数据库
                this.BeginInvoke(delchangetxt, new object[] { "正在查询数据库", 30 });
                DataTable table1         = PackageDao.getRePortPack(begin, end);
                DataTable table2         = TestUnitDao.getRePortTest(begin, end);
                DataTable packdt         = PackageDao.getRePortPackNUM(begin, end);
                DataTable testbugleveldt = TestUnitDao.getRePortBugLevel(begin, end);
                DataTable testAllBug     = TestUnitDao.getRePortBugLevelAll(begin, end);
                DataTable testbugnumdt   = TestUnitDao.getRePortBugNum(begin, end);
                DataTable testbugrate    = TestUnitDao.getRePortBugRate(begin, end);
                DataTable testbugtype    = TestUnitDao.getRePortBugType(begin, end);
                //插入标签
                this.BeginInvoke(delchangetxt, new object[] { "正在插入数据", 60 });
                wm.WriteIntoMarkBook("测试报告名称", "权力运行许可平台");
                wm.WriteIntoMarkBook("测试时间起", begin);
                wm.WriteIntoMarkBook("测试时间至", end);
                wm.WriteIntoMarkBook("更新包个数", table1.Rows.Count.ToString());
                wm.insertTable("成功率表格", packdt);
                wm.WriteIntoMarkBook("BUG个数", table2.Rows.Count.ToString());

                this.BeginInvoke(delchangetxt, new object[] { "正在绘制图表和表格", 80 });
                wm.InsertChartFromBK("BUG等级饼图", testAllBug);
                wm.InsertChartFromBK("BUG趋势折线图", testbugnumdt);
                wm.InsertChartFromBK("BUG概率估算柱状图", testbugrate);
                wm.insertTable("BUG等级表格", testbugleveldt);
                wm.insertTable("BUG类型表格", testbugtype);
                wm.insertTableForPack("测试对象表格", table1);
                wm.insertTableForTest("测试缺陷表格", table2);
                this.BeginInvoke(delchangetxt, new object[] { "完成", 100 });
                wm.SaveAs(path.ToString());
                MessageBox.Show("保存成功", "提示");
            } catch (Exception e1) {
                MessageBox.Show(e1.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                wm.Quit();
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 继续新建按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Button3Click(object sender, EventArgs e)
 {
     //标题置空
     this.textBox9.Text = "";
     //详细信息置空
     this.richTextBox1.Clear();
     //重新设置BUG编号
     this.textBox1.Text = TestUnitDao.getNewUnitNO();
     this.tu.Id         = 0;
 }
Ejemplo n.º 6
0
 void ListVew_DoubleClick(object sender, EventArgs e)
 {
     if (this.listView1.SelectedItems.Count == 1)
     {
         TestUnit   tu = ListViewSelect(this.listView1.SelectedItems[0]);
         TestResult tr = null;
         tr = new TestResult(TestUnitDao.gettestUnitById(tu.Id), null);
         tr.ShowDialog();
     }
     else
     {
         MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 已废止
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Button8Click(object sender, EventArgs e)
 {
     if (this.listView1.CheckedItems.Count > 0)
     {
         foreach (ListViewItem lvi in this.listView1.CheckedItems)
         {
             string id    = lvi.SubItems[7].Text;
             string state = Enum.GetName(typeof(CommonConst.TestState), CommonConst.TestState.已废止);
             TestUnitDao.UpdateState(state, id);
         }
         getTestUnitList();
     }
     else
     {
         MessageBox.Show("请至少选择一条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 查询关联的测试单元列表
        /// </summary>
        void getGuanlianUnitList()
        {
            TestTheme       theme   = this.treeView1.SelectedNode.Tag as TestTheme;
            string          themeid = theme.Id.ToString();
            List <TestUnit> tulist  = TestUnitDao.getGuanLianUnitList(themeid);

            this.listView1.Items.Clear();
            foreach (TestUnit tu in tulist)
            {
                ListViewBing(tu);
            }
            if (string.IsNullOrEmpty(theme.Favcontent))
            {
                this.textBox1.Text = "请输入描述……";
            }
            else
            {
                this.textBox1.Text = theme.Favcontent;
            }
        }
Ejemplo n.º 9
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("没有找到下一条数据", "出错");
                }
            }
        }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
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();
        }