public ActionResult Create() { Class_SocialPractice practice = new Class_SocialPractice(); practice.ID = Guid.NewGuid(); ViewBag.Classes = StudentAffarisHelper.GetTeacherChargeClass(userid) .Select(p => new SelectListItem() { Text = p.Value, Value = p.Key.ToString() }) .ToList(); return(View(practice)); }
public JsonResult CreateSend(Class_SocialPractice model) { try { model.DateTime = model.DateTime.Replace("-", ""); model.Creator = userName; model.CreateTime = DateTime.Now.ToString("yyyyMMddHHmmss"); model.LogID = userid; model.TermID = StudentAffarisHelper.GetSchoolCurrentTerm(xxid); var flag = StudentAffarisHelper.AddOrUpdateClassSocialPractice(model); return(Json(new { flag }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { flag = false, message = e.Message }, JsonRequestBehavior.AllowGet)); } }