Exemplo n.º 1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tblEmployee EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotblEmployee(tblEmployee tblEmployee)
 {
     base.AddObject("tblEmployee", tblEmployee);
 }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
 /// <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;
 }