コード例 #1
0
        private void FormTestCase_Load(object sender, EventArgs e)
        {
            try
            {
                if (this.Entity == null)
                {
                    this.Entity = new TestCase();
                }
                if (this.Entity.StepList == null)
                {
                    this.Entity.StepList = new LinkedList <Step>();
                }
                if (this.Entity.StepList.Count == 0)
                {
                    //         this.stepList.Add(Step.GenEndStep());
                }
                else
                {
                    this.stepList.AddRange(this.Entity.StepList);
                }

                if (testDevbll.SelectAll() == null)
                {
                    logger.Info("测试项配置添加功能, TestDev表里 数据为空,或者TestDev表里的Model为空,下拉框不显示数据");
                }
                var devList = testDevbll.SelectAll().Where(p => !string.IsNullOrEmpty(p.Model));
                this.myToolStrip1.ActionClickAdd     = this.ClickAdd;
                this.myToolStrip1.ActionClickDelete  = this.ClickDelete;
                this.myToolStrip1.ActionClickModify  = this.ClickModify;
                this.myToolStrip1.ActionClickCustom1 = this.ClickModifyParams;
                this.myToolStrip1.TextCustom1        = "修改步骤参数";
                this.myToolStrip1.ShowCustom1        = true;

                this.myToolStrip1.AddEvent();
                this.Sort();
                this.myTestStepGridView.LoadData(this.stepList, base.ignoreFields);

                this.txtName.Text  = this.Entity.Name;
                this.texCode.Text  = this.Entity.Code;
                this.textDesc.Text = this.Entity.Desc;
                if (this.Entity.LimitList != null)
                {
                    foreach (var item in this.Entity.LimitList)
                    {
                        string dout = item + ";";
                        this.txtLimit.Text += dout;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex + "");
                return;
            }
        }
コード例 #2
0
        protected virtual void LoadData()
        {
            List <T> dataList = new List <T>();

            if (string.IsNullOrEmpty(this.OrderProperty))
            {
                dataList = bll.SelectAll();
            }
            else
            {
                dataList = bll.SelectAll().AsQueryable().OrderBy(this.OrderProperty).ToList();
            }
            this.myGridView1.LoadData(dataList, base.ignoreFields);
        }
コード例 #3
0
ファイル: FormParam.cs プロジェクト: wardensky/wardensky-demo
        private void Submit_Click(object sender, EventArgs e)
        {
            if (this.Entity == null)
            {
                this.Entity    = new TestParams();
                this.Entity.Id = Guid.NewGuid().ToString();
            }
            this.Entity.Name      = this.textBox1.Text.Trim();
            this.Entity.Desc      = this.textBox2.Text.Trim();
            this.Entity.ParamList = (List <TestParam>) this.myGridView1.DataSource;
            if (isModify)
            {
                bll.SelectAll().RemoveAll(p => p.Id == this.Entity.Id);
            }

            bll.Dao.Save(this.Entity);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
コード例 #4
0
        private void ClickDelete(object arg1, EventArgs arg2)
        {
            TestParam entity = this.myGridView1.FindFirstSelect <TestParam>();

            if (entity != null)
            {
                this.isModify = true;
                if (MessageBox.Show("是否删除数据?", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    this.Entity.ParamList.Remove(entity);
                    if (isModify)
                    {
                        bll.SelectAll().RemoveAll(p => p.Id == this.Entity.Id);
                    }
                    this.myGridView1.LoadData(this.Entity.ParamList, base.ignoreFields);
                }
            }
        }
コード例 #5
0
        void UCProjectInfo_Load(object sender, EventArgs e)
        {
            this.ignoreFields.Add("CaseList");
            this.ignoreFields.Add("DeviceList");
            this.ignoreFields.Add("StepDevice");
            this.ignoreFields.Add("ResultList");
            this.ignoreFields.Add("TestStatus");

            var list = this.GenReflectElements();

            foreach (var inst in list)
            {
                if (inst.Key == "DUT")
                {
                    inst.Type          = Wims.Common.Entity.ControlType.COMBO_BOX;
                    inst.DisplayMember = "Name";
                }
            }
            MongoUtil <Dut> DutBll = DbFactory.DutBll;
            Dictionary <string, List <object> > dic = new Dictionary <string, List <object> >();

            dic.Add("DUT", DutBll.SelectAll().ToList <object>());
            this.Init(list, dic);
        }
コード例 #6
0
        /// <summary>
        /// 根据agent_type 给UCRowComboBox动态赋值
        /// </summary>
        /// <param name="box"></param>
        /// <param name="agentType"></param>
        private void assignmentCommand(UCRowComboBox box, AGENT_TYPE agentType)
        {
            List <object> commandList = commandBll.SelectAll().Where(p => p.AgentType.Equals(agentType)).ToList <object>();

            box.ResetList(commandList);
        }