public ActionResult Create(Record record) { if (ModelState.IsValid) { db.Records.Add(record); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.TimeSheet_Employee = new SelectList(db.Employees, "Id", "FirstName", record.Record_Employee); return View(record); }
public ActionResult Edit(Record record) { if (ModelState.IsValid) { db.Entry(record).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Record_Employee = new SelectList(db.Employees, "Id", "FirstName", record.Record_Employee); return View(record); }