public ActionResult Edit([Bind(Include = "ID,DeptName")] Department department) { if (ModelState.IsValid) { db.Entry(department).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(department)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Year,Version,GrossIncomeBase,GrossIncomeTop,TaxRate1,CreationDateTime,TaxBase")] TaxRate taxRate) { if (ModelState.IsValid) { db.Entry(taxRate).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(taxRate)); }
public ActionResult Edit([Bind(Include = "ID,EmpID,Regular_Hours,Overtime_Hours,Holiday,PTO,Vacation,DateTime")] Hour hour) { if (ModelState.IsValid) { db.Entry(hour).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpID = new SelectList(db.Employees, "ID", "FirstName", hour.EmpID); return(View(hour)); }
public ActionResult Edit([Bind(Include = "ID,DeptID,FirstName,LastName,Birthday,SSN,HireDate,Address,Phone")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DeptID = new SelectList(db.Departments, "ID", "DeptName", employee.DeptID); return(View(employee)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,LastName,StartDate,CreationDateTime")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(employee)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,EmployeeId,AnnualSalary,StartDate,CreationDateTime,SuperRate")] EmployeeIncome employeeIncome) { if (ModelState.IsValid) { db.Entry(employeeIncome).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "Name", employeeIncome.EmployeeId); return(View(employeeIncome)); }