/// <summary> /// 保存AttendanceRecord /// </summary> /// <returns></returns> public JsonResult SaveAttendanceRecord() { AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载 ajax.status = EnumAjaxStatus.Error; //默认失败 ajax.msg = "保存失败!"; //前台获取,用于显示提示信息 var data = Request["data"]; //获取前台传递的数据,主要序列化 if (string.IsNullOrEmpty(data)) { return(Json(ajax)); } AttendanceRecord att = (AttendanceRecord)(JsonConvert.DeserializeObject(data.ToString(), typeof(AttendanceRecord))); string[] ClassID = att.ClassID.Split(','); att.ClassID = ClassID[0].ToString(); att.ClassIndex = int.Parse(ClassID[1]); att.UpdateTime = DateTime.Now; att.UpdatorId = UserSession.userid; if (StudentScheduleListData.UpdateAttendanceRecord(att)) { ajax.msg = "保存成功!"; ajax.status = EnumAjaxStatus.Success; } return(Json(ajax)); }
/// <summary> /// 获取课程相同的班级,用于调班 /// </summary> /// <returns></returns> public JsonResult GetClassesItems() { int CourseID1 = int.Parse(Request["CourseID"]); //预约单 string ClassID = Request["ClassID"].ToString(); //班级ID //根据课程ID获取值 List <CommonEntity> ClassesList = StudentScheduleListData.GetClassesList(CourseID1, ClassID); return(Json(ClassesList)); }
//public ActionResult FSConnectionInfo() //{ // return View(); //} /// <summary> /// 查询FSConnectionInfo页面详细记录 /// </summary> /// <returns></returns> public ActionResult FSConnectionInfo(int ID) { WX_FSConnectionlistModel model = new WX_FSConnectionlistModel(); vw_AttendanceRecord vw_AttendanceRecord = StudentScheduleListData.Getvw_AttendanceRecordByID(ID);//查询学员课程表 model.FSConnectionInfo = vw_AttendanceRecord; model.Enclosure = AttendaceData.ClassListJob(vw_AttendanceRecord.ClassID, vw_AttendanceRecord.ClassIndex);//业务层获取底层方法,返回数据 return(View(model)); }
// // GET: /Curriculum/ public ActionResult StudentScheduleList(StudentScheduleSearchModel search) { StudentScheduleListViewModel model = new StudentScheduleListViewModel(); //页面模型 model.search = search; //页面的搜索模型 model.search.PageSize = 15; //每页显示 model.search.CurrentPage = Convert.ToInt32(Request["pageindex"]) <= 0 ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页 //分校下拉项 List <CommonEntity> ComCodeIL = CommonData.Get_SYS_Company_COMP_Code(UserSession.comcode);//分校 model.search.ComCodeIL = CommonData.Instance.GetBropDownListData_Choice(ComCodeIL); if (UserSession.comcode != null && UserSession.comcode != "1") { search.ComCode = UserSession.comcode;//默认查询当前分校的人员 } model.AttendanceRecordlist = StudentScheduleListData.GetAttendanceRecordList(search); //填充页面模型数据 return(View(model)); //返回页面模型 }
/// <summary> /// 查询上课记录 /// </summary> /// <returns></returns> public ActionResult FSConnectionlist(StudentScheduleSearchModel search) { WX_FSConnectionlistModel model = new WX_FSConnectionlistModel(); model.search = search; model.search.PageSize = 15; //每页显示15条数据 model.search.CurrentPage = model.search.CurrentPage <= 0 ? 1 : model.search.CurrentPage; //获取当前页 Students s = StudentData.GetStudentByAccountID(UserSessionWX.userid); //获取学员 DateTime dt = DateTime.Now; //当前时间 //本周,以星期天为第一天 //DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 //DateTime endWeek = startWeek.AddDays(6); //本周周日 int weeknow = Convert.ToInt32(dt.DayOfWeek); //因为是以星期一为第一天,所以要判断weeknow等于0时,要向前推6天。 weeknow = (weeknow == 0 ? (7 - 1) : (weeknow - 1)); int daydiff = (-1) * weeknow; //本周第一天 DateTime startWeek = dt.AddDays(daydiff); //星期天为最后一天 int weeknow1 = Convert.ToInt32(dt.DayOfWeek); weeknow1 = (weeknow1 == 0 ? 7 : weeknow1); int daydiff1 = (7 - weeknow1); //本周最后一天 DateTime endWeek = dt.AddDays(daydiff1); if (search.timeStart == null) { string timeStart = startWeek.ToString("yyyy-MM-dd"); search.timeStart = timeStart += " 00:00:00:000"; string timeEnd = endWeek.ToString("yyyy-MM-dd"); search.timeEnd = timeEnd += " 23:59:59.999"; } else { //上课时间-开始时间 search.timeStart = search.timeStart += " 00:00:00:000";//对日期做特殊处理,取第一个星期的最小值 // 上课时间-结束时间 search.timeEnd = search.timeEnd += " 23:59:59.999";//对日期做特殊处理,取最后一个星期的最大值 } if (s != null) { search.AttendanceRecord_StudentID = s.ID;//获取学号 } PagedList <vw_AttendanceRecord> vw_AttendanceRecord = StudentScheduleListData.GetAttendanceRecordList(search);//查询学员课程表 model.FSConnectionlist = vw_AttendanceRecord; return(View(model)); }