Ejemplo n.º 1
0
 public ActionResult Add(ChildrenStandardCourse model)
 {
     using (ClassScheduleDBEntities db = new ClassScheduleDBEntities())
     {
         ResponseMessage msg = new ResponseMessage();
         try
         {
             var entity = db.ChildrenStandardCourse.Add(model);
             db.SaveChanges();
             msg.Status = true;
         }
         catch (Exception e)
         {
             msg.Status = false;
         }
         return(Json(msg, JsonRequestBehavior.AllowGet));
     }
 }
Ejemplo n.º 2
0
 public ActionResult Update(ChildrenStandardCourse model)
 {
     using (ClassScheduleDBEntities db = new ClassScheduleDBEntities())
     {
         ResponseMessage msg = new ResponseMessage();
         try
         {
             db.ChildrenStandardCourse.Attach(model);
             db.Entry(model).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             msg.Status = true;
         }
         catch (Exception e)
         {
             msg.Status = false;
         }
         return(Json(msg, JsonRequestBehavior.AllowGet));
     }
 }