Exemplo n.º 1
0
        public ActionResult Delete(DemotblEmployee emp)
        {
            demodbEntities con = new demodbEntities();

            con.Entry(emp).State = System.Data.Entity.EntityState.Deleted;
            con.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult Edit(DemotblEmployee demoemp)
        {
            demodbEntities con = new demodbEntities();

            //DemotblEmployee emp = con.DemotblEmployees.FirstOrDefault(x => x.Id.Equals(demoemp.Id));
            //emp.FullName = demoemp.FullName;
            //emp.Gender = demoemp.Gender;
            //emp.Age = demoemp.Age;
            //emp.EmailAddress = demoemp.EmailAddress;
            //emp.HireDate = demoemp.HireDate;
            //emp.Salary = demoemp.Salary;
            //emp.PersonalWebSite = demoemp.PersonalWebSite;
            con.Entry(demoemp).State = System.Data.Entity.EntityState.Modified;
            con.SaveChanges();
            return(RedirectToAction("Index"));
        }