/// <summary> /// Deprecated Method for adding a new object to the tblEmployee EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotblEmployee(tblEmployee tblEmployee) { base.AddObject("tblEmployee", tblEmployee); }
public ActionResult Edit(tblEmployee emplo) { try { SampleContext db = new SampleContext(); if (ModelState.IsValid) { db.tblEmployee.Attach(emplo); db.ObjectStateManager.ChangeObjectState(emplo, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } else { return View(); } } catch { return View(); } }
/// <summary> /// Create a new tblEmployee object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static tblEmployee CreatetblEmployee(global::System.Int32 id) { tblEmployee tblEmployee = new tblEmployee(); tblEmployee.Id = id; return tblEmployee; }