Example #1
0
 private void AddTestToProfile(string profileDescription, string testDescription)
 {
     AllProfileTests.Add(new ProfileConfigProfileTestsModel()
     {
         Id = -1,
         ProfileDescription = profileDescription,
         TestDescription    = testDescription,
         State = State.Added
     });
 }
Example #2
0
        private void InitializeDemoData()
        {
            //All tests
            var t1 = new ProfileConfigTestModel()
            {
                Id = 213, TestDescription = "TBIL"
            };
            var t2 = new ProfileConfigTestModel()
            {
                Id = 563, TestDescription = "DBIL"
            };

            //Profiles
            var p1 = new ProfileConfigModel()
            {
                Id = 1, ProfileDescription = "Liver Profile", State = State.Clean
            };
            var p2 = new ProfileConfigModel()
            {
                Id = 2, ProfileDescription = "Lipid Profile", State = State.Clean
            };

            //Profile Tests
            var pt1 = new ProfileConfigProfileTestsModel()
            {
                Id = 1, ProfileDescription = "Liver Profile", TestDescription = "TBIL", State = State.Clean
            };

            var pt2 = new ProfileConfigProfileTestsModel()
            {
                Id = 2, ProfileDescription = "Liver Profile", TestDescription = "DBIL", State = State.Clean
            };

            //Add All Tests
            this.Tests.Add(t1);
            this.Tests.Add(t2);

            //Add profiles
            ProfileList.Add(p1);
            ProfileList.Add(p2);

            //Add profile tests to all profile tests model.
            AllProfileTests.Add(pt1);
            AllProfileTests.Add(pt2);
        }
Example #3
0
        private void RemoveAllProfileTestsInProfile(string profileName)
        {
            var allSpecifiedProfileTests = from profileTest in AllProfileTests
                                           where profileTest.ProfileDescription == profileName
                                           select profileTest;

            if (allSpecifiedProfileTests is null)
            {
                return;
            }
            var allSpecifiedProfileTestsList = allSpecifiedProfileTests.ToList();
            var DeleteProfilesCount          = allSpecifiedProfileTestsList.Count();

            if (DeleteProfilesCount == 0)
            {
                return;
            }

            for (int i = 0; i < DeleteProfilesCount; i++)
            {
                AllProfileTests.Remove(allSpecifiedProfileTestsList.ElementAt(i));
            }
        }