public async Task <IActionResult> Edit(int id, [Bind("PostId,BlogId,Content,Title")] Post post) { if (id != post.PostId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(post); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostExists(post.PostId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BlogId"] = new SelectList(_context.Blog, "BlogId", "Url", post.BlogId); return(View(post)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,Aqi,Idx,City,Longitude,Latitude,Co,H,No2,O3,P,Pm10,Pm25,So2,T,W,time,CreateAt,UploadAt")] MstDataRaw mstDataRaw) { if (id != mstDataRaw.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstDataRaw); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstDataRawExists(mstDataRaw.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mstDataRaw)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,period,higilevel,lowlevel,usercreate,CreateAt,UploadAt")] MstRsi mstRsi) { if (id != mstRsi.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstRsi); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstRsiExists(mstRsi.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mstRsi)); }
public async Task <IActionResult> Edit(int id, [Bind("BlogId,Url")] Blog blog) { if (id != blog.BlogId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BlogExists(blog.BlogId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(blog)); }