示例#1
0
 public TestGroupPane(TestingGroup testingGroup, bool enableCtr)
 {
     this._testingGroup = testingGroup;
     this._enableCtr = enableCtr;
     InitializeComponent();
     SetControlState();
     PopTestingAreas();
     BindTestingGroup();
 }
示例#2
0
        public TestingGroupFrom(TestingGroup tgroup, Form mdiparent)
        {
            this._testingGroup = tgroup;
            this._mdiparent = mdiparent;

            InitializeComponent();

            lqtToolStrip1.SaveAndCloseClick += new EventHandler(lqtToolStrip1_SaveAndCloseClick);
            lqtToolStrip1.SaveAndNewClick += new EventHandler(lqtToolStrip1_SaveAndNewClick);

            PopTestingAreas();
            LoadTestingAreaCtr();
        }
示例#3
0
 public static void DeleteTestingGroup(TestingGroup g)
 {
     DaoFactory.GetDaoFactory().CreateTestingGroupDao().Delete(g);
 }
示例#4
0
 public static void SaveOrUpdateTestingGroup(TestingGroup tgroup)
 {
     DaoFactory.GetDaoFactory().CreateTestingGroupDao().SaveOrUpdate(tgroup);
 }
示例#5
0
 private void butNewgroup_Click(object sender, EventArgs e)
 {
     TestingGroup tg = new TestingGroup();
     tg.TestingArea = _testingArea;
     TestingGroupFrom frm = new TestingGroupFrom(tg, _mdiparent);
     frm.ShowDialog();
     DisplayTestingGroup();
 }
示例#6
0
 public void RebindTestingGroup(TestingGroup testgroup)
 {
     this._testingGroup = testgroup;
     BindTestingGroup();
 }
示例#7
0
 public TestGroupPane(TestingGroup testinggroup)
     : this(testinggroup, false)
 {
 }
示例#8
0
 private void butNewgroup_Click(object sender, EventArgs e)
 {
     if (CreateOrEditTestingGroup != null)
     {
         TestingGroup tg = new TestingGroup();
         tg.TestingArea = _testingArea;
         CreateOrUpdateEventArgs eArgs = new CreateOrUpdateEventArgs(tg);
         CreateOrEditTestingGroup(this, eArgs);
     }
 }
示例#9
0
        private IList<ImportTestData> GetDataRow(DataSet ds)
        {
            string testName;
            string groupName;
            string areaName;
            string aName = "";
            string gName = "";
            TestingArea testArea = null;
            TestingGroup testgroup = null;
            int rowno = 0;
            bool haserror;

            IList<ImportTestData> rdlist = new List<ImportTestData>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                rowno++;
                haserror=false;
                testName = Convert.ToString(dr[0]).Trim() ;
                areaName = Convert.ToString(dr[1]).Trim() ;
                groupName = Convert.ToString(dr[2]).Trim() ;

                if (String.IsNullOrEmpty(groupName))
                    groupName = TestingGroup.GetDefaultGroupName;

                ImportTestData rd = new ImportTestData(testName, groupName, areaName, rowno);

                if (aName != areaName)
                {
                    if (!string.IsNullOrEmpty(areaName))
                    {
                        testArea = DataRepository.GetTestingAreaByName(areaName);
                        if (testArea == null)
                        {
                            testArea = new TestingArea();
                            testArea.AreaName = areaName;
                            DataRepository.SaveOrUpdateTestingArea(testArea);
                        }
                    }
                    else
                        testArea = null;
                    aName = areaName;
                }
                rd.TestArea = testArea;

                if (testArea != null)
                {
                    if (gName != groupName)
                    {
                        testgroup = DataRepository.GetTestingGroupByName(testArea.Id, groupName);
                        if (testgroup == null)
                        {
                            testgroup = new TestingGroup();
                            testgroup.GroupName = groupName;
                            testgroup.TestingArea = testArea;
                            DataRepository.SaveOrUpdateTestingGroup(testgroup);
                        }
                        gName = groupName;
                    }

                    rd.TestGroup = testgroup;

                    if (!string.IsNullOrEmpty(testName))
                        rd.IsExist = DataRepository.GetTestByNameAndTestArea(testName,testArea.Id) != null;
                    else
                        haserror = true;
                }
                else
                    haserror = true;
                rd.HasError = haserror;

                rdlist.Add(rd);
            }

            return rdlist;
        }
示例#10
0
        void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e)
        {
            try
            {
                LQTUserMessage msg = SaveOrUpdateObject();
                ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true);
                //DataRepository.CloseSession();

                ((LqtMainWindowForm)_mdiparent).BuildNavigationMenu();
                _testingGroup = new TestingGroup();
                //_testingGroup.TestingArea = LqtUtil.GetComboBoxValue<TestingArea>(comTestarea);

                LoadTestingAreaCtr();
            }
            catch (LQTUserException ex)
            {
                new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
            }
            catch (Exception ex)
            {

                new FrmShowError(CustomExceptionHandler.ShowExceptionText("There is already a Test-Group with this group name.", ex)).ShowDialog();
            }
        }