public async Task <IActionResult> Edit(int id, [Bind("Id,OptionalText,ShopId,StartTime,EndTime,StaffId")] AppointmentEntryViewModel app) { //if (id != tableAppointment.Id) //{ // return NotFound(); //} int userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); var tbUser = await _context.TblUsers.AsNoTracking().FirstOrDefaultAsync(a => a.Id == userId); RestAccess ra = new RestAccess(tbUser.Id.ToString(), tbUser.RestPasswort, Constants.ServiceClientEndPointWithApiPrefix); var response = await ra.SetMeetingWeb(new ExSaveMeetingRequest { OptionalText = app.OptionalText, LocationId = app.ShopId, StartTime = app.StartTime.ToUniversalTime(), StaffId = app.StaffId, UserId = userId, CheckPassword = WebAppSettings.CheckPassword, }); if (response.Ok && response.Result != null) { if (response.Result.Result == EnumSaveDataResult.Error) { ViewData["message"] = response.Result.Description; return(View(app)); } TempData["message"] = "Dein Termin wurde erfolgreich bestätigt."; return(RedirectToAction("Index", "MyAppointments")); } ViewData["message"] = "Es konnte keine Verbindung zum Server hergestellt werden."; return(View(app)); }