public async Task GetAllFilters() { DbStudyGroup sgc = new DbStudyGroup(); StudentsController sc = new StudentsController(); studyGroupsFilter = sgc.GetAllStudyGroups(); //set checked to false List <StudyGroup> checkedStudyGroups = await sc.GetStudentsStudyGroupFromServer(); // use these to check some to true System.Diagnostics.Debug.WriteLine("studyGroupsFilter.Count: " + studyGroupsFilter.Count); foreach (var sg in studyGroupsFilter) { if (checkedStudyGroups.Contains(sg)) { sg.filterChecked = true; } else { sg.filterChecked = false; } //studyGroupsFilter.Add(sg); } System.Diagnostics.Debug.WriteLine("Another studyGroupsFilter.Count: " + studyGroupsFilter.Count); foreach (var studyGroup in studyGroupsFilter) { studyDict.Add(studyGroup.name, studyGroup.id); } }
void GetAllFilters() { DbStudyGroup sgc = new DbStudyGroup(); studyGroupsFilter = sgc.GetAllStudyGroups(); foreach (var studyGroup in studyGroupsFilter) { studyDict.Add(studyGroup.name, studyGroup.id); } }
private string CreateLocalHash() { DbStudyGroup db = new DbStudyGroup(); List <StudyGroup> studyGroups = db.GetAllStudyGroups(); StringBuilder sb = new StringBuilder(); foreach (var sg in studyGroups) { sb.Append(Hasher.Base64Decode(sg.id)); } return(Hasher.CalculateMd5Hash(sb.ToString())); }
private async void GetAllFilters(object sender, EventArgs e) { DbLocation lc = new DbLocation(); DbCourse cc = new DbCourse(); DbStudyGroup sgc = new DbStudyGroup(); DbJobType jtc = new DbJobType(); List <Location> locationsFilter = lc.GetAllLocations(); List <Course> coursesFilter = cc.GetAllCourses(); List <StudyGroup> studyGroupsFilter = sgc.GetAllStudyGroups(); List <JobType> jobTypesJobFilter = jtc.GetJobTypeFilterJob(); List <JobType> jobTypesProjectFilter = jtc.GetJobTypeFilterProject(); System.Diagnostics.Debug.WriteLine("GetAllFilters: locationsFilter.Count: " + locationsFilter.Count); System.Diagnostics.Debug.WriteLine("GetAllFilters: coursesFilter.Count: " + coursesFilter.Count); System.Diagnostics.Debug.WriteLine("GetAllFilters: studyGroupsFilter.Count: " + studyGroupsFilter.Count); System.Diagnostics.Debug.WriteLine("GetAllFilters: jobTypesJobFilter.Count: " + jobTypesJobFilter.Count); System.Diagnostics.Debug.WriteLine("GetAllFilters: jobTypesProjectFilter.Count: " + jobTypesProjectFilter.Count); }
private void GetAllFilters()//object sender, EventArgs e { //DbLocation lc = new DbLocation(); //DbCourse cc = new DbCourse(); DbStudyGroup sgc = new DbStudyGroup(); //DbJobType jtc = new DbJobType(); //List<Location> locationsGet = lc.GetAllLocations(); //List<Course> coursesGet = cc.GetAllCourses(); studyGroupsFilter = sgc.GetAllStudyGroups(); //List<JobType> jobTypesJobGet = jtc.GetJobTypeFilterJob(); //List<JobType> jobTypesProjectGet = jtc.GetJobTypeFilterProject(); foreach (var studyGroup in studyGroupsFilter) { studyDict.Add(studyGroup.name, studyGroup.id); } //locationsFilter.Add(new Location(TODO)); //add empty location for default "nothing selected" //foreach (var location in locationsGet) //{ // locationsFilter.Add(location); //} //Course velgEmne = new Course(); //velgEmne.name = "Velg emne"; //coursesSettings.Add(velgEmne); //foreach (var course in coursesGet) //{ // coursesSettings.Add(course); //} // for jobs // DbLocation.UpdateLocations(List<Location>) sett max 1 til TRUE ! // for projects // DbCourse.UpdateCourses(List<Course> courses) sett max 1 til TRUE ! // for all // DbJobTypes.UpdateJobTypes(List<JobType> jobTypes) sett max 1 til TRUE ! // // DbStudyGroup.UpdateStudyGroups(List<StudyGroup> studyGroups) }