예제 #1
0
        void CreateTestUnit(string unitdocTpl, string tempdocpath, string unitdocpath)
        {
            PackageInfo        pi = PackageDao.getPackageInfoByID(tu.Packageid.ToString());
            WordDocumentMerger wm = new WordDocumentMerger();

            try {
                wm.Open(unitdocTpl);
                wm.WriteIntoMarkBook("AdminName", tu.Adminname);
                wm.WriteIntoMarkBook("BUGLevel", tu.Buglevel);
                wm.WriteIntoMarkBook("BUGType", tu.Bugtype);
                wm.WriteIntoMarkBook("UnitNO", tu.Unitno);
                wm.WriteIntoMarkBook("ModuleName", tu.Modulename);
                wm.WriteIntoMarkBook("NO", tu.Unitno);
                wm.WriteIntoMarkBook("PackageName", pi.Packagepath);
                wm.WriteIntoMarkBook("ProjectName", tu.Projectname);
                wm.WriteIntoMarkBook("TestTime", tu.Testtime);
                wm.WriteIntoMarkBook("Title", tu.Testtitle);
                wm.InsertMerge(new string[] { tempdocpath }, "Content");
                wm.Save(unitdocpath);
            } catch (Exception e) {
                MessageBox.Show("生成测试单元文档失败!");
            }
            finally
            {
                wm.Quit();
            }
        }
예제 #2
0
        private void SaveInList(ListViewItem item)
        {
            string id   = item.SubItems[5].Text.ToString();
            string path = item.SubItems[1].Text.ToString();

            PackageDao.updateForPub(id, path);
        }
예제 #3
0
        public async Task GetTrackingCodesByPlaceTypeAsync_Must_Return_Money()
        {
            var dao = new PackageDao(session);

            var result = await dao.GetStatusAmountMoneyAsync(1);

            Assert.True(result > 0);
        }
예제 #4
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.
            //
        }
예제 #5
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();
            }
        }
예제 #6
0
        public async Task GetTrackingCodesByPlaceTypeAsync_Must_Return_TrackingCodes()
        {
            var dao = new PackageDao(session);

            var result = await dao.GetTrackingCodesByPlaceTypeAsync(1);

            Assert.NotNull(result);
            Assert.True(result.Count > 0);
        }
예제 #7
0
        public async Task GetPackageByTrackingCodesAsync_Must_Return_Package()
        {
            var dao = new PackageDao(session);

            var result = await dao.GetPackageByTrackingCodesAsync(new string[] { "teste-teste" });

            Assert.NotNull(result);
            Assert.True(result.Count > 0);
        }
예제 #8
0
        //新建
        public UICheck()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.KeyPreview = true;            //先响应控件的ctrl+V的keydown事件。

            this.comboBox1.DataSource         = Source_Person;
            this.comboBox1.DisplayMember      = "fullname";
            this.comboBox1.ValueMember        = "id";
            this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBox1.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            this.textBox2.Text = UICheckDao.getNewCheckNO();

            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.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.textBox1.Enabled = false;            //新建时禁止评论图片

            this.KeyDown                 += new KeyEventHandler(pictureBox1_KeyDown);
            this.pictureBox1.Click       += new EventHandler(pictureBox1_Click);
            this.drawToolsControl.Visible = false;
            this.colorSelector.Visible    = false;
            this.textBox.Visible          = false;
            this.CenterToParent();

            uiinfo = new UIcheckinfo();
            this.button3.Visible = false;
            this.button6.Visible = false;

            ValidateUPDOWN();
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
예제 #9
0
        public UploadFTP()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.exListView1.MySortBrush      = SystemBrushes.ControlLight;
            this.exListView1.MyHighlightBrush = Brushes.Goldenrod;
            this.exListView1.GridLines        = true;
            this.exListView1.ControlPadding   = 4;

            ImageList colimglst = new ImageList();

            colimglst.ImageSize             = new Size(1, 25); // this will affect the row height
            this.exListView1.SmallImageList = colimglst;

            this.exListView1.Columns.Add(new EXColumnHeader("更新包名称", 200));
            this.exListView1.Columns.Add(new EXEditableColumnHeader("上传路径", 180));
            this.exListView1.Columns.Add(new EXColumnHeader("进度", 120));
            this.exListView1.Columns.Add(new EXColumnHeader("状态", 60));
            this.exListView1.Columns.Add(new EXColumnHeader("操作", 80));

            List <PackageInfo> ls = PackageDao.queryPackageInfo("0", "0", "已发布", null, null);


            this.exListView1.BeginUpdate();
            this.exListView1.Items.Clear();
            foreach (PackageInfo pack in ls)
            {
                ListViewBing(pack);
            }
            this.exListView1.EndUpdate();

            //ListDirectory("aaaabbb");
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
예제 #10
0
        private void getPublishPackageList()
        {
            string _moduleid  = "0";
            string _managerid = "0";

            string _pubpath = null;
            string _begin   = null;
            string _end     = null;
            string _keyword = null;

            if (!this.dateTimePicker1.IsDisposed && !this.dateTimePicker2.IsDisposed)
            {
                _begin = this.dateTimePicker1.Value.ToShortDateString() + " 00:00:00";
                _end   = this.dateTimePicker2.Value.ToShortDateString() + " 23:59:59";
            }

            if (this.treeView1.SelectedNode != null)
            {
                _pubpath = this.treeView1.SelectedNode.FullPath.Replace('\\', '/');
                if (!ftphost.Equals(_pubpath))
                {
                    _pubpath = _pubpath.Replace(ftphost + "/", "");
                }
                else
                {
                    _pubpath = null;
                }
            }
            else
            {
                MessageBox.Show("请选择分类!");
                return;
            }

            _moduleid  = this.comboBox1.SelectedValue.ToString();
            _managerid = this.comboBox2.SelectedValue.ToString();
            if (!string.IsNullOrEmpty(this.textBox1.Text) && !"请输入关键字...".Equals(this.textBox1.Text))
            {
                _keyword = textBox1.Text;
            }
            this.count = PackageDao.queryPubPackageInfoCount(_moduleid, _managerid, _pubpath, _keyword, _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);
            List <PackageInfo> ls = PackageDao.queryPubPackageInfo(_moduleid, _managerid, _pubpath, _keyword, _begin, _end,
                                                                   (currentpage > 1)?((this.currentpage - 1) * pagesize):0
                                                                   , pagesize);

            this.exListView1.BeginUpdate();
            this.exListView1.Items.Clear();
            foreach (PackageInfo pack in ls)
            {
                ListViewBing(pack);
            }
            this.exListView1.EndUpdate();
        }