コード例 #1
0
 public ActionResult Detail(int productLevelId)
 {
     var modelBookRecordList = Session["BookRecordList"] as List<Eme.Model.Eme.GetBookRecordDetailList_Result>;
     var modelBookRecordListByProductLevelId = (from a in modelBookRecordList where a.ProductLevelId == productLevelId select a).ToList();
     var modelStudentList = (from a in modelBookRecordListByProductLevelId select new { a.ProductLevelId, a.StudentId, a.UCName, a.UEName, a.IsFirst }).Distinct().ToList();
     var modelStudentListDetail = new List<StudentModel>();
     foreach (var item in modelStudentList)
     {
         var model = new StudentModel();
         model.StudentId = item.StudentId;
         model.ProductLevelId = item.ProductLevelId;
         model.EName = item.UEName;
         model.CName = item.UCName;
         model.IsFirst = item.IsFirst;
         model.StudentBookRecordDetailList = modelBookRecordList.Where(a => a.StudentId == item.StudentId
             && a.ProductLevelId == item.ProductLevelId).ToList();
         modelStudentListDetail.Add(model);
     }
     ViewData["ProductLeve"] = ProductBLL.GetProductLevelById(productLevelId);
     ViewData["TableId"] = productLevelId;
     return PartialView("_ModalListDetail", modelStudentListDetail);
 }
コード例 #2
0
        /// <summary>
        /// 作者:Primo 
        /// 时间:2014.04.29
        /// 描述:Vip模式窗体展示
        /// 
        /// 作者:Primo 
        /// 时间:2015.06.13
        /// 描述:改造,提高速度
        /// </summary>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public ActionResult BookRequirementVipModalContenList(int branchId, DateTime startTime, DateTime endTime, bool isVip)
        {
            #region 改造注释

            //        var model = Session["SearchStudentRequirementModelContent"] == null
            //? new SearchStudentRequirementModel() { }
            //: Session["SearchStudentRequirementModelContent"] as SearchStudentRequirementModel;

            //        var modelBackUp = new SearchStudentRequirementModel()
            //        {
            //            CurrDate = model.CurrDate,
            //            ProductLevel = model.ProductLevel,
            //            BranchId = model.BranchId,
            //            StudentRequirementList = model.StudentRequirementList
            //        };

            //        var dtSTime = Convert.ToDateTime(startTime);
            //        var dtETime = Convert.ToDateTime(endTime);
            //        var modelContent = model.StudentRequirementList.Where(p => p.BookStartTime >= dtSTime && p.BookStartTime < dtETime && p.Status == CommonHelper.To<int>(StatusType.Active)).ToList();
            //        //Vip学员
            //        modelContent = modelContent.Where(a =>
            //            a.Student.Contract.Any(b =>
            //                b.ContractDetail.Any(c =>
            //                    c.ContractLevel.Any(d => d.IsCurrent
            //                        && d.Status == ConvertEnum.StatusTypeForActive
            //                        && c.Product.ProductLevel.Any(e => e.Id == d.ProductLevelId))
            //                        && c.Product.IsVip))).ToList();

            //        model.StudentRequirementList = modelContent;
            //        Session["SearchStudentRequirementModelContent"] = modelBackUp;
            //        return PartialView("_VipModalList", model);

            #endregion

            //获取已经存好的时间提报
            var modelList = Session["GetStudentBookRequirementList"] as List<GetBookRequirementList_Result>;
            //筛选符合条件的学员
            var brList = (from a in modelList
                          where a.BranchId == branchId
                              && a.BookStartTime == startTime && a.BookEndTime == endTime && a.IsVip == isVip
                          select new { a.StudentId, a.BookRequirementId, a.ProductLevelCourseTypeCourseId, a.CourseName, a.IsSuccessful, a.BookStartTime, a.BookEndTime }).ToList();
            //获取学生的Id
            var studentList = (from a in brList select a.StudentId).ToList();

            //获取这些学员的所有订课退订课记录,获取的都是
            var modelBookRecordList = StudyBLL.GetStudentBookRecordList(studentList, isVip);
            var modelStudentList = (from a in modelBookRecordList select new { a.ProductLevelId, a.StudentId, a.UCName, a.UEName }).Distinct().ToList();
            var modelStudentListDetail = new List<StudentModel>();
            foreach (var item in modelStudentList)
            {
                var model = new StudentModel();
                model.StudentId = item.StudentId;
                model.ProductLevelId = item.ProductLevelId;
                model.EName = item.UEName;
                model.CName = item.UCName;
                var itemChild = brList.FirstOrDefault(a => a.StudentId == item.StudentId);
                if (itemChild != null)
                {
                    model.ProductLevelCourseTypeCourseId = itemChild.ProductLevelCourseTypeCourseId;
                    model.BookRequirementId = itemChild.BookRequirementId;
                    model.CourseName = itemChild.CourseName;
                    model.BookStartTime = itemChild.BookStartTime.Value;
                    model.BookEndTime = itemChild.BookEndTime.Value;
                    model.IsSuccessful = itemChild.IsSuccessful.Value;
                }
                model.StudentBookRecordDetailList = modelBookRecordList.Where(a => a.StudentId == item.StudentId
                    && a.ProductLevelId == item.ProductLevelId).ToList();
                modelStudentListDetail.Add(model);
            }
            return PartialView("_VipModalList", modelStudentListDetail);
        }