Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
 }