コード例 #1
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2014.07.04
        /// 描述:学员课表
        /// </summary>
        /// <param name="branchId"></param>
        /// <returns></returns>
        public ActionResult ListLoadBack(int branchId)
        {
            var searchBookRecord = new SearchBookRecord();
            searchBookRecord.CurrDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd"));
            searchBookRecord.StartDate = Utility.DateTimeHelper.GetCurrWeekFirstDayByDateTime(searchBookRecord.CurrDate);
            searchBookRecord.ActiveDate = searchBookRecord.CurrDate.ToString("MM/dd");

            //获取学员的订课情况
            var model = StudyBLL.GetBookRecordList(branchId, null, searchBookRecord.CurrDate);
            searchBookRecord.StudentBookRecordList = model;

            searchBookRecord = SetSearchBookRecord(searchBookRecord);

            Session["SearchBookRecord"] = searchBookRecord;

            return PartialView("_List", searchBookRecord);
        }
コード例 #2
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2014.07.04
        /// 描述:组装学员课表
        /// </summary>
        /// <param name="searchBookRecord"></param>
        /// <returns></returns>
        public SearchBookRecord SetSearchBookRecord(SearchBookRecord searchBookRecord)
        {
            var bookRecordList = new BookRecordList();
            searchBookRecord.BookRecordList = new List<BookRecordList>();
            bookRecordList.CurrentTime = "上午";
            bookRecordList.OrderNum = 1;
            bookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => p.BeginTime.Hour >= 9 && p.BeginTime.Hour <= 12).ToList();
            bookRecordList.ListCount = bookRecordList.StudentBookRecordList.Count;
            searchBookRecord.BookRecordList.Add(bookRecordList);

            bookRecordList = new BookRecordList();
            bookRecordList.CurrentTime = "下午";
            bookRecordList.OrderNum = 2;
            bookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => p.BeginTime.Hour >= 13 && p.BeginTime.Hour <= 17).ToList();
            bookRecordList.ListCount = bookRecordList.StudentBookRecordList.Count;
            searchBookRecord.BookRecordList.Add(bookRecordList);

            bookRecordList = new BookRecordList();
            bookRecordList.CurrentTime = "晚上";
            bookRecordList.OrderNum = 3;
            bookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => p.BeginTime.Hour >= 18 && p.BeginTime.Hour <= 22).ToList();
            bookRecordList.ListCount = bookRecordList.StudentBookRecordList.Count;
            searchBookRecord.BookRecordList.Add(bookRecordList);

            var saBookRecordList = new BookRecordList();
            searchBookRecord.SABookRecordList = new List<BookRecordList>();
            saBookRecordList.CurrentTime = "上午";
            saBookRecordList.OrderNum = 1;
            saBookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => (p.CCId == LoginUserManager.CurrLoginUser.UserId || p.SAId == LoginUserManager.CurrLoginUser.UserId) && p.BeginTime.Hour >= 9 && p.BeginTime.Hour <= 12).ToList();
            saBookRecordList.ListCount = saBookRecordList.StudentBookRecordList.Count;
            searchBookRecord.SABookRecordList.Add(saBookRecordList);

            saBookRecordList = new BookRecordList();
            saBookRecordList.CurrentTime = "下午";
            saBookRecordList.OrderNum = 2;
            saBookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => (p.CCId == LoginUserManager.CurrLoginUser.UserId || p.SAId == LoginUserManager.CurrLoginUser.UserId) && p.BeginTime.Hour >= 13 && p.BeginTime.Hour <= 17).ToList();
            saBookRecordList.ListCount = saBookRecordList.StudentBookRecordList.Count;
            searchBookRecord.SABookRecordList.Add(saBookRecordList);

            saBookRecordList = new BookRecordList();
            saBookRecordList.CurrentTime = "晚上";
            saBookRecordList.OrderNum = 3;
            saBookRecordList.StudentBookRecordList = searchBookRecord.StudentBookRecordList.Where(p => (p.CCId == LoginUserManager.CurrLoginUser.UserId || p.SAId == LoginUserManager.CurrLoginUser.UserId) && p.BeginTime.Hour >= 18 && p.BeginTime.Hour <= 22).ToList();
            saBookRecordList.ListCount = saBookRecordList.StudentBookRecordList.Count;
            searchBookRecord.SABookRecordList.Add(saBookRecordList);

            return searchBookRecord;
        }