Ejemplo n.º 1
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.º 2
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.º 3
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;
 }