public async Task <IActionResult> Edit(int id, [Bind("WWindowId,WeekendLocationId,SaturdayDate,SundayDate,SaturdayWeatherId,SundayWeatherId,WeekendAttitudeId,WantLodging,WeekendLodgingId,TravelRadiusId")] WWindow wWindow) { if (id != wWindow.WWindowId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wWindow); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WWindowExists(wWindow.WWindowId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["WeekendLocationId"] = new SelectList(_context.ViewerLocation, "ViewerLocationId", "ViewerLocationId", wWindow.WeekendLocationId); return(View(wWindow)); }
public async Task <IActionResult> Create([Bind("WWindowId,WeekendLocationId,SaturdayDate,SundayDate,SaturdayWeatherId,SundayWeatherId,WeekendAttitudeId,WantLodging,WeekendLodgingId,TravelRadiusId")] WWindow wWindow) { if (ModelState.IsValid) { var viewerLocation = _context.ViewerLocation.Where(a => a.ViewerLocationId == wWindow.WeekendLocationId).FirstOrDefault(); wWindow.ViewerLocation = viewerLocation; var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier); Viewer currentviewer = _context.Viewers.Where(v => v.IdentityUserId == userId).FirstOrDefault(); currentviewer.WWindow = wWindow; var viewerId = currentviewer.ViewerId; var testvariable = currentviewer.WWindow.ViewerLocation.ViewerLocationViewerId; _context.Add(wWindow); _context.Viewers.Update(currentviewer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["WeekendLocationId"] = new SelectList(_context.ViewerLocation, "ViewerLocationId", "ViewerLocationId", wWindow.WeekendLocationId); return(View(wWindow)); }
private void exitWeightBT_Click(object sender, RoutedEventArgs e) { WWindow.Hide(); }
void RefreshWebPage() { string url = "http://euronews.com/news/"; WWindow.Navigate(url); }