Example #1
0
 public string DeleteTitle(int id)
 {
     CourseGroupTitle Cgt = new CourseGroupTitle() { Id = id };
     ModelHelpers Mhelp = new ModelHelpers();
     Mhelp.Del<CourseGroupTitle>(Cgt);
     List<CourseGroupTitle> listCgt = db.CourseGroupTitle.OrderBy(g => g.CreatTime).ToList();
     ViewBag.listCgt = listCgt;
     JavaScriptSerializer jss = new JavaScriptSerializer();
     string jsonStr = jss.Serialize(listCgt);
     return jsonStr;
 }
 public ActionResult AddGroup(FormCollection form)
 {
     StudentInfo sInfo = db.StudentInfo.Where(s => s.Id == studentId).FirstOrDefault();
     CourseGroupTitle Cgt = new CourseGroupTitle();
     Cgt.CourseGroupCreatId = sInfo.Id;
     Cgt.CourseGroupCreatAcount = sInfo.Account;
     Cgt.CourseGroupCreatName = form["Title"];
     Cgt.Content = form["Content"];
     Cgt.CourseId = Convert.ToInt32(form["teacher"]);
     Cgt.CreatTime = DateTime.Now.ToLongDateString() + DateTime.Now.ToShortTimeString();
     mHelp.Add<CourseGroupTitle>(Cgt);
     return RedirectToAction("GroupIndex");
 }