Пример #1
0
        private ActionResult DeletePerson(Person person)
        {
            //Please replace to your business logic code
            var deletepersonentity = db.Persons.Single(p => p.ID == person.ID);
            db.Persons.Remove(deletepersonentity);

            db.SaveChanges();

            return Content("Delete success");
        }
Пример #2
0
        private ActionResult AddPerson(Person person)
        {
            //Please replace to your business logic code
            var newpersonentity = new Person();
            newpersonentity.FirstName = person.FirstName;
            newpersonentity.LastName = person.LastName;
            newpersonentity.City = person.City;
            newpersonentity.Zip = person.Zip;

            db.Persons.Add(newpersonentity);
            db.SaveChanges();

            return Content("Add success");
        }
Пример #3
0
        private ActionResult EditPerson(Person person)
        {
            //Please replace to your business logic code
            var editpersonentity = db.Persons.Single(p => p.ID == person.ID);
            editpersonentity.FirstName = person.FirstName;
            editpersonentity.LastName = person.LastName;
            editpersonentity.City = person.City;
            editpersonentity.Zip = person.Zip;

            db.SaveChanges();

            return Content("Update success");

        }
Пример #4
0
 public ActionResult UpdateForJqGrid(Person person, string oper)
 {
     return JqGrid.UpdateForJqGrid(person, oper, AddPerson, EditPerson, DeletePerson);
 }