本文整理汇总了C#中Instructor类的典型用法代码示例。如果您正苦于以下问题:C# Instructor类的具体用法?C# Instructor怎么用?C# Instructor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Instructor类属于命名空间,在下文中一共展示了Instructor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InstructorAssignment
public InstructorAssignment(Instructor teacher, SubjectDelivery subject)
{
Instructor = teacher as Teacher;
Subject = subject;
Role = InstructorAssignmentRole.All;
}
示例2: Main
static void Main(string[] args)
{
Instructor John = new Instructor("John", "Smith", "English");
John.PrintInfo();
Instructor Mike = new Instructor("Mike", "Jones", "Math");
Mike.PrintInfo();
Student Jane = new Student("Jane", "Adams", John, 0);
Student Joe = new Student("Joe", "Jenkins", John, 0);
Student Melissa = new Student("Melissa", "King", Mike, 0);
Student Matt = new Student("Matt", "Sanchez", Mike, 0);
John.SetStudentGrade(Jane, 95);
John.SetStudentGrade(Joe, 85);
Mike.SetStudentGrade(Melissa, 90);
Mike.SetStudentGrade(Matt, 92);
Jane.PrintNameTeacherCourse();
Joe.PrintNameTeacherCourse();
Melissa.PrintNameTeacherCourse();
Matt.PrintNameTeacherCourse();
System.Console.ReadKey();
}
示例3: Main
static void Main(string[] args)
{
var john = new Instructor("John", "English");
var mike = new Instructor("Mike", "Math");
var jane = new Student("Jane", john);
var joe = new Student("Joe", john);
var melissa = new Student("Melissa", mike);
var matt = new Student("Matt", mike);
john.SetStudentGrade(jane, 95);
john.SetStudentGrade(joe, 85);
mike.SetStudentGrade(melissa, 90);
mike.SetStudentGrade(matt, 92);
Show.Divider();
Show.Header();
jane.PrintStudentInfo();
joe.PrintStudentInfo();
melissa.PrintStudentInfo();
matt.PrintStudentInfo();
Show.Divider();
Show.ProgEnd();
}
示例4: Main
static void Main(string[] args)
{
//Create Instructor
Instructor John = new Instructor("John", "English");
Instructor Mike = new Instructor("Mike", "Math");
//Create Students
Student Jane = new Student("Jane", John);
Student Joe = new Student("Joe", John);
Student Melissa = new Student("Melissa", Mike);
Student Matt = new Student("Matt", Mike);
//Instructor Set Student Grade
John.StudentGrade(Jane, 95);
John.StudentGrade(Joe, 85);
Mike.StudentGrade(Melissa, 90);
Mike.StudentGrade(Matt, 92);
//Print Instructor Information
John.PrintInstructorInfo();
Mike.PrintInstructorInfo();
//Print Student Information
Jane.PrintStudentInfo();
Joe.PrintStudentInfo();
Melissa.PrintStudentInfo();
Matt.PrintStudentInfo();
System.Console.ReadKey();
}
示例5: RegisterButton_Click
private void RegisterButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (PasswordBox.Password != PasswordRepeatBox.Password)
throw new Exception("Паролі не співпадають");
Instructor instructor = new Instructor(LoginBox.Text, PasswordBox.Password, FirstNameBox.Text, LastNameBox.Text,
SecondNameBox.Text);
Configuration config = (App.Current as App).config;
using (TcpClient eClient = new TcpClient(config.IP.ToString(), config.Port))
{
using (NetworkStream writerStream = eClient.GetStream())
{
MSG message = new MSG();
message.stat = STATUS.ADD_INSTRUCTOR;
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(writerStream, message);
formatter.Serialize(writerStream, instructor);
bool fl = (bool)formatter.Deserialize(writerStream);
if (!fl)
MessageBox.Show("Помилка додавання облікового запису");
else
{
NavigationService nav = NavigationService.GetNavigationService(this);
nav.Navigate(new System.Uri("StartPage.xaml", UriKind.RelativeOrAbsolute));
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例6: Main
static void Main(string[] args)
{
Instructor John = new Instructor("John", "English");
Instructor Mike = new Instructor("MIKE", "Math");
Student Jane = new Student("Jane", John);
Student Joe = new Student("Joe", John);
Student Melissa = new Student("Melissa", Mike);
Student Matt = new Student("Matt", Mike);
John.SetStudentGrade(Jane, 95);
John.SetStudentGrade(Joe, 85);
Mike.SetStudentGrade(Melissa, 90);
Mike.SetStudentGrade(Matt, 92);
Jane.PrintStudentInfo();
Joe.PrintStudentInfo();
Melissa.PrintStudentInfo();
Matt.PrintStudentInfo();
System.Console.WriteLine();
System.Console.ReadKey();
}
示例7: Main
static void Main(string[] args)
{
// INSTUCTOR CREATION //
Instructor john = new Instructor("John", "English");
Instructor mike = new Instructor("Mike", "Math");
// STUDENT CREATION //
Student jane = new Student("Jane", john);
Student joe = new Student("Joe", john);
Student melissa = new Student("Melissa", mike);
Student matt = new Student("Matt", mike);
// GRADE ASSIGNMENT //
john.SetGrade(jane, 95);
john.SetGrade(joe, 85);
mike.SetGrade(melissa, 90);
mike.SetGrade(matt, 92);
jane.Print();
joe.Print();
melissa.Print();
matt.Print();
System.Console.Read();
}
示例8: Create
// GET: Instructor/Create
public ActionResult Create()
{
var instructor = new Instructor();
instructor.Courses = new List<Course>();
PopulateAssignedCourseData(instructor);
return View();
}
示例9: Main
static void Main(string[] args)
{
Instructor EnglishInstructor = new Instructor("John", "English");
Instructor MathInstructor = new Instructor("Mike", "Math");
Student Student1 = new Student("Jane", EnglishInstructor);
Student Student2 = new Student("Joe", EnglishInstructor);
Student Student3 = new Student("Melissa", MathInstructor);
Student Student4 = new Student("Matt", MathInstructor);
EnglishInstructor.SetStudentGrade(Student1, 95);
EnglishInstructor.SetStudentGrade(Student2, 85);
MathInstructor.SetStudentGrade(Student3, 90);
MathInstructor.SetStudentGrade(Student4, 92);
System.Console.WriteLine(" Student Information ");
System.Console.WriteLine(" ");
Student1.Print();
Student2.Print();
Student3.Print();
Student4.Print();
System.Console.ReadKey();
}
示例10: Main
static void Main(string[] args)
{
Instructor johnh = new Instructor("johnh", "english");
Instructor mike = new Instructor("Mike", "Math");
Student jane = new Student("Jane", johnh,0);
Student joe = new Student("Joe", johnh,0);
Student melissa = new Student("Melisa", mike,0);
Student matt = new Student("Matt", mike,0);
/////////////////////////////////////////////////////////
johnh.SetStudetGrade(jane, 95);
johnh.SetStudetGrade(joe, 85);
mike.SetStudetGrade(melissa, 90);
mike.SetStudetGrade(matt, 92);
/////////////////////////////////////////////////////////
melissa.PrintNameGradeTeacher();
jane.PrintNameGradeTeacher();
joe.PrintNameGradeTeacher();
matt.PrintNameGradeTeacher();
//////////////////////////////////////////////////
//johnh.PrintTeacherInformation();
//mike.PrintTeacherInformation();
System.Console.WriteLine("press any key to end.. ");
System.Console.ReadKey();
}
示例11: WarriorTrainer
/// <summary>
/// Prevents a default instance of the <see cref="WarriorTrainer" /> class from being created.
/// </summary>
/// <param name="i2">The i2.</param>
private WarriorTrainer(Instructor i2)
{
i = i2;
a = 1;
d = 1;
h = 1;
}
示例12: Student
public Student(string studentFirstName, string studentLastName, Instructor Teacher, int Grade)
{
this.FirstName = studentFirstName;
this.LastName = studentLastName;
this.fullname = this.FirstName + " " + this.LastName;
this.Teacher = Teacher;
this.Grade = Grade;
}
示例13: Awake
void Awake()
{
effects = GameObject.FindObjectOfType<EffectPlayer>();
pieces = GameObject.FindObjectsOfType<MoveForward>().ToList();
player = GameObject.FindObjectOfType<Player>();
music = GetComponent<MusicManager>();
score = GetComponent<ScoreManager>();
instructor = GameObject.FindObjectOfType<Instructor>();
obstacles = GameObject.Find("Obstacle");
}
示例14: UpdateInstructor
public void UpdateInstructor(Instructor instructor)
{
//try
//{
context.Entry(instructor).State = EntityState.Modified;
//}
//catch
//{
// throw;
//}
}
示例15: Create
public ActionResult Create(Instructor instructor)
{
if (RepositoryFactory.InstructorRepository.Queryable.Any(i => i.Identifier == instructor.Identifier))
{
Message =
string.Format(
"Instructor could not be created because an instructor with the identifier {0} already exists",
instructor.Identifier);
return RedirectToAction("Index");
}
var instructorToCreate = new Instructor();
TransferValues(instructor, instructorToCreate);
if (ModelState.IsValid)
{
//if the instructor doesn't exist as a user account, create them an account and profile
var existingUser =
RepositoryFactory.UserRepository.Queryable.SingleOrDefault(
x => x.Identifier == instructorToCreate.Identifier);
if (existingUser == null)
{
var profile = new Profile
{
FirstName = instructorToCreate.FirstName,
LastName = instructorToCreate.LastName,
Email = instructorToCreate.Identifier,
ImageUrl = WebConfigurationManager.AppSettings["DefaultProfilePictureUrl"]
};
var user = new User {Identifier = instructorToCreate.Identifier};
user.AssociateProfile(profile);
user.Roles.Add(RepositoryFactory.RoleRepository.GetById(RoleNames.Instructor));
existingUser = user;
RepositoryFactory.UserRepository.EnsurePersistent(user);
}
instructorToCreate.User = existingUser;
RepositoryFactory.InstructorRepository.EnsurePersistent(instructorToCreate);
Message = "Instructor Created Successfully";
return RedirectToAction("Index");
}
else
{
var viewModel = InstructorViewModel.Create(Repository);
viewModel.Instructor = instructor;
return View(viewModel);
}
}