Ejemplo n.º 1
0
 public ActionResult Add(GrowthDiary model)
 {
     using (ClassScheduleDBEntities db = new ClassScheduleDBEntities())
     {
         ResponseMessage msg = new ResponseMessage();
         try
         {
             model.CreateTime = DateTime.Now.ToString(FormatDateTime.LongDateTimeStr);
             model.UpdateTime = model.CreateTime;
             var entity = db.GrowthDiary.Add(model);
             db.SaveChanges();
             msg.Status = true;
         }
         catch (Exception e)
         {
             msg.Status = false;
         }
         return(Json(msg, JsonRequestBehavior.AllowGet));
     }
 }