public ActionResult TeacherBeginSetNewCourse_Post(TeacherBeginSetNewCourse_Post info) { NewCourse_table newC = NewCourseeFuction.AddNewCourse(info, SessionInfo_ID); if (new OperationNewCourseData().Add(newC) == 1) { return(Json(new { msg = "创建课程成功!!!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { IDCourse = 0 }, JsonRequestBehavior.AllowGet)); } }
public ActionResult TeacherBeginSetNewCourse_jsonSet_add(TeacherBeginSetNewCourse_Post setNewCourse_Post) { //转换开设课程信息 NewCourse_table newC = NewCourseeFuction.AddNewCourse(setNewCourse_Post, SessionInfo_ID); if (new OperationNewCourseData().Add(newC) == 1) { List <TeacherFinishedSetCourse_V> list = new OperationTeacherData().GetTeacherFinishedSetCourse_View(SessionInfo_ID, setNewCourse_Post.IDCourse); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(new { IDCourse = 0 }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 形参为NewCourse_table 对象 根据编号修改对象信息 /// </summary> /// <param name="obj"></param> public override int Modify(Object obj) { try { NewCourse_table stu = obj as NewCourse_table; var user = (from e in db.NewCourse_table where e.IDNewCourse == stu.IDNewCourse select e).FirstOrDefault(); user = stu; db.SaveChanges(); return(1); } catch (Exception e) { return(0); } }
/// <summary> /// 通过上传的信息设置新开的课程的信息 /// </summary> /// <param name="info">client端上传的信息</param> /// <param name="id">开课老师id</param> /// <returns></returns> public static NewCourse_table AddNewCourse(TeacherBeginSetNewCourse_Post info, int id) { NewCourse_table newCourse = new NewCourse_table(); //课程建立时间 newCourse.SetTimeNewCourse = DateTime.Now; //开始上课时间 newCourse.BeginTimeNewCourse = DateTime.Now; newCourse.IDCourse = info.IDCourse; newCourse.IDSchoolhour = info.IDSchoolhour; newCourse.IDClassroom = info.IDClassroom; newCourse.NatureNewCourse = info.NatureNewCourse; newCourse.StateNewCourse = info.StateNewCourse; newCourse.AccommodateNewCourse = info.AccommodateNewCourse; newCourse.IDTeacher = id; return(newCourse); }
public void TestData3() { LiveDorm_table li = new LiveDorm_table(); li.IDStudent = 2000001; li.IDDorm = 10000002; li.OtherLiveDorm = ""; db.LiveDorm_table.Add(li); NewCourse_table asda = new NewCourse_table(); asda.IDTeacher = 300001; asda.IDSchoolhour = 3; asda.IDCourse = 500002; asda.IDClassroom = 60002; asda.SetTimeNewCourse = DateTime.Now; asda.BeginTimeNewCourse = DateTime.Now; asda.NatureNewCourse = 1; db.NewCourse_table.Add(asda); db.SaveChanges(); }