Example #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"));
        }
Example #2
0
        public ActionResult Create(DemotblEmployee emp)
        {
            demodbEntities con = new demodbEntities();

            con.DemotblEmployees.Add(emp);
            con.SaveChanges();
            return(RedirectToAction("Index", "Home"));
        }
Example #3
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"));
        }