public async Task <IActionResult> PutAgency(int id, Agency agency) { if (id != agency.id) { return(BadRequest()); } _context.Entry(agency).State = EntityState.Modified; try { await _context.SaveChangesAsync(); Notification.sendNotification("Agency Detail has Updated", "Agency ID: " + agency.id); return(CreatedAtAction("DeletData", new { id = agency.id }, agency)); } catch (DbUpdateConcurrencyException) { if (!AgencyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUser([FromRoute] int id, [FromBody] User user) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != user.Id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit(Applicant applicant) { if (ModelState.IsValid) { db.Entry(applicant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(applicant)); }
public ActionResult Edit(Technology technology) { if (ModelState.IsValid) { db.Entry(technology).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(technology)); }
public ActionResult Edit([Bind(Include = "Id,Title,Description,StartDate,EndDate,Photo,Status")] About about) { if (ModelState.IsValid) { db.Entry(about).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(about)); }
public ActionResult Edit([Bind(Include = "Id,Name,Photo,Ordering,Status")] Partner partner) { if (ModelState.IsValid) { db.Entry(partner).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(partner)); }
public ActionResult Edit([Bind(Include = "Id,ProjectName,SmallTitle,Photo,BigPhoto,Description,Date,Client,CategoryId,Status")] Portfolio portfolio) { if (ModelState.IsValid) { db.Entry(portfolio).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name", portfolio.CategoryId); return(View(portfolio)); }
public void Update(Advertising book) { db.Entry(book).State = EntityState.Modified; }
public void Update(Order order) { db.Entry(order).State = EntityState.Modified; }