Пример #1
0
        private async void AddAttendanceOnClick(object obj)
        {
            var dialogViewModel = new CreateOrEditAttendanceDialogViewModel();

            if (dialogViewModel.ShowDialog() == true)
            {
                var attendance = new Attendance(dialogViewModel.AttendanceName)
                {
                    Date      = dialogViewModel.Date,
                    StartTime = dialogViewModel.StartTime,
                    EndTime   = dialogViewModel.EndTime
                };

                await _registeredSubjectService.AddAttendanceToRegisteredSubjectAsync(SelectedRegisteredSubject, attendance);
            }
        }
Пример #2
0
        private async void EditAttendanceOnClick(object obj)
        {
            var attendance = SelectedAttendance;

            var dialogViewModel = new CreateOrEditAttendanceDialogViewModel(attendance.Name, attendance.Date, attendance.StartTime, attendance.EndTime);

            if (dialogViewModel.ShowDialog() == true)
            {
                attendance.Name      = dialogViewModel.AttendanceName;
                attendance.Date      = dialogViewModel.Date;
                attendance.StartTime = dialogViewModel.StartTime;
                attendance.EndTime   = dialogViewModel.EndTime;

                await _registeredSubjectService.UpdateAttendanceAsync(attendance);
            }

            SelectedAttendanceIndex = -1;
        }