Inheritance: ICommentable
    static void Main()
    {
        School hogwards = new School();

        Class blackMagic = new Class("Black Magic");

        Teacher snape = new Teacher("Snape");

        snape.Comments = "brrrrr";

        Discipline blackStuffPractise = new Discipline("Black stuff and dark stuff",1,200);
        blackStuffPractise.Comments = "brr";

        snape.AddDiscipline(blackStuffPractise);

        blackMagic.AddTeacher(snape);

        hogwards.AddClass(blackMagic);

        foreach (var clas in hogwards.Classes)
        {
            foreach (var teach in clas.Teachers)
            {
                foreach (var disc in teach.Disciplines)
                {
                    Console.WriteLine(disc.Name);
                }
            }
        }
    }
        public static void Main()
        {
            Student student1 = new Student("Aaaa Bbb", 1);
            Student student2 = new Student("Cccc Ddd", 2);
            Student student3 = new Student("Eeee Fff", 3, "ZZZZZZZZZZZZZ");

            Teacher teacher1 = new Teacher("Zzzz yyyy");
            Teacher teacher2 = new Teacher("Xxxx wwww");

            Discipline oop = new Discipline("oop", 12, 10, "AAAAAAAA");
            Discipline csharp = new Discipline("Csharp", 20, 14);
            Discipline java = new Discipline("Java", 15, 16);

            teacher1.AddDisicipline(oop);
            teacher1.AddDisicipline(csharp);
            teacher2.AddDisicipline(oop);
            teacher1.ListOfDisciplines.Add(java);
            School mySchool = new School();
            ClassInSchool myClass = new ClassInSchool("MyClassName");
            myClass.AddStudent(student1);
            myClass.AddStudent(student2);
            myClass.AddStudent(student3);
            myClass.RemoveStudent(student1);
            myClass.AddTeacher(teacher1);
            myClass.AddTeacher(teacher2);
            mySchool.AddClass(myClass);
            System.Console.WriteLine(myClass);
        }
Esempio n. 3
0
 public RoutingItem(object key, Discipline discipline, 
     int routingOrder, ProjectContact recipient, 
     DateTime dateSent) 
     : this(key, discipline, 
         routingOrder, recipient, dateSent, null)
 {
 }
Esempio n. 4
0
    static void Main()
    {
        //some tests
        Student go6o = new Student("Go6o", 1245);
        Student to6o = new Student("To6o", 2345);
        to6o.AddComment("YOU SHAL NOT PAAAAASSS!!!");
        to6o.AddComment("To be expelled");

        Discipline borringStuff = new Discipline("Borring Stuff", 100, 1);
        List<Discipline> profesorovDisciplines = new List<Discipline>()
        {
            borringStuff
        };
        Teacher profesorov = new Teacher("Profesorov", profesorovDisciplines);
        //create class
        List<Student> class1AStudents = new List<Student>()
        { 
            to6o, go6o
        };
        List<Teacher> class1ATeachers = new List<Teacher>()
        {
            profesorov
        };
        List<SchoolClass> TUClasses2 = new List<SchoolClass>()
        {
            new SchoolClass(class1AStudents, "Class 1-A", class1ATeachers)
        };
        School TU = new School(TUClasses2);
    }
    static void Main()
    {
        Discipline math = new Discipline("Math", 15, 15);
        Discipline biology = new Discipline("Biology", 10, 10);
        Discipline history = new Discipline("History", 5, 5);
        history.Comment = "Optional comment"; // add comment

        Student firstStudent = new Student("Borislav Borislavov", 2);
        firstStudent.Comment = "Optional comment"; // add comment

        Student secondStudent = new Student("Vasil Vasilev", 4);

        Teacher firstTeacher = new Teacher("Ivan Ivanov");
        firstTeacher.AddDicipline(math);

        Teacher secondTeacher = new Teacher("Peter Petrov");
        secondTeacher.AddDicipline(biology);
        secondTeacher.AddDicipline(history);
        secondTeacher.Comment = "Optional comment"; // add comment

        Class firstClass = new Class("12B");
        firstClass.Comment = "Optional comment"; // add comment

        firstClass.AddStudent(firstStudent);
        firstClass.AddStudent(secondStudent);

        firstClass.AddTeacher(firstTeacher);
        firstClass.AddTeacher(secondTeacher);

        Console.WriteLine(firstClass);
    }
 public ShortBlock(DateTime start, Discipline discipline)
     : this()
 {
     Start = start;
     Duration = TimeSpan.FromMinutes(45);
     Discipline = discipline;
     Length = BlockLength.Short;
 }
Esempio n. 7
0
 public void RemoveDiscipline(Discipline discipline)
 {
     if (!this.disciplines.Contains (discipline))
     {
         throw new ArgumentException ("No such teacher in this class found !");
     }
     this.disciplines.Remove (discipline);
 }
 public LongBlock(DateTime start, Discipline discipline)
     : this()
 {
     Start = start;
     Duration = TimeSpan.FromHours(1);
     Discipline = discipline;
     Length = BlockLength.Long;
 }
Esempio n. 9
0
 public VampClan(string nm, string atr1, string atr2, Discipline d1, Discipline d2, Discipline d3, string desc)
 {
     name = nm;
     description = desc;
     attr1 = atr1;
     attr2 = atr2;
     disc1 = d1;
     disc2 = d2;
     disc3 = d3;
 }
Esempio n. 10
0
        /*
            School classes:

                We are given a school. In the school there are classes of students. Each class has a set of teachers. Each teacher teaches, a set of
                disciplines. Students have a name and unique class number. Classes have unique text identifier. Teachers have a name. Disciplines have
                a name, number of lectures and number of exercises. Both teachers and students are people. Students, classes, teachers and disciplines
                could have optional comments (free text block).
                Your task is to identify the classes (in terms of OOP) and their attributes and operations, encapsulate their fields, define the class
                hierarchy and create a class diagram with Visual Studio.

        */
        static void Main()
        {
            var listWithStudents = new Student[]
            {
                new Student("Ivan", "1221"),
                new Student("Stefan", "1222"),
                new Student("Petkan", "1223"),
                new Student("Dimitrinka", "1224"),
                new Student("Leila", "1225"),

            };

            listWithStudents[0].AddComment("This student is very smart.");
            listWithStudents[0].AddComment("Just kidding :D");
            listWithStudents[3].AddComment("This is a boy!");

            var listWithDisciplines = new Discipline[]
            {
                new Discipline("Math", 25, 25),
                new Discipline("Programming with c#", 30, 30),
                new Discipline("Programming with Java", 30, 25),
                new Discipline("Algorithms", 30, 15),
                new Discipline("Multimedia hardware", 15, 20),
                new Discipline("English", 25, 25),
                new Discipline("Computer graphics", 25, 25),
            };

            listWithDisciplines[0].AddComment("This discipline is very hard!");
            listWithDisciplines[4].AddComment("This discipline is meaningless");

            var listOfTechers = new Teacher[]
            {
                new Teacher("Doncho Minkov", listWithDisciplines[1], listWithDisciplines[2], listWithDisciplines[6]),
                new Teacher("Niki ", listWithDisciplines[0]),
                new Teacher("Ivo", listWithDisciplines[4]),
                new Teacher("Evlogi Hristov", listWithDisciplines[5], listWithDisciplines[3])
            };
            listOfTechers[0].AddComment(string.Format("{0} explains well", listOfTechers[0].Name));
            listOfTechers[3].AddComment("He explains well");

            var listOfClasses = new Class[]
            {
                new Class("1+", listOfTechers),
                new Class("2+", listOfTechers[0]),
                new Class("3+", listOfTechers[0], listOfTechers[1], listOfTechers[3]),
            };

            listOfClasses[0].AddStudents(listWithStudents);
            listOfClasses[1].AddStudents(listWithStudents[0], listWithStudents[1]);
            listOfClasses[2].AddStudents(listWithStudents[0], listWithStudents[1], listWithStudents[3]);

            var newSchool = new School(listOfClasses);
            Console.WriteLine(newSchool);
        }
Esempio n. 11
0
 public RoutingItem(object key, Discipline discipline,
     int routingOrder, ProjectContact recipient,
     DateTime dateSent, DateTime? dateReturned)
 {
     this.key = key;
     this.discipline = discipline;
     this.routingOrder = routingOrder;
     this.recipient = recipient;
     this.dateSent = dateSent;
     this.DateReturned = dateReturned;
 }
Esempio n. 12
0
 public void RemoveDiscipline(Discipline discipline)
 {
     int value;
     if (this.setOfDisciplines.TryGetValue(discipline, out value))
     {
         this.setOfDisciplines.Remove(discipline);
     }
     else
     {
         throw new ArgumentException("This discipline has not been assigned to this teacher.");
     }
 }
Esempio n. 13
0
    static void Main()
    {
        // == Disciplines ==
        Discipline math = new Discipline("Math", 23, 23);
        Discipline bio = new Discipline("Bio", 23, 34);
        Discipline geo = new Discipline("Geo", 27, 44);

        // == Teachers ==
        Teacher Dimitar = new Teacher("Dimitar Lilov", 34, Gender.Male);
        Dimitar.AddDiscipline(math);
        Dimitar.AddDiscipline(bio);

        Teacher Kiril = new Teacher("Kiril Nikolov", 29, Gender.Male);
        Kiril.AddDiscipline(geo);

        // == Students ==
        Student Aneliq = new Student("Aneliq Iordanova", 17, Gender.Female, 000354);
        Student Yoana = new Student("Yoana Ivanova", 18, Gender.Female, 000359);
        Yoana.AddComment("EGN - 2342623623");

        // == List Of Teachers ==
        List<Teacher> teachers = new List<Teacher>();
        teachers.Add(Dimitar);
        teachers.Add(Kiril);

        // == List Of Students ==
        List<Student> students = new List<Student>();
        students.Add(Aneliq);
        students.Add(Yoana);

        // == StudentClass ==
        StudentClass firstClass = new StudentClass("10B", students, teachers);

        // == School ==
        School washington = new School("Washington");
        washington.AddSchoolClass(firstClass);

        // == Printing ==
        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("Printing School ...");
        Console.ResetColor();
        Console.WriteLine();
        Console.WriteLine(washington);

        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("Printing Class ...");
        Console.ResetColor();
        Console.WriteLine();
        Console.WriteLine(firstClass);

        Console.ReadLine();
    }
Esempio n. 14
0
 static void Main()
 {
     School angl = new School("vtora angliiska", "sv troica");
     Teacher ivanov = new Teacher("ivanov",43,"Male");
     Student asq = new Student("Asq", 21, "Female", "316");
     Discipline biology = new Discipline("biology", 10, 5);
     asq.Like(biology);
     asq.Like(ivanov);
     asq.Likes();
     Console.WriteLine(asq.LikeList.Count());
     angl.SchoolAddStudent(asq);
     angl.SchoolAddTeacher(ivanov);
 }
Esempio n. 15
0
    static void Main(string[] args)
    {
        //We are given a school. In the school there are classes of students. Each class
        //has a set of teachers. Each teacher teaches a set of disciplines. Students have
        //name and unique class number. Classes have unique text identifier. Teachers have
        //name. Disciplines have name, number of lectures and number of exercises. Both teachers
        //and students are people. Students, classes, teachers and disciplines could have optional
        //comments (free text block).
        //Your task is to identify the classes (in terms of  OOP) and their attributes and operations,
        //encapsulate their fields, define the class hierarchy and create a class diagram with Visual Studio.

        //I use this class(class Scool) like a scool.
        try
        {
            //Initialize some students
            Student joro = new Student("Joro", 19877);
            Student petur = new Student("Petur", 19878);
            Student ivo = new Student("Ivo", 19879);

            //...some disciplines
            Discipline math = new Discipline("Mathematic", 8, 5);
            Discipline bio = new Discipline("Biology", 7, 3);

            // ... teacher
            Teacher ivanov = new Teacher("Ivanov");
            //Adding some disciplines that he teaching
            ivanov.SetOfDisciplines.Add(math);
            ivanov.SetOfDisciplines.Add(bio);

            //Make a class with students and teacher
            Class theBestClass = new Class("The best of the best");
            theBestClass.SetOfStudents.Add(joro);
            theBestClass.SetOfStudents.Add(petur);
            theBestClass.SetOfStudents.Add(ivo);
            theBestClass.SetOfTeachers.Add(ivanov);
            Console.WriteLine("Our clas - \"{0}\" have {1} studets :\n{2}and {3} teacher(s) :\n{4}"
                , theBestClass.UniqueTextIdentifier, theBestClass.SetOfStudents.Count, theBestClass.Students()
                , theBestClass.SetOfTeachers.Count, theBestClass.Teachers());

            //Add and show some optional comments
            ivo.AddComment("Ivo is football player");
            ivanov.AddComment("Mr. Ivanov do not like football players.");
            Console.WriteLine(ivo.ShowComment()+","+ivanov.ShowComment());

        }
        catch (Exception ex)
        {

            Console.WriteLine("Error!" + ex.Message); ;
        }
    }
    public void Refresh_button_currentselection()
    {
        state = play_and_learn_scenario._play_scenario_state;
        //State of the application
        switch (state){
        case Play_scenario_state.START_SCREEN:
        case Play_scenario_state.MAIN_MENU:
        case Play_scenario_state.PREFERENCES:
        case Play_scenario_state.MODALITY_MENU:
            //All buttons are not visibles
            button_modality.SetActive(false);
            button_discipline.SetActive(false);
            button_skill.SetActive(false);
            break;
        case Play_scenario_state.DISCIPLINE_MENU:
            button_modality.SetActive(true);
            button_discipline.SetActive(false);
            button_skill.SetActive(false);
            //Text on buttons
            modality = _database.getModality(GlobalVariables.selected_modality_id);
            button_modality.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=modality.name;

            break;
        case Play_scenario_state.SKILL_MENU:
            button_modality.SetActive(true);
            button_discipline.SetActive(true);
            button_skill.SetActive(false);
            //Text on buttons
            modality = _database.getModality(GlobalVariables.selected_modality_id);
            button_modality.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=modality.name;
            discipline = _database.getDiscipline(GlobalVariables.selected_discipline_id);
            button_discipline.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=discipline.name;

            break;
        case Play_scenario_state.HEROE_MENU:
            button_modality.SetActive(true);
            button_discipline.SetActive(true);
            button_skill.SetActive(true);
            //Text on buttons
            modality = _database.getModality(GlobalVariables.selected_modality_id);
            button_modality.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=modality.name;
            discipline = _database.getDiscipline(GlobalVariables.selected_discipline_id);
            button_discipline.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=discipline.name;
            skill = _database.getSkill(GlobalVariables.selected_skill_id);
            button_skill.GetComponent<Button>().GetComponentsInChildren<Text>()[0].text=skill.name;

            break;
        }
    }
 public Benchmark(
     Discipline discipline,
     int ageFrom,
     int ageUntil,
     char gender,
     string rank,
     double benchmark
 )
 {
     this.discipline = discipline;
     this.ageFrom = ageFrom;
     this.ageUntil = ageUntil;
     this.gender = gender;
     this.rank = rank;
     this.benchmark = benchmark;
 }
 private static void Main()
 {
     var mg = new School("Математическа гимназия - Атанас Радев");
     var stanislav = new Student("Станислав Славов", 124225);
     var gosho = new Student("Георги Ганков", 124233);
     var biology = new Discipline("Биология", 10, 8);
     var physics = new Discipline("Физика", 8, 4);
     var math = new Discipline("Математика", 20, 20);
     var english = new Discipline("Английски език", 18, 10);
     var literature = new Discipline("Литература", 10, 0);
     var minka = new Teacher("Минка Георгиева");
     var pencho = new Teacher("Пенчо Минчев");
     minka.AddToughtDisciplines(biology, literature, english);
     pencho.AddToughtDisciplines(math, physics);
     var b12 = new Class("12-ти Б");
     mg.AddClass(b12);
     b12.AddStudents(stanislav, gosho);
 }
Esempio n. 19
0
 private static void Main()
 {
     var firstDiscipline = new Discipline("Mathematic", 20, 3, "Some comment for math...");
     var secondDiscipline = new Discipline("Physics", 22, 4);
     var firstTeacher = new Teacher("Georgi Gerogiev", "Some comment for the teacher...");
     var secondTeacher = new Teacher("Ivan Ivanov");
     firstTeacher.AddDiscipline(firstDiscipline);
     firstTeacher.AddDiscipline(secondDiscipline);
     secondTeacher.AddDiscipline(firstDiscipline);
     secondTeacher.AddDiscipline(secondDiscipline);
     var firstStudent = new Student("Pesho Peshov", 112, "Some comment about the student...");
     var secondStudent = new Student("Gosho Goshov", 113);
     var exampleSchoolClass = new School("Some unique ID", "Some comment...");
     exampleSchoolClass.AddStudent(firstStudent);
     exampleSchoolClass.AddStudent(secondStudent);
     exampleSchoolClass.AddTeacher(firstTeacher);
     exampleSchoolClass.AddTeacher(secondTeacher);
 }
    static void Main()
    {
        IList<Student> students = new List<Student>
        {
            new Student("Георги Пешев", 1),
            new Student("Димитър Иванов", 2),
            new Student("Иван Цветанов", 5),
            new Student("Гергана Зафирова", 3),
            new Student("Стела Маринова", 4)
        };

        var html = new Discipline("HTML", 6);
        html.AddStudent(students[0]);
        html.AddStudent(students[2]);
        html.AddStudent(students[4]);
        html.Ditails = "Вечерни курсове";

        var css = new Discipline("CSS", 5);
        css.AddStudent(students[0]);
        css.AddStudent(students[1]);
        css.AddStudent(students[2]);

        var java = new Discipline("Java", 4);
        java.AddStudent(students[1]);
        java.AddStudent(students[3]);
        java.AddStudent(students[4]);

        var javaScript = new Discipline("JavaScript", 5,students);

        var webDevelopmentTeacher = new Teacher("Владимир Георгиев");
        webDevelopmentTeacher.AddDiscipline(html);
        webDevelopmentTeacher.AddDiscipline(css);
        webDevelopmentTeacher.AddDiscipline(javaScript);

        var JavaDevelopmentTeacher = new Teacher("Тодор Куртев");
        JavaDevelopmentTeacher.AddDiscipline(java);

        var classA = new Class("A", new List<Teacher> { webDevelopmentTeacher, JavaDevelopmentTeacher });

        string str = classA.ToString();
        Console.WriteLine(classA);

    }
Esempio n. 21
0
    static void Main()
    {
        School firstLanguageSchool = new School("First Language School");

        Discipline math = new Discipline("Basic Mathematics", 15, 11, "Kofti predmet");
        Discipline math2 = new Discipline("Mathematics 2-nd part", 14, 2);
        Console.WriteLine(math);

        Teacher first = new Teacher("Kolio", "Ivanov", "Idiot");
        first.AddDiscipline(math);
        first.AddDiscipline(math2);
        Console.WriteLine(first);

        Student firstStudent = new Student("Liolio", "Peshev", "Very poor performance", "11b");
        Console.WriteLine(firstStudent);

        SchoolClass eleven = new SchoolClass("Eleventh grade");
        eleven.AddTeacher(first);
    }
Esempio n. 22
0
    static void Main()
    {
        Student marko = new Student("Marko Ivanov", "015");
        Student petkan = new Student("Petkan Ivanov", "91");
        Student dragan = new Student("Dragan Ivanov", "015");
        List<Student> students = new List<Student>(){marko, petkan, dragan};

        Discipline biology = new Discipline("Biology", 12, 12);
        Discipline chemistry = new Discipline("Chemistry", 15, 12);
        Discipline math = new Discipline("Math", 150, 100);
        List<Discipline> disciplines=new List<Discipline>(){biology, chemistry,math};

        Teacher petkov = new Teacher("Georgi Dimitrov", disciplines);
        List<Teacher> teachers = new List<Teacher>() { petkov };

        ClassOfStudents classA = new ClassOfStudents("11A", teachers, students);

        Console.WriteLine("The teacher of {0} of {1} is {2}", disciplines[0].Name,
            classA.ClassIdentifier,teachers[0].Name);
    }
    static void Main()
    {
        School school = new School("ГПЧЕ");
        Console.WriteLine(school);

        SchoolClass schoolClass = new SchoolClass('A');
        Console.WriteLine(schoolClass);

        Student pesho = new Student("Pesho", 23);
        Console.WriteLine(pesho);

        Discipline disciplines = new Discipline("Programing in C", 1, 1);
        Console.WriteLine(disciplines);

        List<string> teacherDisciplines = new List<string>();
        teacherDisciplines.Add("Informatics");
        teacherDisciplines.Add("Mathematics");

        Teacher marinov = new Teacher("Marinov", teacherDisciplines);
        Console.WriteLine(marinov);
    }
Esempio n. 24
0
    static void Main()
    {
        Student stud1 = new Student("Mario", 1);
        Student stud2 = new Student("Batman", 4);
        Student stud3 = new Student("Optimus  Prime", 3);
        Student[] students = new Student[] { stud1, stud2, stud3};

        Discipline disp1 = new Discipline("OOP", 40, 40);

        Teacher teach1 = new Teacher("Morgan Freeman", new Discipline[] { disp1 });
        Teacher[] teachers = new Teacher[] {teach1};

        Class class1 = new Class(students, teachers, "12A");

        Console.Write("The name of the first discipline of the first teacher of the first class: ");
        Console.WriteLine(class1.Teachers[0].Disciplines[0].Name);

        stud1.AddComment("ninja");
        Console.Write("The first comment for the first studdent: ");
        Console.WriteLine(stud1.Comments[0]);
    }
Esempio n. 25
0
    static void Main()
    {
        MYSchool university = new MYSchool();

        Class firstClass = new Class("firstClass");

        Teacher george = new Teacher("George");

        Discipline algebra = new Discipline("Algebra", 10, 10);
        algebra.Comments.Add("Required");

        george.Disciplines.Add(algebra);
        george.Comments.Add("Good Teacher");

        firstClass.Teachers.Add(george);
        university.Classes.Add(firstClass);

        Student ivan = new Student("Ivan", 20);
        ivan.Comments.Add("Smoker");

        firstClass.Students.Add(ivan);
    }
Esempio n. 26
0
        static void Main()
        {
            var strudent1 = new Student("f66513", "Ivan", "Nikolov");
            var strudent2 = new Student("f12350", "Gosho", "Peshev");
            var strudent3 = new Student("f53349", "Emil", "Minkov");

            var firstAClass = new Class("123");
            firstAClass.Students.Add(strudent1);
            firstAClass.Students.Add(strudent2);
            firstAClass.Students.Add(strudent3);
            firstAClass.Description = "Brace yourself!";

            var math = new Discipline("Math") { ExercisesNumber = 20, LecturesNumber = 30 };
            var literature = new Discipline("Literature") { LecturesNumber = 50 };

            var teacher = new Teacher("Pesho", "Ivanov");
            teacher.Description = "The best in his field.";
            teacher.Discipline.Add(math);
            teacher.Discipline.Add(literature);

            var school = new Items.School("PMG");
            school.Address = "Sofia";
            school.Students.Add(strudent1);
            school.Students.Add(strudent2);
            school.Students.Add(strudent3);
            school.Teachers.Add(teacher);
            school.Classes.Add(firstAClass);
            school.Disciplines.Add(literature);

            Console.WriteLine(school.Name);
            Console.WriteLine(school.Address);
            Console.WriteLine("Name of discipline: {0}", math.Name);
            Console.WriteLine("Teacher's name: {0} {1}", teacher.FirstName, teacher.LastName);
            Console.WriteLine("Description of the teacher: {0}", teacher.Description);
            Console.WriteLine("Description of the discipline: {0}", firstAClass.Description);
            Console.WriteLine("Number of lectures: {0}", math.LecturesNumber);
            Console.WriteLine("Number of exercises: {0}", math.ExercisesNumber);
        }
Esempio n. 27
0
    public void AddDiscipline(Discipline discipl)
    {
        Console.WriteLine("Adding a discipline (\"{1}\") to the teacher {0}:", this.Name, discipl.Name);
        if (this.teachersDisciplines==null)
        {
            this.teachersDisciplines = new List<Discipline>();
        }
        if (discipl.ExerciseNumbers == null)
        {
            Console.Write("Please enter the number of exercises of the discipline {0}/teacher {1}:", discipl.Name, this.Name);
            discipl.ExerciseNumbers = uint.Parse(Console.ReadLine());
        }

        if (discipl.LectureNumber == null)
        {
            Console.Write("Please enter the number of luctures of this discipline {0}/teacher {1}:", discipl.Name, this.Name);
            discipl.LectureNumber = uint.Parse(Console.ReadLine());
        }

        this.teachersDisciplines.Add(discipl);
        Console.WriteLine("Adding completed.");
        Console.WriteLine();
    }
    static void Main()
    {
        School svishtovSchool = new School("State high school of economics \"Dimitar Hadzhivasilev\"");
        Class first = new Class("1es42QwE", "We are number one!");
        first.Students.Add(new Student("Petar", 16, 1, "Quite noisy this guy..."));
        first.Students.Add(new Student("Georgi", 15, 2));
        first.Students.Add(new Student("Penka", 17, 3, "A programmer girl. Can you believe it?"));

        Teacher petkov = new Teacher("Petkov", 42);
        Teacher dimitrov = new Teacher("Dimitrov", 48);

        Discipline history = new Discipline("History", 18);
        history.Students.Add(new Student("Nasko", 14, 4));

        petkov.Disciplines.Add(history);
        dimitrov.Disciplines.Add(new Discipline("Geography", 12));

        first.Teachers.Add(petkov);
        first.Teachers.Add(dimitrov);
        svishtovSchool.Classes.Add(first);

        Console.WriteLine(svishtovSchool.ToString());
    }
Esempio n. 29
0
    static void Main()
    {
        // Creating students
        Student firstStudent = new Student("Dimitar Penev", 1);
        Student secondStudent = new Student("Emil Kostadinov", 2);
        Student thirdStudent = new Student("Krasimir Balakov", 3);
        Student fourthStudent = new Student("Zdravko Zdravkov", 4);

        // Creating disciplines
        Discipline biology = new Discipline("Biology", 8, 4);
        Discipline mathematics = new Discipline("Mathematics", 4, 2);
        Discipline economics = new Discipline("Economics", 4, 4);

        // Creating teachers
        Teacher firstTeacher = new Teacher("Kiril Hristov", new List<Discipline>() { biology });
        Teacher secondTeacher = new Teacher("Atanas Dalchev", new List<Discipline>() { mathematics });
        Teacher thirdTeacher = new Teacher("Isaac Newton", new List<Discipline>() { mathematics, economics });

        // Creating class
        Class griffindor = new Class("Griffindor", new List<Student>() { firstStudent, secondStudent, thirdStudent, fourthStudent }, new List<Teacher>() { firstTeacher, secondTeacher, thirdTeacher });

        // Creating school
        School kokiche = new School(new List<Class>() { griffindor });

        thirdStudent.SetComment("Hard-working");
        secondTeacher.SetComment("Lazy");
        griffindor.SetComment("Underachieving");
        biology.SetComment("Hard");

        Console.WriteLine(kokiche.ToString());

        Console.WriteLine("Displaying comments:");
        Console.WriteLine(thirdStudent.GetComment());
        Console.WriteLine(secondTeacher.GetComment());
        Console.WriteLine(griffindor.GetComment());
        Console.WriteLine(biology.GetComment());
    }
Esempio n. 30
0
        static void Main()
        {
            //Instance of a school
            School mySchool = new School("125SOU");
            //Instance of a new teacher
            Teacher teach01 = new Teacher("Antonova");
            //Instance of a new discipline
            Discipline discipl01 = new Discipline(DisciplineName.Arts);
            //Add a discipline to teachers list - during this process you have to mark number of lectures and number of exercises
            teach01.AddDiscipline(discipl01);
            //instance of a new class
            Class myClass = new Class("first B");
            //Add this class to schools list
            mySchool.AddAClassInTheSchool(myClass);

            //Instance of another class - with the same name(identifier) - to check if it unique
            Class anotherClass = new Class("first B");
            //Add another class with the same identifier - the program will warn you and will ask to change this identifier
            mySchool.AddAClassInTheSchool(anotherClass);

            //Instance of a student
            Student stud01 = new Student("Petar");
            //Add this student to first class
            myClass.AddAStudent(stud01); //The program will ask for classnumber and will check if it unique

            //Instance of another student
            Student stud02 = new Student("Vania");
            myClass.AddAStudent(stud02); //Try to give this student the same class number as the first student

            //Add a teacher to a class
            myClass.AddATeacher(teach01);

            //Test adding comments
            mySchool.AddComment();
            teach01.AddComment();
        }
Esempio n. 31
0
 public LeagueCreate(Discipline _discipline)
 {
     discipline = _discipline;
     InitializeComponent();
 }
Esempio n. 32
0
 public bool ChangeDiscipline(Discipline type)
 {
     return(true);
 }
Esempio n. 33
0
        public static List <IBHoMObject> FromRevit(this Autodesk.Revit.DB.Plumbing.Pipe pipe, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            switch (discipline)
            {
            case Discipline.Architecture:
            case Discipline.Physical:
            case Discipline.Environmental:
                return(new List <IBHoMObject>(pipe.PipeFromRevit(settings, refObjects)));

            default:
                return(null);
            }
        }
Esempio n. 34
0
 public void RemoveDiscipline(Discipline discipline)
 {
     this.disciplines.Remove(discipline);
 }
        public IActionResult ComputeFinalGrades([FromRoute] string numeMaterie)
        {
            Discipline discipline = _context.Discipline.Where(d => d.Nume.Equals(numeMaterie)).FirstOrDefault();

            if (discipline == null)
            {
                Dictionary <string, string> err = new Dictionary <string, string>();
                err.Add("error", String.Format("There is no discipline called: '{0}'!", numeMaterie));
                return(Json(err));
            }

            List <GradesToDiscipline> gradeToDiscipline = _context.GradeToDiscipline.Where(
                gtd => gtd.Discipline.Nume.Equals(numeMaterie)
                ).ToList();

            foreach (var gtd in gradeToDiscipline)
            {
                double finalGrade = 0;

                foreach (var g in gtd.Grades)
                {
                    if (g.Type != GradeType.LAB && g.Type != GradeType.FINAL)
                    {
                        finalGrade += g.ProcentOuter * g.GradeValue;
                    }
                }

                double labGrade = 0;
                double outer    = 0;
                foreach (var g in gtd.Grades)
                {
                    if (g.Type == GradeType.LAB)
                    {
                        labGrade += g.ProcentInnerType * g.GradeValue;
                        outer     = g.ProcentOuter;
                    }
                }

                finalGrade += labGrade;

                finalGrade /= 100;

                Grade grade = gtd.Grades.Where(gr => gr.Type.ToString().Equals("FINAL")).FirstOrDefault();

                if (grade == null)
                {
                    grade = new Grade
                    {
                        GradeValue       = finalGrade,
                        DataNotei        = DateTime.Now.ToString("dd/MM/yyyy"),
                        Type             = GradeType.FINAL,
                        ProcentInnerType = 100,
                        ProcentOuter     = 100
                    };

                    gtd.Grades.Add(grade);
                }

                else
                {
                    grade.GradeValue       = finalGrade;
                    grade.ProcentInnerType = 100;
                    grade.ProcentOuter     = 100;
                }
            }

            _context.SaveChanges();

            List <Student> students = _context.Student.Where(
                s => s.Grades.Where(
                    g => g.Discipline.Nume.Equals(numeMaterie)
                    ).FirstOrDefault() != null
                ).ToList();

            Service service = new Service(_context);

            service.SendMailToStudents(
                students,
                "Final grades",
                "Hello!\n\nYour teacher posted youe final grade.\nWe hope you passed and we wish you the best of luck :)"
                );

            Dictionary <string, string> response = new Dictionary <string, string>();

            response.Add("success", "The final grades were successfully computed and the students were notified!");
            return(Json(response));
        }
Esempio n. 36
0
 public TeacherForDiscipline(Teacher teacher, Discipline discipline)
 {
     Teacher    = teacher;
     Discipline = discipline;
 }
Esempio n. 37
0
 // With IEnumerable<> we encapsulate the list
 public void AddDiscipline(Discipline discipline)
 {
     // add some validation for the discipline if needed
     this.disciplines.Add(discipline);
 }
 public static RevitPullConfig RevitPullConfig(Discipline discipline = Discipline.Undefined, bool includeClosedWorksets = false, bool includeNestedElements = true, PullGeometryConfig geometryConfig = null, PullRepresentationConfig representationConfig = null, bool pullMaterialTakeOff = false)
 {
     return(new RevitPullConfig {
         Discipline = discipline, IncludeClosedWorksets = includeClosedWorksets, IncludeNestedElements = includeNestedElements, GeometryConfig = geometryConfig, RepresentationConfig = representationConfig, PullMaterialTakeOff = pullMaterialTakeOff
     });
 }
 public static RevitPullConfig RevitPullConfig(Discipline discipline = Discipline.Undefined, bool includeClosedWorksets = false, PullGeometryConfig geometryConfig = null, PullRepresentationConfig representationConfig = null)
 {
     return(new RevitPullConfig {
         Discipline = discipline, IncludeClosedWorksets = includeClosedWorksets, GeometryConfig = geometryConfig, RepresentationConfig = representationConfig
     });
 }
Esempio n. 40
0
 public void AddDiscipline(Discipline discipline)
 {
     this.disciplines.Add(discipline);
 }
Esempio n. 41
0
 internal WithBackgroundProductDefinition(BufferedBinaryReader reader, Discipline discipline) : base(reader,
                                                                                                     discipline)
 {
     BackgroundGeneratingProcessIdentifier = reader.ReadUInt8();
 }
 public Discipline Update(int id, Discipline discipline)
 {
     return(_disciplineRepository.Update(id, discipline));
 }
        public ActionResult SaveDiscipline(DisciplineViewModel model, OptionsViewModel moreInfo, RequestDisplinRepeatGrid grid1)
        {
            List <Error> errors = new List <Error>();

            if (ModelState.IsValid)
            {
                if (ServerValidationEnabled)
                {
                    errors = _hrUnitOfWork.CompanyRepository.CheckForm(new CheckParm
                    {
                        CompanyId    = CompanyId,
                        ObjectName   = "Discipline",
                        TableName    = "Disciplines",
                        Columns      = Models.Utils.GetColumnViews(ModelState),
                        ParentColumn = "CompanyId",
                        Culture      = Language
                    });

                    if (errors.Count() > 0)
                    {
                        foreach (var e in errors)
                        {
                            foreach (var errorMsg in e.errors)
                            {
                                ModelState.AddModelError(errorMsg.field, errorMsg.message);
                            }
                        }

                        return(Json(Models.Utils.ParseFormErrors(ModelState)));
                    }
                }
                var Sequence = _hrUnitOfWork.Repository <Discipline>().Select(s => s.Code).DefaultIfEmpty(0).Max();
                var MaxCode  = Sequence == 0 ? 1 : Sequence + 1;
                var record   = _hrUnitOfWork.Repository <Discipline>().FirstOrDefault(j => j.Id == model.Id);
                if (record == null) //Add
                {
                    record = new Discipline();
                    AutoMapper(new Models.AutoMapperParm
                    {
                        Destination = record,
                        Source      = model,
                        ObjectName  = "Discipline",
                        Options     = moreInfo,
                        Transtype   = TransType.Insert
                    });
                    record.CreatedTime = DateTime.Now;
                    record.CreatedUser = UserName;
                    record.Code        = MaxCode;

                    if (record.StartDate > record.EndDate)
                    {
                        ModelState.AddModelError("EndDate", MsgUtils.Instance.Trls("MustGreaterthanStart"));
                        return(Json(Models.Utils.ParseFormErrors(ModelState)));
                    }
                    record.CompanyId = model.IsLocal ? CompanyId : (int?)null;
                    _hrUnitOfWork.DisciplineRepository.Add(record);
                }
                else //update
                {
                    AutoMapper(new Models.AutoMapperParm
                    {
                        Destination = record,
                        Source      = model,
                        ObjectName  = "Discipline",
                        Options     = moreInfo,
                        Transtype   = TransType.Update
                    });
                    if (record.StartDate > record.EndDate)
                    {
                        ModelState.AddModelError("EndDate", MsgUtils.Instance.Trls("MustGrthanStart"));
                        return(Json(Models.Utils.ParseFormErrors(ModelState)));
                    }

                    record.CompanyId    = model.IsLocal ? CompanyId : (int?)null;
                    record.ModifiedTime = DateTime.Now;
                    record.ModifiedUser = UserName;
                    _hrUnitOfWork.DisciplineRepository.Attach(record);
                    _hrUnitOfWork.DisciplineRepository.Entry(record).State = EntityState.Modified;
                }
                // Save grid1
                errors = SaveGrid1(grid1, ModelState.Where(a => a.Key.Contains("grid1")), record);
                if (errors.Count > 0)
                {
                    return(Json(errors.First().errors.First().message));
                }
                var    Errors  = SaveChanges(Language);
                string message = "OK," + ((new JavaScriptSerializer()).Serialize(record));
                if (Errors.Count > 0)
                {
                    message = Errors.First().errors.First().message;
                }

                return(Json(message));
            }
            else
            {
                return(Json(Models.Utils.ParseFormErrors(ModelState)));
            }
        }
 public bool ChangeDiscipline(Discipline type)
 {
     // Заглушка
     return(true);
 }
Esempio n. 45
0
        static void Main(string[] args)
        {
            OG      olimpic = new OG("2018", "Beograd/Srbija");
            Athlete s1      = new Athlete("Milan Popovic", new DateTime(1990, 5, 5), "Serbia", "Serbia");
            Athlete s2      = new Athlete("Jelena Markovic", new DateTime(1999, 3, 3), "Serbia", "Serbia");
            Athlete s3      = new Athlete("Amir Hadzic", new DateTime(1998, 1, 13), "France", "France");
            Athlete s4      = new Athlete("Hrvoje Pantic", new DateTime(2002, 2, 15), "UK", "Serbia");
            Athlete s5      = new Athlete("Mitar Miljus", new DateTime(2000, 4, 23), "Belgium", "Serbia");


            Result r1 = new Result(s1, "Second", Medals.Silver);
            Result r2 = new Result(s2, "Second", Medals.Silver);
            Result r3 = new Result(s3, "Sixth", Medals.NoMedal);
            Result r4 = new Result(s4, "First", Medals.NoMedal);
            Result r5 = new Result(s5, "Third", Medals.Bronze);


            Discipline d1 = new Discipline("Athletic", "100m(Men)");

            d1.ListOfResults.Add(r1);
            d1.ListOfResults.Add(r3);
            d1.ListOfResults.Add(r4);
            d1.ListOfResults.Add(r5);

            Discipline d2 = new Discipline("Athletic", "100m(Women)");

            d2.ListOfResults.Add(r2);

            Discipline d3 = new Discipline("Athletic", "200m(Men)");
            Result     r6 = new Result(s1, "Fifth", Medals.NoMedal);
            Result     r7 = new Result(s4, "First", Medals.Gold);

            d3.ListOfResults.Add(r6);
            d3.ListOfResults.Add(r7);

            olimpic._listOfDisciplines.Add(d1);
            olimpic._listOfDisciplines.Add(d2);
            olimpic._listOfDisciplines.Add(d3);

            //Console.WriteLine(olimpic.Show());
            //Console.WriteLine(olimpic.ShowMedalWinners());


            //1.Console.WriteLine(olimpic.TotalAMountOfMedals(s1));
            //2.List<string> disciplineNames = olimpic.DisciplineNames("Serbia");
            //foreach (string item in disciplineNames)
            //{
            //    Console.WriteLine(item);
            //}

            //3.Console.WriteLine(olimpic.TotalNumberOfSports());
            //4.Console.WriteLine(olimpic.WonMedal(s1, "Athletic"));
            //5.Console.WriteLine(olimpic.CountryWithYoungestAthlete());
            //6.Console.WriteLine(olimpic.CountryWIthMostAthlets());

            //7.List<string> countryOnALetter = olimpic.CountryThatStartsWithLetter('S');
            //foreach (string a in countryOnALetter)
            //{
            //    Console.WriteLine(a);
            //}

            //8.List<string> notBornInCOuntry = olimpic.AthletesNotBornInCountryTheyCompeteFor();
            //foreach (string a in notBornInCOuntry)
            //{
            //    Console.WriteLine(a);
            //}

            //9.Console.WriteLine(olimpic.MedalWonOnBirthday());
            //10.Console.WriteLine(olimpic.AmountOfMEdalsWonByHost());
            //11.Console.WriteLine(olimpic.NumberOfAthletesForCertainGender("Muskarci"));

            //12.List<string> young = olimpic.DisciplinesWithMoreThanTwoThirdsUnder25();
            //foreach (string a in young)
            //{
            //    Console.WriteLine(a);
            //}

            //13.List<string> withoutMedals = olimpic.CountriesWithoutMedals();
            //foreach (string a in withoutMedals)
            //{
            //    Console.WriteLine(a);
            //}

            //14.List<string> wihtoutAtlhetes = olimpic.CountriesWithoutAthletesInGivenDiscipline("100m(Women)");
            //foreach (string a in wihtoutAtlhetes)
            //{
            //    Console.WriteLine(a);
            //}

            //15. int[] array = olimpic.AmountOfMEdalsFromGivenDisciplines("100m(Men)", "ojsa sa", "100m(Women)");
            //foreach (int a in array)
            //{
            //    Console.WriteLine(a);
            //}

            //16.List<string> countryNames = olimpic.CountriesWithAthletesInAllDisciplines();
            //foreach (string a in countryNames)
            //{
            //    Console.WriteLine(a);
            //}

            //17.Console.WriteLine(olimpic.AthleteSuccess(s4));

            //18.List<string> winners = olimpic.MedalWinnerInAllDisciplinesCompetedIn();
            //foreach (string a in winners)
            //{
            //    Console.WriteLine(a);
            //}

            //19.Console.WriteLine(olimpic.CountryWithHigestPercentageOfMEdals());

            //20.Console.WriteLine(olimpic.AthletesWithTheMostGoldMedals("Basketball", "Football", "Athletic").Name);

            Console.ReadLine();
        }
Esempio n. 46
0
        /***************************************************/

        public static IEnumerable <IBHoMObject> FromRevit(this FamilyInstance familyInstance, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            switch (discipline)
            {
            case Discipline.Structural:
                if (typeof(BH.oM.Structure.Elements.Bar).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue))
                {
                    return(familyInstance.BarsFromRevit(settings, refObjects).Cast <IBHoMObject>());
                }
                else
                {
                    return(null);
                }

            case Discipline.Physical:
            case Discipline.Architecture:
                if (typeof(BH.oM.Physical.Elements.Window).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue))
                {
                    return new List <IBHoMObject> {
                               familyInstance.WindowFromRevit(settings, refObjects)
                    }
                }
                ;
                if (typeof(BH.oM.Physical.Elements.Door).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue))
                {
                    return new List <IBHoMObject> {
                               familyInstance.DoorFromRevit(settings, refObjects)
                    }
                }
                ;
                if (typeof(BH.oM.Physical.Elements.Column).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue) || familyInstance.StructuralType == StructuralType.Column)
                {
                    return new List <IBHoMObject> {
                               familyInstance.ColumnFromRevit(settings, refObjects)
                    }
                }
                ;
                if (typeof(BH.oM.Physical.Elements.Bracing).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue) || familyInstance.StructuralType == StructuralType.Brace)
                {
                    return new List <IBHoMObject> {
                               familyInstance.BracingFromRevit(settings, refObjects)
                    }
                }
                ;
                if (typeof(BH.oM.Physical.Elements.Beam).BuiltInCategories().Contains((BuiltInCategory)familyInstance.Category.Id.IntegerValue))
                {
                    return new List <IBHoMObject> {
                               familyInstance.BeamFromRevit(settings, refObjects)
                    }
                }
                ;
                else
                {
                    return(null);
                }

            case Discipline.Environmental:
                return(new List <IBHoMObject> {
                    familyInstance.EnvironmentPanelFromRevit(settings, refObjects)
                });

            default:
                return(null);
            }
        }
Esempio n. 47
0
 public Form5(Discipline d)
 {
     InitializeComponent();
     this.d = d;
 }
Esempio n. 48
0
        /***************************************************/

        public static IEnumerable <IBHoMObject> FromRevit(this EnergyAnalysisDetailModel energyAnalysisModel, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            switch (discipline)
            {
            case Discipline.Environmental:
                return(energyAnalysisModel.EnergyAnalysisModelFromRevit(settings, refObjects));

            default:
                return(null);
            }
        }
 public Discipline Create(Discipline discipline)
 {
     return(_disciplineRepository.Create(discipline));
 }
Esempio n. 50
0
        public void Seed()
        {
            _userService.Add(new Core.Entities.User()
            {
                Login    = $"AndrewThe",
                Password = "******",
                Email    = "*****@*****.**",
                Roles    = new List <Role> {
                    Role.Admin
                },
                UserName    = "******",
                GroupId     = "29627000-e32d-11e7-b070-a7a2334df747",
                PhoneNumber = "123-123-123"
            });
            var lecturer = new User()
            {
                Id       = Guid.NewGuid().ToString(),
                Login    = $"Lecturer",
                Password = "******",
                Email    = "*****@*****.**",
                Roles    = new List <Role> {
                    Role.Lecturer
                },
                UserName    = "******",
                GroupId     = "29627000-e32d-11e7-b070-a7a2334df747",
                PhoneNumber = "123-123-123"
            };

            _userService.Add(lecturer);

            var cathedra = new Cathedra
            {
                Id   = Guid.NewGuid().ToString(),
                Name = "App Math"
            };

            c.Add(cathedra);
            var group = new Group()
            {
                Id         = Guid.NewGuid().ToString(),
                CathedraId = cathedra.Id,
                Name       = "PMP-51",
                DisciplineConfiguration = new List <DisciplineConfiguration>
                {
                    new DisciplineConfiguration {
                        DisciplineType = DisciplineType.Socio, RequiredAmount = 1, Semester = 1
                    },
                    new DisciplineConfiguration {
                        DisciplineType = DisciplineType.Socio, RequiredAmount = 1, Semester = 2
                    },
                    new DisciplineConfiguration {
                        DisciplineType = DisciplineType.Special, RequiredAmount = 1, Semester = 1
                    },
                    new DisciplineConfiguration {
                        DisciplineType = DisciplineType.Special, RequiredAmount = 1, Semester = 2
                    },
                },
                Course = 5,
            };

            g.Add(group);

            for (int i = 0; i < 99; i++)
            {
                _userService.Add(new User()
                {
                    Login    = $"student{i}",
                    Password = "******",
                    Email    = $"*****@*****.**",
                    Roles    = new List <Role> {
                        Role.Student
                    },
                    UserName    = $"student{i}",
                    Course      = 5,
                    GroupId     = group.Id,
                    PhoneNumber = "123-123-123",
                });

                d.Add(new Discipline
                {
                    Id                 = Guid.NewGuid().ToString(),
                    DisciplineType     = i % 2 == 0 ? DisciplineType.Socio : DisciplineType.Special,
                    IsAvailable        = true,
                    LecturerId         = lecturer.Id,
                    Name               = $"Discipline{i}_11",
                    Semester           = 11,
                    ProviderCathedraId = cathedra.Id
                });
                var di = new Discipline
                {
                    Id                 = Guid.NewGuid().ToString(),
                    DisciplineType     = i % 2 == 0 ? DisciplineType.Socio : DisciplineType.Special,
                    IsAvailable        = true,
                    LecturerId         = lecturer.Id,
                    Name               = $"Discipline{i}_12",
                    Semester           = 12,
                    ProviderCathedraId = cathedra.Id
                };
                d.Add(di);
            }
            var disciplines = d.Find(SearchFilter <Discipline> .FilterByEntity(new Discipline {
                DisciplineType = DisciplineType.Special
            }));

            disciplines = new List <Discipline> {
                disciplines[0], disciplines[1]
            };
            group.DisciplineSubscriptions = disciplines.Select(d => d.Id).ToList();

            g.Update(group.Id, group);
        }
        public static void Initialize(ConstellationWebAppContext context)
        {
            // context.Database.EnsureCreated();
            //Look for any students.
            if (!context.PostingTypes.Any())
            {
                var postingType = new PostingType[]
                {
                    new PostingType {
                        PostingTypeName = "Internship"
                    },
                    new PostingType {
                        PostingTypeName = "Full-Time employement"
                    },
                    new PostingType {
                        PostingTypeName = "Part-Time employement"
                    },
                    new PostingType {
                        PostingTypeName = "Salary base pay"
                    },
                    new PostingType {
                        PostingTypeName = "Hourly wage"
                    },
                    new PostingType {
                        PostingTypeName = "Remote"
                    },
                    new PostingType {
                        PostingTypeName = "On Site"
                    },
                    new PostingType {
                        PostingTypeName = "Community Service"
                    },
                    new PostingType {
                        PostingTypeName = "Society Project"
                    },
                    new PostingType {
                        PostingTypeName = "School Project"
                    },
                    new PostingType {
                        PostingTypeName = "Volunteer"
                    }
                };
                foreach (PostingType s in postingType)
                {
                    context.PostingTypes.Add(s);
                }
                context.SaveChanges();
            }

            if (!context.Disciplines.Any())
            {
                var disciplines = new Discipline[]
                {
                    new Discipline {
                        DisciplineName = "Network Engineering"
                    },
                    new Discipline {
                        DisciplineName = "Cyber Security"
                    },
                    new Discipline {
                        DisciplineName = "Database Administration"
                    },
                    new Discipline {
                        DisciplineName = "Quality Assurance Engineering"
                    },
                    new Discipline {
                        DisciplineName = "Software Development"
                    },
                    new Discipline {
                        DisciplineName = "System Administration"
                    },
                    new Discipline {
                        DisciplineName = "Soft Skills"
                    }
                };
                foreach (Discipline dis in disciplines)
                {
                    context.Disciplines.Add(dis);
                }
                context.SaveChanges();

                var skills = new Skill[]
                {
                    //Network Engineering 11
                    new Skill {
                        SkillName = "Troubleshooting of Computer hardware"
                    },
                    new Skill {
                        SkillName = "Managing / Maintaining Servers | Routers | Switches"
                    },
                    new Skill {
                        SkillName = "Security administration port security on switch and IP security on Router via Access list"
                    },
                    new Skill {
                        SkillName = "Email troubleshooting and maintenance"
                    },
                    new Skill {
                        SkillName = "Configuring / Managing / Maintaining Networking Equipment"
                    },
                    new Skill {
                        SkillName = "Network processing: centralized / distributive network connection"
                    },
                    new Skill {
                        SkillName = "Installing / configuring / administering network technologies"
                    },
                    new Skill {
                        SkillName = "Installing / configuring workstations for IP / IPX based LAN"
                    },
                    new Skill {
                        SkillName = "Installing / configuring DHCP Client / Server"
                    },
                    new Skill {
                        SkillName = "Backup Management / Reporting / Recovery"
                    },
                    new Skill {
                        SkillName = "Disaster / Recovery"
                    },
                    new Skill {
                        SkillName = "Security Incident Handling & Response"
                    },
                    //Cyber security 10
                    new Skill {
                        SkillName = "SIEM Management"
                    },
                    new Skill {
                        SkillName = "Audit & Compliance"
                    },
                    new Skill {
                        SkillName = "Analytics & Intelligence"
                    },
                    new Skill {
                        SkillName = "Firewall / IDS / IPS Skills"
                    },
                    new Skill {
                        SkillName = "Intrusion Detection"
                    },
                    new Skill {
                        SkillName = "Application Security Developmentrly"
                    },
                    new Skill {
                        SkillName = "Advanced Malware Prevention"
                    },
                    new Skill {
                        SkillName = "Mobile Device Management"
                    },
                    new Skill {
                        SkillName = "Data Management Protection"
                    },
                    new Skill {
                        SkillName = "Digital Forensics"
                    },
                    new Skill {
                        SkillName = "Identity & Access Management"
                    },
                    //Data 11
                    new Skill {
                        SkillName = "Data Modellings"
                    },
                    new Skill {
                        SkillName = "Extract, Transform, Load various data types and sources"
                    },
                    new Skill {
                        SkillName = "Design and test Database plans"
                    },
                    new Skill {
                        SkillName = "Database Security"
                    },
                    new Skill {
                        SkillName = "Optimize database performance"
                    },
                    new Skill {
                        SkillName = "PostgreSQL"
                    },
                    new Skill {
                        SkillName = "TSQL"
                    },
                    new Skill {
                        SkillName = "SqlServer"
                    },
                    new Skill {
                        SkillName = "MySQL"
                    },
                    new Skill {
                        SkillName = "PLSQL"
                    },
                    new Skill {
                        SkillName = "Oracle"
                    },
                    new Skill {
                        SkillName = "MongoDB"
                    },
                    //QA 12
                    new Skill {
                        SkillName = "Understanding of variation introduced by measurement devices"
                    },
                    new Skill {
                        SkillName = "Effective usage of data analysis tools"
                    },
                    new Skill {
                        SkillName = "Analytical and research skills"
                    },
                    new Skill {
                        SkillName = "Effective interaction with other departments / suppliers"
                    },
                    new Skill {
                        SkillName = "Ability to manage multiple priorities"
                    },
                    new Skill {
                        SkillName = "Drafting/interpreting/implementing quality assurance procedures for the organization"
                    },
                    new Skill {
                        SkillName = "Evaluating new/existing regulations to ensure your quality assurance protocols"
                    },
                    new Skill {
                        SkillName = "Ensuring product quality through regular auditing and testing"
                    },
                    new Skill {
                        SkillName = "Recording the results of your internal audits for reference: statistical data/quality"
                    },
                    new Skill {
                        SkillName = "Identifying areas that can be addressed to improve product quality and safety"
                    },
                    new Skill {
                        SkillName = "Developing training processes for each individual who handles or interacts with the product"
                    },
                    new Skill {
                        SkillName = "Ensuring ongoing compliance and risk management across the organization"
                    },
                    //Sofware 12
                    new Skill {
                        SkillName = "Data Structures and Algorithms"
                    },
                    new Skill {
                        SkillName = "JS/HTML/CSS"
                    },
                    new Skill {
                        SkillName = "Python"
                    },
                    new Skill {
                        SkillName = "SQL"
                    },
                    new Skill {
                        SkillName = "Java"
                    },
                    new Skill {
                        SkillName = "BashShell/Powershell"
                    },
                    new Skill {
                        SkillName = "C#"
                    },
                    new Skill {
                        SkillName = "PHP"
                    },
                    new Skill {
                        SkillName = "C++"
                    },
                    new Skill {
                        SkillName = "TypeScript"
                    },
                    new Skill {
                        SkillName = "Unit Testing"
                    },
                    new Skill {
                        SkillName = "Integration testing"
                    },
                    //sys admin 11
                    new Skill {
                        SkillName = "Desktop Imaging"
                    },
                    new Skill {
                        SkillName = "Installing configuring administrating software applications"
                    },
                    new Skill {
                        SkillName = "Shell Scripting"
                    },
                    new Skill {
                        SkillName = "Linux"
                    },
                    new Skill {
                        SkillName = "Windows"
                    },
                    new Skill {
                        SkillName = "Mac"
                    },
                    new Skill {
                        SkillName = "Vmware"
                    },
                    new Skill {
                        SkillName = "Active Directory"
                    },
                    new Skill {
                        SkillName = "Infrastructure"
                    },
                    new Skill {
                        SkillName = "Domain Controllers"
                    },
                    new Skill {
                        SkillName = "Group Policy"
                    },
                    new Skill {
                        SkillName = "Cloud services."
                    },
                    //soft 12
                    new Skill {
                        SkillName = "Analytical thinking, planning."
                    },
                    new Skill {
                        SkillName = "Strong verbal and personal communication skills"
                    },
                    new Skill {
                        SkillName = "Accuracy and Attention to detail"
                    },
                    new Skill {
                        SkillName = "Organization and prioritization skills"
                    },
                    new Skill {
                        SkillName = "Effective problem analysis"
                    },
                    new Skill {
                        SkillName = "Self motivated"
                    },
                    new Skill {
                        SkillName = "Tolerant and flexible"
                    },
                    new Skill {
                        SkillName = "Enthusiasm"
                    },
                    new Skill {
                        SkillName = "Confidence and assertiveness"
                    },
                    new Skill {
                        SkillName = "Compasionate"
                    },
                    new Skill {
                        SkillName = "Dependable"
                    },
                    new Skill {
                        SkillName = "Leadership"
                    }
                };
                foreach (Skill sk in skills)
                {
                    context.Skills.Add(sk);
                }
                context.SaveChanges();
                //Truncate the skill discpline tabel

                var skillDisciplines = new SkillDiscipline[]
                {
                    //networking : 11
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Troubleshooting of Computer hardware").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Managing / Maintaining Servers | Routers | Switches").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Security administration port security on switch and IP security on Router via Access list").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Email troubleshooting and maintenance").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Configuring / Managing / Maintaining Networking Equipment").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Network processing: centralized / distributive network connection").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Installing / configuring / administering network technologies").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Installing / configuring workstations for IP / IPX based LAN").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Installing / configuring DHCP Client / Server").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Backup Management / Reporting / Recovery").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Disaster / Recovery").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Network Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Security Incident Handling & Response").SkillID
                    },
                    // security : 10
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "SIEM Management").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Audit & Compliance").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Analytics & Intelligence").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Firewall / IDS / IPS Skills").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Intrusion Detection").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Application Security Developmentrly").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Advanced Malware Prevention").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Mobile Device Management").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Data Management Protection").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Digital Forensics").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Cyber Security").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Identity & Access Management").SkillID
                    },
                    //Data 11
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Data Modellings").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Extract, Transform, Load various data types and sources").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Design and test Database plans").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Database Security").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Optimize database performance").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "PostgreSQL").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "SQL").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "SqlServer").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "MySQL").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "PLSQL").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Oracle").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Database Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "MongoDB").SkillID
                    },
                    //QA  12
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Understanding of variation introduced by measurement devices").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Effective usage of data analysis tools").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Analytical and research skills").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Effective interaction with other departments / suppliers").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Ability to manage multiple priorities").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Drafting/interpreting/implementing quality assurance procedures for the organization").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Evaluating new/existing regulations to ensure your quality assurance protocols").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Ensuring product quality through regular auditing and testing").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Recording the results of your internal audits for reference: statistical data/quality").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Identifying areas that can be addressed to improve product quality and safety").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Developing training processes for each individual who handles or interacts with the product").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Quality Assurance Engineering").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Ensuring ongoing compliance and risk management across the organization").SkillID
                    },
                    //Sofware 12
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Data Structures and Algorithms").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "JS/HTML/CSS").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Python").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "SQL").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Java").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "BashShell/Powershell").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "C#").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "PHP").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "C++").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "TypeScript").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Unit Testing").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Software Development").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Integration testing").SkillID
                    },
                    //sys admin 11
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Desktop Imaging").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Installing configuring administrating software applications").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Shell Scripting").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Linux").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Windows").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Mac").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Vmware").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Active Directory").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Infrastructure").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Domain Controllers").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Group Policy").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "System Administration").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Cloud services.").SkillID
                    },
                    //soft 12
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Analytical thinking, planning.").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Strong verbal and personal communication skills").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Accuracy and Attention to detail").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Organization and prioritization skills").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Effective problem analysis").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Self motivated").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Tolerant and flexible").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Enthusiasm").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Confidence and assertiveness").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Compasionate").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Dependable").SkillID
                    },
                    new SkillDiscipline {
                        DisciplineID = disciplines.Single(d => d.DisciplineName == "Soft Skills").DisciplineID, SkillID = skills.Single(s => s.SkillName == "Leadership").SkillID
                    }
                };
                foreach (SkillDiscipline sd in skillDisciplines)
                {
                    context.SkillDisciplines.Add(sd);
                }
                context.SaveChanges();
            }
        }
Esempio n. 52
0
        public void Update(string evt, params object[] data)
        {
            if (evt == LMSNotifications.ApplicationStart)
            {
                if (!isRun)
                {
                    //mTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
                    //mTimer.Start();
                    string root  = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName;
                    int    index = root.IndexOf("\\Plugins");
                    root       = root.Substring(0, index);
                    serverPath = root.Insert(index, "\\Data\\Index");

                    RebuildIndex(data[0] as ILmsService);

                    //var thread = new Thread(startMyTimer);
                    //thread.Start(((IWindsorContainer)data[0]).Resolve<ILmsService>());
                    //isRun = true;
                }
            }

            if (evt == UserNotifications.UserCreate)
            {
                User user = (User)data[0];

                Document document = new Document();
                document.Add(new Field("Type", "User", Field.Store.YES, Field.Index.NO));
                document.Add(new Field("UserID", user.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("User", user.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));

                AddToIndex(document);
            }

            if (evt == UserNotifications.UserEdit)
            {
                Update(UserNotifications.UserDelete, data[0]);
                Update(UserNotifications.UserCreate, data[1]);
            }

            if (evt == UserNotifications.UserDelete)
            {
                User user = (User)data[0];
                Term term = new Term("UserID", user.Id.ToString());
                DeleteFromIndex(term);
            }

            if (evt == DisciplineNotifications.DisciplineCreate)
            {
                Discipline discipline = (Discipline)data[0];
                Document   document   = new Document();
                document.Add(new Field("Type", "Discipline", Field.Store.YES, Field.Index.NO));
                document.Add(new Field("DisciplineID", discipline.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("Owner", discipline.Owner, Field.Store.YES, Field.Index.NO));
                document.Add(new Field("Discipline", discipline.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));

                AddToIndex(document);
            }

            if (evt == DisciplineNotifications.DisciplineEdit)
            {
                Update(DisciplineNotifications.DisciplineDelete, data[0]);
                Update(DisciplineNotifications.DisciplineCreate, data[1]);
            }

            if (evt == DisciplineNotifications.DisciplineDelete)
            {
                Discipline discipline = (Discipline)data[0];
                Term       term       = new Term("DisciplineID", discipline.Id.ToString());
                DeleteFromIndex(term);
            }

            if (evt == DisciplineNotifications.TopicCreate)
            {
                Topic    topic    = (Topic)data[0];
                Document document = new Document();
                document = new Document();
                document.Add(new Field("Type", "Topic", Field.Store.YES, Field.Index.NO));
                document.Add(new Field("TopicID", topic.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("Topic", topic.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
                if (topic.CourseRef == null)
                {
                    document.Add(new Field("CourseRef", "null", Field.Store.YES, Field.Index.NO));
                }
                else
                {
                    document.Add(new Field("CourseRef", topic.CourseRef.ToString(), Field.Store.YES, Field.Index.NO));
                }

                AddToIndex(document);
            }

            if (evt == DisciplineNotifications.TopicEdit)
            {
                Update(DisciplineNotifications.TopicDelete, data[0]);
                Update(DisciplineNotifications.TopicCreate, data[1]);
            }

            if (evt == DisciplineNotifications.TopicDelete)
            {
                Topic topic = (Topic)data[0];
                Term  term  = new Term("TopicID", topic.Id.ToString());
                DeleteFromIndex(term);
            }

            if (evt == UserNotifications.GroupCreate)
            {
                Group    group    = (Group)data[0];
                Document document = new Document();
                document.Add(new Field("Type", "Group", Field.Store.YES, Field.Index.NO));
                document.Add(new Field("GroupID", group.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("Group", group.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));

                AddToIndex(document);
            }

            if (evt == UserNotifications.GroupEdit)
            {
                Update(UserNotifications.GroupDelete, data[0]);
                Update(UserNotifications.GroupCreate, data[1]);
            }

            if (evt == UserNotifications.GroupDelete)
            {
                Group group = (Group)data[0];
                Term  term  = new Term("GroupID", group.Id.ToString());
                DeleteFromIndex(term);
            }

            if (evt == CourseNotifications.NodeCreate)
            {
                Directory   directory = FSDirectory.Open(new System.IO.DirectoryInfo(serverPath));
                Analyzer    analyzer  = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29);
                IndexWriter writer    = new IndexWriter(directory, analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);

                ProcessNode(writer, (IUDICO.Common.Models.Shared.Node)data[0], (((IWindsorContainer)data[0]).Resolve <ILmsService>()).FindService <ICourseService>());

                writer.Optimize();
                writer.Close();
            }

            if (evt == CourseNotifications.NodeEdit)
            {
                Update(CourseNotifications.NodeDelete, data[0]);
                Update(CourseNotifications.NodeCreate, data[1]);
            }

            if (evt == CourseNotifications.NodeDelete)
            {
                IUDICO.Common.Models.Shared.Node node = (IUDICO.Common.Models.Shared.Node)data[0];
                Term term = new Term("NodeID", node.Id.ToString());
                DeleteFromIndex(term);
            }

            if (evt == CourseNotifications.CourseCreate)
            {
                Course   course   = (Course)data[0];
                Document document = new Document();
                document.Add(new Field("Type", "Course", Field.Store.YES, Field.Index.NO));
                document.Add(new Field("CourseID", course.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("Name", course.Name, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
                document.Add(new Field("Owner", course.Owner, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));

                AddToIndex(document);
            }

            if (evt == CourseNotifications.CourseEdit)
            {
                Update(CourseNotifications.CourseDelete, data[0]);
                Update(CourseNotifications.CourseCreate, data[1]);
            }

            if (evt == CourseNotifications.CourseDelete)
            {
                Course course = (Course)data[0];
                Term   term   = new Term("GroupID", course.Id.ToString());
                DeleteFromIndex(term);
            }
        }
Esempio n. 53
0
        /***************************************************/
        /****             Fallback Methods              ****/
        /***************************************************/

        public static IBHoMObject FromRevit(this Element element, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            return(null);
        }
        private List <Error> SaveGrid1(RequestDisplinRepeatGrid grid1, IEnumerable <KeyValuePair <string, ModelState> > state, Discipline Displinobj)
        {
            List <Error> errors = new List <Error>();

            // Deleted
            if (grid1.deleted != null)
            {
                foreach (DisplinRepeatViewModel model in grid1.deleted)
                {
                    var RequestDisplinRepeat = new DisplinRepeat
                    {
                        Id = model.Id
                    };

                    _hrUnitOfWork.DisciplineRepository.Remove(RequestDisplinRepeat);
                }
            }
            // Exclude delete models from sever side validations
            if (ServerValidationEnabled)
            {
                var modified = Models.Utils.GetModifiedRows(state.Where(a => !a.Key.Contains("deleted")));
                if (modified.Count > 0)
                {
                    errors = _hrUnitOfWork.CompanyRepository.Check(new CheckParm
                    {
                        CompanyId  = CompanyId,
                        ObjectName = "DisplinRepeats",
                        Columns    = Models.Utils.GetModifiedRows(state.Where(a => !a.Key.Contains("deleted"))),
                        Culture    = Language
                    });
                    if (errors.Count() > 0)
                    {
                        return(errors);
                    }
                }
            }

            // updated records
            if (grid1.updated != null)
            {
                foreach (DisplinRepeatViewModel model in grid1.updated)
                {
                    var requestRe = new DisplinRepeat();
                    AutoMapper(new Models.AutoMapperParm {
                        Destination = requestRe, Source = model
                    });
                    requestRe.ModifiedTime = DateTime.Now;
                    requestRe.ModifiedUser = UserName;
                    _hrUnitOfWork.DisciplineRepository.Attach(requestRe);
                    _hrUnitOfWork.DisciplineRepository.Entry(requestRe).State = EntityState.Modified;
                }
            }

            // inserted records

            if (grid1.inserted != null)
            {
                foreach (DisplinRepeatViewModel model in grid1.inserted)
                {
                    var requestRe = new DisplinRepeat();
                    AutoMapper(new Models.AutoMapperParm {
                        Destination = requestRe, Source = model
                    });
                    requestRe.Discipline  = Displinobj;
                    requestRe.CreatedTime = DateTime.Now;
                    requestRe.CreatedUser = UserName;
                    _hrUnitOfWork.DisciplineRepository.Add(requestRe);
                }
            }

            return(errors);
        }
Esempio n. 55
0
        /***************************************************/

        public static IBHoMObject FromRevit(this EnergyAnalysisOpening energyAnalysisOpening, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            switch (discipline)
            {
            case Discipline.Environmental:
            case Discipline.Architecture:
            case Discipline.Physical:
                return(energyAnalysisOpening.EnvironmentPanelFromRevit(null, settings, refObjects));

            default:
                return(null);
            }
        }
Esempio n. 56
0
        public IEnumerable <RegistrationWithParticipant> GetRegisteredParticipantOverlappingPeriod(CourseType courseType, Discipline discipline, int niveauId, DateTime from, DateTime to, bool onlyUncommittedRegistrations = false)
        {
            var result = GetRegisteredParticipants()
                         .Where(rp => rp.RegistrationParticipant.CourseType == courseType && rp.RegistrationParticipant.Discipline == discipline && rp.RegistrationParticipant.NiveauId == niveauId)
                         .Where(rp => from <= rp.Registration.AvailableTo && rp.Registration.AvailableFrom <= to);

            if (onlyUncommittedRegistrations)
            {
                // Note: Keep condition in sync with Registration.Status
                result = result.Where(r => r.Registration.RegistrationParticipants.All(rp => rp.ResultingParticipantId == null));
            }

            return(result);
        }
Esempio n. 57
0
        public static IBHoMObject FromRevit(this Autodesk.Revit.DB.Electrical.Wire wire, Discipline discipline, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            switch (discipline)
            {
            case Discipline.Architecture:
            case Discipline.Physical:
            case Discipline.Environmental:
                return(wire.WireFromRevit(settings, refObjects));

            default:
                return(null);
            }
        }
 public Task <Discipline> UpsertAsync(Discipline discipline)
 {
     throw new NotImplementedException();
 }
Esempio n. 59
0
        /// <summary>
        /// 透過日期區間取得獎懲資料,傳入學生ID,開始日期,結束日期,回傳:學生ID,獎懲統計名稱,統計值
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, Dictionary <string, int> > GetDisciplineCountByDate(List <string> StudentIDList, DateTime beginDate, DateTime endDate)
        {
            Dictionary <string, Dictionary <string, int> > retVal = new Dictionary <string, Dictionary <string, int> >();

            List <string> nameList = new string[] { "大功", "小功", "嘉獎", "大過", "小過", "警告", "留校" }.ToList();

            // 取得獎懲資料
            List <DisciplineRecord> dataList = Discipline.SelectByStudentIDs(StudentIDList);

            foreach (DisciplineRecord data in dataList)
            {
                if (data.OccurDate >= beginDate && data.OccurDate <= endDate)
                {
                    // 初始化
                    if (!retVal.ContainsKey(data.RefStudentID))
                    {
                        retVal.Add(data.RefStudentID, new Dictionary <string, int>());
                        foreach (string str in nameList)
                        {
                            retVal[data.RefStudentID].Add(str, 0);
                        }
                    }

                    // 獎勵
                    if (data.MeritFlag == "1")
                    {
                        if (data.MeritA.HasValue)
                        {
                            retVal[data.RefStudentID]["大功"] += data.MeritA.Value;
                        }

                        if (data.MeritB.HasValue)
                        {
                            retVal[data.RefStudentID]["小功"] += data.MeritB.Value;
                        }

                        if (data.MeritC.HasValue)
                        {
                            retVal[data.RefStudentID]["嘉獎"] += data.MeritC.Value;
                        }
                    }
                    else if (data.MeritFlag == "0")
                    { // 懲戒
                        if (data.Cleared != "是")
                        {
                            if (data.DemeritA.HasValue)
                            {
                                retVal[data.RefStudentID]["大過"] += data.DemeritA.Value;
                            }

                            if (data.DemeritB.HasValue)
                            {
                                retVal[data.RefStudentID]["小過"] += data.DemeritB.Value;
                            }

                            if (data.DemeritC.HasValue)
                            {
                                retVal[data.RefStudentID]["警告"] += data.DemeritC.Value;
                            }
                        }
                    }
                    else if (data.MeritFlag == "2")
                    {
                        // 留校察看
                        retVal[data.RefStudentID]["留校"]++;
                    }
                }
            }
            return(retVal);
        }
Esempio n. 60
0
 void Start() {
     _active_disc_ID = Discipline.ASTRA;
     active_disc = Controller.I.discs[_active_disc_ID];
 }