Exemplo n.º 1
0
 /// <summary>
 /// Creates a view-model for the given enrollment
 /// </summary>
 /// <param name="enrollment">Model containing the details for the view-model</param>
 public EnrollmentViewModel(Enrollment enrollment)
 {
     if(enrollment != null)
     {
         Id = enrollment.Id;
         Pending = enrollment.Pending;
         Class = new ClassViewModel(enrollment.Class);
         Student = new UserViewModel(enrollment.Student);
         Grade = -1;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a ClassViewModel for the given class
 /// </summary>
 /// <param name="class">Class to create view-model for</param>
 public ClassViewModel(Class @class)
 {
     if(@class != null)
     {
         Id = @class.Id;
         Title = @class.Title;
         Prefix = @class.Prefix;
         CourseNumber = @class.CourseNumber;
         Section = @class.Section;
         GradeDistribution = @class.GradeDistribution;
         Teacher = new UserViewModel(@class.Teacher);
     }
 }