Пример #1
0
        void lqtToolStrip1_SaveAndNewClick(object sender, EventArgs e)
        {
            try
            {
                LQTUserMessage msg = SaveOrUpdateObject();
                ((LqtMainWindowForm)_mdiparent).ShowStatusBarInfo(msg.Message, true);

                TestingArea  ta = _test.TestingArea;
                TestingGroup tg = _test.TestingGroup;

                _test              = new Test();
                _test.TestingArea  = ta;
                _test.TestingGroup = tg;

                // LoadTestCtr();
                SetControlState();
                comGroup.Enabled    = true;
                comTestarea.Enabled = true;

                _isedited = false;
            }
            catch (Exception ex)
            {
                new FrmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog();
            }
        }
Пример #2
0
 public TestGroupPane(TestingGroup testingGroup, bool enableCtr)
 {
     this._testingGroup = testingGroup;
     this._enableCtr    = enableCtr;
     InitializeComponent();
     SetControlState();
     PopTestingAreas();
     BindTestingGroup();
 }
Пример #3
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();
        }
Пример #4
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);
     }
 }
Пример #5
0
        public void Save(TestingGroup group)
        {
            string sql = "INSERT INTO TestingGroup(TestingAreaId, GroupName, Description) VALUES (@TestingAreaId, @GroupName, @Description) SELECT @@identity";

            using (SqlCommand cm = new SqlCommand(sql, DefaultConnection))
            {
                SetGroup(cm, group);
                group.Id = int.Parse(cm.ExecuteScalar().ToString());
            }
        }
Пример #6
0
        public void Update(TestingGroup group)
        {
            string sql = "Update TestingGroup SET TestingAreaId =@TestingAreaId, GroupName =@GroupName, Description=@Description  where Id = @groupId";

            using (SqlCommand cm = new SqlCommand(sql, DefaultConnection))
            {
                DatabaseHelper.InsertInt32Param("@groupId", cm, group.Id);
                SetGroup(cm, group);
                cm.ExecuteNonQuery();
            }
        }
Пример #7
0
        private void butEditgoup_Click(object sender, EventArgs e)
        {
            TestingGroup tg = GetSelectedTestingGroup(); //b

            if (tg != null)                              //b
            {
                TestingGroupFrom frm = new TestingGroupFrom(tg, _mdiparent);
                frm.ShowDialog();
                DisplayTestingGroup();
            }
        }
Пример #8
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();
        }
Пример #9
0
        private static TestingGroup GetGroup(SqlDataReader dr)
        {
            TestingGroup group = new TestingGroup
            {
                Id              = DatabaseHelper.GetInt32("Id", dr),
                TestingAreaId   = DatabaseHelper.GetInt32("TestingAreaId", dr),
                GroupName       = DatabaseHelper.GetString("GroupName", dr),
                Description     = DatabaseHelper.GetString("Description", dr),
                TestingAreaName = DatabaseHelper.GetString("TestingAreaName", dr)
            };

            return(group);
        }
Пример #10
0
        public FastestCollision DoTheFastestCollision(List <GameObject> MovingGameObjects)
        {
            // Precalculate intersecting areas
            var PossibleCollisionGroups = Booster.CheckAll(MovingGameObjects);

            // 2. For each intersecting area calculate precise collision details, if any

            FastestCollision  fastestCollision = null;
            CollisionResponse collisionResponse;

            foreach (var TestingGroup in PossibleCollisionGroups)
            {
                foreach (var testing in TestingGroup.GetPossibleCollidingObjects())
                {
                    IPhysicControl SecondCrossTest        = testing.GetSecondary();
                    var            PrimaryDisplacements   = testing.GetPrimary().GetDisplacements();
                    var            SecondaryDisplacements = SecondCrossTest.GetDisplacements();

                    CollisionSimplifiedScenario Scenario;

                    Scenario = DisplacementSimplifier.Simplify
                                   (PrimaryDisplacements, SecondaryDisplacements);

                    if (Scenario == null)
                    {
                        continue;
                    }

                    collisionResponse = CollisionStrategy.Test(Scenario);

                    if (collisionResponse != null)
                    {
                        if (fastestCollision == null || fastestCollision.CollisionDeltaTime > collisionResponse.CollisionDeltaTime)
                        {
                            fastestCollision = new FastestCollision(
                                collisionResponse, SecondCrossTest.GameObject
                                );
                        }
                    }
                }
            }


            if (fastestCollision != null)
            {
                fastestCollision.GameObject.Hit(fastestCollision.CollisionResponse);
            }

            return(fastestCollision);
        }
Пример #11
0
        private void butDeletegroup_Click(object sender, EventArgs e)
        {
            TestingGroup tg = this.GetSelectedTestingGroup();

            if (tg != null && MessageBox.Show("Are you sure you want to delete this Test-Group?", "Delete Test-Group", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    DataRepository.DeleteTestingGroup(tg);
                }
                catch (Exception ex)
                {
                    throw new LQTUserException(ex.Message);
                }
            }
        }
Пример #12
0
 private void butDeletegroup_Click(object sender, EventArgs e)
 {
     if (lsvGroups.SelectedItems.Count > 0)//b
     {
         TestingGroup tg = GetSelectedTestingGroup();
         if (tg != null && MessageBox.Show("Are you sure you want to delete this Testing Group?", "Delete Testing Group", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             try
             {
                 _testingArea.TestingGroups.Remove(tg);
             }
             catch (Exception ex)
             {
                 new FrmShowError(CustomExceptionHandler.ShowExceptionText("Error: unable to delete the Testing Group.", ex)).ShowDialog();
             }
         }
         DisplayTestingGroup();
     }
 }
Пример #13
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();
            }
        }
Пример #14
0
 public void RebindTestingGroup(TestingGroup testgroup)
 {
     this._testingGroup = testgroup;
     BindTestingGroup();
 }
Пример #15
0
 public static void DeleteTestingGroup(TestingGroup g)
 {
     DaoFactory.GetDaoFactory().CreateTestingGroupDao().Delete(g);
 }
Пример #16
0
 public static void SaveOrUpdateTestingGroup(TestingGroup tgroup)
 {
     DaoFactory.GetDaoFactory().CreateTestingGroupDao().SaveOrUpdate(tgroup);
 }
Пример #17
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);
        }
Пример #18
0
 public TestGroupPane(TestingGroup testinggroup)
     : this(testinggroup, false)
 {
 }
Пример #19
0
 private static void SetGroup(SqlCommand cm, TestingGroup group)
 {
     DatabaseHelper.InsertInt32Param("@TestingAreaId", cm, group.TestingAreaId);
     DatabaseHelper.InsertStringNVarCharParam("@GroupName", cm, group.GroupName);
     DatabaseHelper.InsertStringNVarCharParam("@Description", cm, group.Description);
 }