Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,FullName,Experiance,StartDate,Salary,VacationDays,CompanyId")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CompanyId = new SelectList(db.Companies, "Id", "Name", employee.CompanyId);
     return(View(employee));
 }
Ejemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "Id,Name")] Company company)
        {
            if (ModelState.IsValid)
            {
                db.Entry(company).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View(company));
        }