public async void AddStudentBehavior() { try { IsBusy = true; var sb = new StudentBehavior(); sb.CCode = Details.CCode; sb.CompID = this.Details.CompID; sb.Type = ""; sb.Description = ""; sb.TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); var btype = api.GetCurrentBehaviorType(); sb.VltnTypID = btype.VltnTypID; var result = await api.AddStudentBehavior(sb); this.BehaviorReason = btype.Description; var um = ""; } catch (Exception ex) { Nav.ShowAlert("Error", "Could not add behavior"); Nav.ExecuteNavigation("back"); } finally { IsBusy = false; } }
public Student(string idNumber, string firstName, string lastName, string password, Guid classId, string address, PermissionsLevel permissions = PermissionsLevel.Watch, StudentBehavior behavior = StudentBehavior.Good) : base(idNumber, firstName, lastName, password, address, permissions) { Lessons = new List <Lesson>(); ClassId = classId; Behavior = behavior; }
public async Task <string> AddStudentBehavior( StudentBehavior behavior) { var url = new Uri($"{serviceAddress}/AddStudentBehavior"); var json = WrapJsonWithRec(JsonConvert.SerializeObject(behavior)); var res = await this.PostAsString(url, json); return(res); }
public async Task <StudentBehavior> GetStudentBehaviorAsync(int studentUsi) { var incidents = await _studentRepository.GetStudentDisciplineIncidentsAsync(studentUsi, _customParametersProvider.GetParameters().descriptors.disciplineIncidentDescriptor, _dateProvider.Today()); var externalLink = _customParametersProvider.GetParameters().behavior.linkToSystemWithDetails; var behaviorLink = new LinkModel { Title = externalLink.title, LinkText = externalLink.linkText, Url = externalLink.url }; var model = new StudentBehavior { DateAsOf = DateTime.Now, YearToDateDisciplineIncidentCount = incidents.Count, Interpretation = InterpretIncidentCount(incidents.Count), DisciplineIncidents = incidents, ExternalLink = behaviorLink }; return(model); }
public Student(UserViewModel userViewModel) : base(userViewModel, PermissionsLevel.Watch) { Lessons = new List <Lesson>(); ClassId = userViewModel.ClassId; Behavior = StudentBehavior.Good; }