Ejemplo n.º 1
0
        public ModifyLecturerViewModel(Lecturer lecturer)
        {
            if (lecturer != null)
            {
                LecturerId   = lecturer.Id;
                Name         = lecturer.FirstName;
                Skill        = lecturer.Skill;
                Surname      = lecturer.LastName;
                Patronymic   = lecturer.MiddleName;
                UserName     = lecturer.User.UserName;
                Avatar       = lecturer.User.Avatar;
                SkypeContact = lecturer.User.SkypeContact;
                Phone        = lecturer.User.Phone;
                About        = lecturer.User.About;
                Email        = lecturer.User.Email;

                IsSecretary = lecturer.IsSecretary;
                IsLecturerHasGraduateStudents = lecturer.IsLecturerHasGraduateStudents;

                var groups = CorrelationService.GetCorrelation("Group", lecturer.Id);
                if (lecturer.SecretaryGroups != null)
                {
                    Groups = new MultiSelectList(groups, "Id", "Name", lecturer.SecretaryGroups.Select(x => x.Id).ToList());
                }
            }
        }
Ejemplo n.º 2
0
 public ModifyLecturerViewModel()
 {
     Groups = new MultiSelectList(new List <Correlation>(CorrelationService.GetCorrelation("Group", null)), "Id", "Name");
 }