public async Task <IActionResult> PutProjectsEmployees(int id, ProjectsEmployees projectsEmployees) { if (id != projectsEmployees.IdTasksEmployees) { return(BadRequest()); } _context.Entry(projectsEmployees).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectsEmployeesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTasks(int id, Tasks tasks) { if (id != tasks.Idtask) { return(BadRequest()); } _context.Entry(tasks).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TasksExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEmployees(short id, Employees employees) { if (id != employees.IdEmployee) { return(BadRequest()); } _context.Entry(employees).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeesExists(id)) { return(NotFound()); } else { throw; } } var response = new { status = "Ok", name = "Все ок" }; return(Ok(response)); }
public async Task <IActionResult> Put(int id, [FromBody] emp emp) { if (id != emp.Id) { return(BadRequest()); } _context.Entry(emp).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,Name")] MApplication mApplication) { if (ModelState.IsValid) { db.Entry(mApplication).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mApplication)); }
public ActionResult Edit([Bind(Include = "Id,Username,FirstName,LastName,EMail")] MUser mUser) { if (ModelState.IsValid) { db.Entry(mUser).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mUser)); }
public ActionResult Edit([Bind(Include = "Id,StreetAddress,City,State,Zip")] MAddress mAddress) { if (ModelState.IsValid) { db.Entry(mAddress).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mAddress)); }