Example #1
0
        public async void OnEditButtonCommand()
        {
            if (_taskStartingDate.Day > _taskFinishingDate.Day)
            {
                await _pageDialog.DisplayAlertAsync("Серьезно?", "Ты что, для выполнения вернулся в прошлое?", "Да ладно?");
            }
            else
            {
                _rootTableModel.Title           = TaskTitle;
                _rootTableModel.Description     = TaskDescription;
                _rootTableModel.DateOfCreating  = TaskStartingDate;
                _rootTableModel.DateOfFinishing = TaskFinishingDate;
                _rootTableModel.Mark            = TaskMark;
                _rootTableModel.IsDone          = true;
                await _taskModelTable.SaveItemAsync(_rootTableModel);

                await NavigationService.GoBackAsync();
            }
        }
Example #2
0
        public async void OnAddTaskButtonCommand()
        {
            if (_taskTitle == null || _taskDescription == null)
            {
                await _pageDialog.DisplayAlertAsync("Enter More Information", "Not all fields are filled.", "Ok");
            }
            else
            {
                await _taskModelTable.SaveItemAsync(
                    new TaskModel
                {
                    Title          = _taskTitle,
                    Description    = _taskDescription,
                    DateOfCreating = DateTime.Now,
                    IsDone         = false
                });

                await NavigationService.GoBackAsync();
            }
        }