public void Update(Data.Entities.Student student, string profilePhotoUrl, int?sessionId, int dayFrom, int dayTo) { StudentUsi = student.StudentUSI; FirstName = student.FirstName; LastName = student.LastSurname; ProfilePhotoUrl = profilePhotoUrl; SessionId = sessionId; DayFrom = dayFrom; DayTo = dayTo; }
public static SetModel CreateNewWith(Data.Entities.Student student, string profilePhotoUrl, List <SessionListItemModel> sessions, SessionListItemModel session, List <Section.SectionListItemModel> currentlyEnrolledSections) { var setModel = new SetModel { StudentName = String.Join(" ", student.FirstName, student.LastSurname), StudentUsi = student.StudentUSI, ProfilePhotoUrl = profilePhotoUrl, Sessions = sessions, Session = session.SessionId, BeginDate = session.BeginDate, EndDate = session.EndDate, CurrentlyEnrolledSections = currentlyEnrolledSections }; return(setModel); }
public CSharpFunctionalExtensions.Result Handle(EditAddStudentCommand command) { var student = _context.Students.Find(command.Id); if (student == null) { student = new Data.Entities.Student(); _context.Students.Add(student); _context.SaveChanges(); } if (!string.IsNullOrWhiteSpace(command.StudentCardNumber)) { student.StudentCardNumber = command.StudentCardNumber; } if (command.Gender.HasValue) { student.Gender = command.Gender.Value; } if (!string.IsNullOrWhiteSpace(command.Email)) { student.Email = command.Email; } if (!string.IsNullOrWhiteSpace(command.Name)) { student.Name = command.Name; } if (command.SchoolClassId.HasValue) { student.SchoolClassId = command.SchoolClassId.Value; } if (command.ShouldResultsBeHidden.HasValue) { student.HiddenResults = command.ShouldResultsBeHidden.Value; } _context.Students.Update(student); _context.SaveChanges(); return(Result.Ok()); }
public string GetProfilePhotoUrlOrDefault(Data.Entities.Student student) { var profilePhotoUrl = _downloader.DownloadPath("student", student.StudentUSI + "/profilePhoto"); return(profilePhotoUrl.IsNullOrEmpty() ? DefaultProfilePhotoUrl : profilePhotoUrl); }
public StudentInviteCommand(string token, Data.Entities.Student student) { Token = token; Student = student; }
public UserRegisteredCommand(Data.Entities.Student student) { Student = student; }
public override void Map(Data.Entities.Student source, GradeModel target) { target.StudentFirstName = source.FirstName; target.StudentLastName = source.LastSurname; target.StudentUSI = source.StudentUSI; }