コード例 #1
0
ファイル: DetailViewModel.cs プロジェクト: MARS22101996/Droid
        private void Save()
        {
            SetType();

            ResetDates();

            if (_id == Guid.Empty)
            {
                _vacationService.CreateVacationAsync(Vacation);
            }
            else
            {
                _vacationService.UpdateVacationAsync(Vacation);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: MARS22101996/Droid
        private static void StoresVacationInTheDbAndUploadstoTheServer()
        {
            var id = Guid.NewGuid();

            var newVacation = GenerateNewVacation(id);

            _serviceSql.CreateVacation(newVacation);

            _serviceApi.CreateVacationAsync(newVacation);

            _vacations = _serviceApi.GetVacationAsync().Result;

            ShowVacationsDto(_vacations, "List of vacations requests from the server after adding the new vacation.");

            _vacations = _serviceSql.GetVacation().ToList();

            ShowVacationsDto(_vacations, "List of vacations from the db after after adding the new vacation.");
        }