public IHttpActionResult PutEmployee(int id, Employee employee) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employee.ID) { return(BadRequest()); } db.Entry(employee).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "ID,Name,JoiningDate,Age")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }
public ActionResult Edit([Bind(Include = "Id,Name,CreatedOn,Age")] Client client) { if (ModelState.IsValid) { db.Entry(client).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(client)); }
public ActionResult Edit([Bind(Include = "ID,nombre,FechaAlta,edad")] Clientes clientes) { if (ModelState.IsValid) { db.Entry(clientes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clientes)); }
public ActionResult Edit(int id, Employee emptable) { try { // db.Employee. // db.Employee.(emptable); // db.Entry(countryVatMapping).State = EntityState.Modified; db.Entry(emptable).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, EmployeeSalaryModel collection) { try { db.Entry(collection).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch { EmployeeSalary salarydata = db.EmployeeSalary.Where(m => m.Id == id).FirstOrDefault(); EmployeeSalaryModel EmployeeSalarydata = new EmployeeSalaryModel(); EmployeeSalarydata.Id = salarydata.Id; EmployeeSalarydata.EmpId = salarydata.EmpId; EmployeeSalarydata.Salary = salarydata.Salary; EmployeeSalarydata.EmployeeSelectList = employeeService.GetSelectListItems(); return(View(EmployeeSalarydata)); } }