当前位置: 首页>>代码示例>>C#>>正文


C# Teacher类代码示例

本文整理汇总了C#中Teacher的典型用法代码示例。如果您正苦于以下问题:C# Teacher类的具体用法?C# Teacher怎么用?C# Teacher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Teacher类属于命名空间,在下文中一共展示了Teacher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 static void Main()
 {
     Teacher Eng = new Teacher("박미영", 35, "영어");
     Thief KangDo = new Thief("야월담", 25, 3);
     Eng.Teach();
     KangDo.Steal();
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:7,代码来源:Program.cs

示例2: Main

        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);
        }
开发者ID:emilti,项目名称:Telerik-Academy-My-Courses,代码行数:28,代码来源:MainProgram.cs

示例3: Main

    static void Main()
    {
        Disciplines disclineOne = new Disciplines("math", 10, 12);
           Disciplines[] discipline = new Disciplines[] { disclineOne};

           Teacher teacherOne = new Teacher("Ivan Ivanov", discipline);
           Teacher[] teachers = new Teacher[] { teacherOne };

           Student studentOne = new Student("Stoyan", 1);
           Student studentTwo = new Student("Daniel", 2);
           Student studentThree = new Student("Yavor", 3);
           Student studentFour = new Student("Pesho", 5);
           Student studentFive = new Student("Darin", 8);
           Student [] students = new Student[]{studentOne,studentTwo,studentThree,studentFour,studentFive};

           ClassesOfStudents classOne = new ClassesOfStudents(teachers, students, "6C");

           classOne.AddTeacher(teacherOne);
           classOne.AddStudent(studentOne);
           classOne.AddStudent(studentFour);

           foreach (var s in students)
           {
           Console.WriteLine("Name of student:{0}",s.Name);
           }

           studentOne.AddText("vacation is over");
           Console.WriteLine("The commnent of student is: {0}", studentOne.FreeTexts[0]);
    }
开发者ID:KaloyanBobev,项目名称:OOP,代码行数:29,代码来源:ClassDiagramOfSchool.cs

示例4: Can_query_with_one_index_used

        public void Can_query_with_one_index_used()
        {
            //Arrange
            var teacher1 = new Teacher("Mathematics", "Arthur", 25, Sex.Male);
            var teacher2 = new Teacher("Mathematics", "Tom", 35, Sex.Male);
            var teacher3 = new Teacher("English", "Andrew", 35, Sex.Male);
            var teacher4 = new Teacher("English", "Bob", 45, Sex.Male);
            var teacher5 = new Teacher("Biology", "John", 55, Sex.Male);
            var teacher6 = new Teacher("Mathematics", "Jessica", 25, Sex.Female);
            var teacher7 = new Teacher("Mathematics", "Andrea", 35, Sex.Female);
            var teacher8 = new Teacher("English", "Kate", 35, Sex.Female);
            var teacher9 = new Teacher("English", "Sandra", 45, Sex.Female);
            var teacher10 = new Teacher("Biology", "Lara", 55, Sex.Female);

            var sut = CacheFactory.CreateFor<Teacher>()
                .WithIndex(teacher => teacher.ResponsibleForClasses)
                .WithIndex(teacher => teacher.Age)
                .WithIndex(teacher => teacher.Name)
                .WithIndex(teacher => teacher.Sex)
                .BuildUp(new[] {teacher1, teacher2, teacher3, teacher4, teacher5, teacher6, teacher7, teacher8, teacher9, teacher10});

            //Act
            var result = sut.Query()
                .Where(t => t.ResponsibleForClasses, classes => classes == "Mathematics")
                .ToList();

            //Assert
            result.ShouldAllBeEquivalentTo(new[] { teacher1, teacher2, teacher6, teacher7 });
        }
开发者ID:damian-krychowski,项目名称:simple-cache,代码行数:29,代码来源:QueryTests.cs

示例5: Main

    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);
    }
开发者ID:hristian-dimov,项目名称:TelerikAcademy,代码行数:31,代码来源:SchoolTest.cs

示例6: CreateTeacher

    public ITeacher CreateTeacher(string name)
    {
        //returns teacher object
        ITeacher newTeacher = new Teacher(name);

        return newTeacher;
    }
开发者ID:vassil,项目名称:CSharp,代码行数:7,代码来源:CourseFactory.cs

示例7: RemoveFavoriteClassRoom

 public void RemoveFavoriteClassRoom(Teacher teacher, ClassRoom classRoom)
 {
     if (favTeachersClassRooms.ContainsKey(teacher))
     {
         favTeachersClassRooms[teacher].Remove(classRoom);
     }
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:7,代码来源:FavoriteTeachersClassRoomsSettings.cs

示例8: InitDoor

        private void InitDoor()
        {
            u1 = new OfficeUser() { Birthday = DateTime.Today, EmployeeNumber = "12046", Gender = Gender.Male, Name = "Devin" };
             t1 = new Teacher() { Birthday = Convert.ToDateTime("1984-1-1"), EmployeeNumber = "12334", Gender = Gender.Female, Major = "Math", Name = "StevenMath" };
            Session.SaveOrUpdate(u1);
            Session.SaveOrUpdate(t1);
            Student s1 = new Student() { Birthday = Convert.ToDateTime("1983-12-20"), Gender = Gender.Male, Name = "Jack" };
            Session.SaveOrUpdate(s1);
            Lab l1 = new Lab() { Address = "Teaching Tower 1", Description = "For chemistry", Size = 70, LabSubject = "Primary Chemistry" };
            Classroom cr1 = new Classroom() { Address = "Teaching Building 2", Description = "Common Room", RoomNumber = "402", Size = 150 };
            Session.SaveOrUpdate(l1);
            Session.SaveOrUpdate(cr1);
            Session.Flush();

            Education e1=new Education(){Employee = t1,GraduateYear = 2003,University = "UESTC"};
            Education e11 = new Education() { Employee = t1, GraduateYear = 2007, University = "BJU" };
            Education e2 = new Education() { Employee = u1, GraduateYear = 2001, University = "USTC" };
            t1.Educations.Add(e1);
            t1.Educations.Add(e11);
            u1.Educations.Add(e2);
            DoorKey doorKey = new DoorKey() { Name = "401 Key" };
            doorKey.Employees = new List<Employee>();
            doorKey.Employees.Add(u1);
            doorKey.Employees.Add(t1);
            Session.SaveOrUpdate(doorKey);
            Session.Flush();
        }
开发者ID:akhuang,项目名称:NHibernateTest,代码行数:27,代码来源:QueryTest.cs

示例9: AddTeacher

 public ActionResult AddTeacher(Teacher model)
 {
     IRepositories repositories = new RepositoryFactory();
     repositories.TeacherRepository.Insert(Convert(model));
     repositories.Commit();
     return RedirectToAction("Index");
 }
开发者ID:nau-project,项目名称:nau-main,代码行数:7,代码来源:DepartmentAdminController.cs

示例10: GetInformation

 static void GetInformation(out Teacher st)
 {
     DateTimeFormatInfo dtfi = CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat;
     dtfi.DateSeparator = "/";
     dtfi.ShortDatePattern = @"dd/MM/yyyy";
     Console.WriteLine("Enter the teacher's first name: ");
     st.firstName = Console.ReadLine();
     Console.WriteLine("Enter the teacher's last name");
     st.lastName = Console.ReadLine();
     Label: Console.WriteLine("Enter the teacher's date of birth in the {0} format", dtfi.ShortDatePattern);
     try
     {
         st.birthDate = DateTime.Parse(Console.ReadLine(), dtfi);
     }
     catch (FormatException e)
     {
         Console.WriteLine("Invalid date, enter valid format please");
         goto Label;
     }
     Console.WriteLine("Enter the teacher's address line 1 ");
     st.addressLine1 = Console.ReadLine();
     Console.WriteLine("Enter the teacher's address line 2 ");
     st.addressLine2 = Console.ReadLine();
     Console.WriteLine("Enter the teacher's city ");
     st.city = Console.ReadLine();
     Console.WriteLine("Enter the teacher's state/province ");
     st.stateProvince = Console.ReadLine();
     Console.WriteLine("Enter the teacher's zip/Postal code ");
     st.zipPostal = Console.ReadLine();
     Console.WriteLine("Enter the teachr's country");
     st.country = Console.ReadLine();
 }
开发者ID:sophie-greene,项目名称:Csharp,代码行数:32,代码来源:Program.cs

示例11: WorkForm

 public WorkForm(Teacher teacher, FormLogin parentForm, StudentServiceClient proxy)
 {
     InitializeComponent();
     _teacher = teacher;
     _parrentForm = parentForm;
     _proxy = proxy;
 } 
开发者ID:JohnKarnel,项目名称:StudentProgress,代码行数:7,代码来源:WorkForm.cs

示例12: getTeacherList

 public object[] getTeacherList(Teacher teacher, int rows, int page)
 {
     object[] result = new object[2];
     ISession session = getSession();
     ICriteria c = session.CreateCriteria(typeof(Teacher));
     if (!string.IsNullOrEmpty(teacher.Name))
     {
         c.Add(Restrictions.Like("Name", teacher.Name, MatchMode.Anywhere));
     }
     if (!string.IsNullOrEmpty(teacher.Sex))
     {
         c.Add(Restrictions.Eq("Sex", teacher.Sex));
     }
     if (!string.IsNullOrEmpty(teacher.Sn))
     {
         c.Add(Restrictions.Eq("Sn", teacher.Sn));
     }
     if (!string.IsNullOrEmpty(teacher.IDcode))
     {
         c.Add(Restrictions.Like("IDcode", teacher.IDcode, MatchMode.Anywhere));
     }
     ICriteria c2 = (ICriteria)c.Clone();
     result[0] = getCount(c2);
     page = page > 0 ? page : 1;
     c.SetFirstResult((page - 1) * rows);
     c.SetMaxResults(rows);
     result[1] = c.List<Teacher>();
     return result;
 }
开发者ID:panmingzhi815,项目名称:SchoolManagementSystem,代码行数:29,代码来源:TeacherService.cs

示例13: Class

 //Constructors
 /// <summary>
 /// Create new class
 /// </summary>
 /// <param name="students">Array of students</param>
 /// <param name="teachers">Array of teachers</param>
 /// <param name="id">Class id</param>
 public Class(Student[] students, Teacher[] teachers, string id)
 {
     this.students = new List<Student>(students);
     this.teachers = new List<Teacher>(teachers);
     this.id = id;
     this.comments = new List<string>();
 }
开发者ID:andon-andonov,项目名称:TelerikAcademy,代码行数:14,代码来源:Class.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
               /*
                if (Session["Photo"] != null && Session["PhotoType"] != null)
                {
                    img1.ImageUrl = "~/TeacherPhotoShow.aspx";
                }
                else
                {
                    img1.ImageUrl = "~/Content/default.jpg";
                }*/
                int id = Convert.ToInt32( Request.QueryString.Get("ID"));
                if (id != 0)
                {
                    CQGJEntities CQGJ = new CQGJEntities();
                    Session["TeacherID"] = id;
                    this.teacher = (from t in CQGJ.Teacher
                                    where t.TeacherID == id
                                    select t).First();
                    if (this.teacher.Photo != null || this.teacher.PhotoType != null)
                    {
                        img1.ImageUrl = "~/TeacherPhotoShow.aspx?ID=" + id;

                    }
                    else
                    {
                        img1.ImageUrl = "~/Content/images/user-head.jpg";
                    }
                }
            }
        }
开发者ID:dalinhuang,项目名称:cqgj,代码行数:33,代码来源:TeacherPhotoAdd.aspx.cs

示例15: Main

    static void Main()
    {
        SchoolClass PHPClass = new SchoolClass();

        Teacher firstTeacher = new Teacher("Ivan Vankov");
        PHPClass.AddTeacher(firstTeacher);

        Teacher secondTeacher = new Teacher("Stamat Trendafilov");
        PHPClass.AddTeacher(secondTeacher);

        Student newStudent = new Student("Dobromir Ivanov", "756A");
        PHPClass.AddStudent(newStudent);

        Console.WriteLine("List of all teachers: ");
        foreach (Human teacher in PHPClass.ClassTeachersList)
        {
            Console.WriteLine(teacher);
        }

        Console.WriteLine("\nList of all Students: ");
        foreach (Human student in PHPClass.ClassStudentsList)
        {
            Console.WriteLine(student);
        }
    }
开发者ID:nzhul,项目名称:TelerikAcademy,代码行数:25,代码来源:TEST.cs


注:本文中的Teacher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。