Exemplo n.º 1
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2014.01.02
 /// 描述:获取反馈信息列表,通过反馈类型
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="feedbackType"></param>
 /// <returns></returns>
 public ActionResult GetFeedbackListByFeedbackType([DefaultValue(1)]int pageIndex, int feedbackType)
 {
     var page = new Paging()
     {
         PageIndex = pageIndex,
         PageSize = 10
     };
     var model = FeedbackBLL.GetFeedbackListByFeedbackType(feedbackType, page);
     return PartialView("_List", model);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2013.11.12 PM
        /// 描述:获取Follow列表信息(分页),通过FU方式
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="followModeType"></param>
        /// <returns></returns>
        public ActionResult FollowListByFollowModeType([DefaultValue(1)]int pageIndex, int followModeType)
        {
            var page = new Paging()
             {
                 PageIndex = pageIndex,
                 PageSize = WebCommon.Global.StudentPageSize
             };
            var model = FollowBLL.GetFollowDetailsByStudentId(LoginUserManager.CurrLoginUser.StudentId, followModeType, page);

            return PartialView("_FollowList", model);
        }
Exemplo n.º 3
0
        /// <summary>
        ///  作者:Beta
        ///  时间:2014.01.16
        ///  描述:获取公告通知列表 根据用户id(分页)
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult NoticeList([DefaultValue(1)]int pageIndex)
        {
            var page = new Paging()
               {
               PageIndex = pageIndex,
               PageSize = Global.StudentPageSize
               };

            var model = EmeBLL.GetNoitceListByUserId(LoginUserManager.CurrLoginUser.UserId, PlatformType.Student, page);
            return PartialView("_NoticeList", model);
        }
        public ActionResult TeacherRateFeedbackList(SearchRateFeedbackModel search, [DefaultValue(1)]int pageIndex)
        {
            Paging paging = new Paging
            {
                PageIndex = pageIndex,
                PageSize = 15
            };
            var model = RateBLL.GetTeacherRateFeedback(search.BranchId, search.IsGreater, Eme.WebCommon.LoginUserManager.CurrLoginUser.UserId, search.SearchKey, search.SearchKeyword
                , search.BeginDate, search.EndDate, search.ProductId, paging);

            Session["SearchTeacherRateFeedbackModel"] = search;
            return PartialView("_List", model);
        }
Exemplo n.º 5
0
        public ActionResult GetRemarkListByUserId(int userId, [DefaultValue(1)]int pageIndex)
        {
            var page = new Paging()
            {
                PageIndex = pageIndex,
                PageSize = 10
            };
            var model = UserBLL.GetRemarkListByUserId(userId, page);

            Session["RemarkUserId"] = userId;
            //monica 添加viewbag
            ViewBag.userId = userId;
            return PartialView("_List", model);
        }
Exemplo n.º 6
0
        /// <summary>
        ///作者:monica
        /// 时间:2012.12.15
        /// 描述:查询当前页的排课列表
        /// </summary>
        /// <param name="search"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult ArrangeCourseByListBySession(SearchArrangeCourseModel search, [DefaultValue(1)]int pageIndex)
        {
            var page = new Paging()
            {
                PageIndex = pageIndex,
                PageSize = 15
            };
            search = Session["SearchArrangeCourse"] as SearchArrangeCourseModel;
            var model = StudyBLL.GetArrangeCourseList(search.UserId, search.BranchId, search.CourseBeginTime,
              search.CourseEndTime, search.IsOnline, null, search.IsVip, search.IsOpen, search.TeacherType, search.ProductLevel, search.ProductId, search.SearchKey,
              search.SearchKeyword, page);

            ViewBag.CurPageIndex = pageIndex;
            return PartialView("_List", model);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.01.21
        /// 描述:获取学员列表(分页)
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="userId"></param>
        /// <param name="contractStatusType"></param>
        /// <param name="currLevel"></param>
        /// <param name="isLimitBook"></param>
        /// <param name="sex"></param>
        /// <param name="isVip"></param>
        /// <param name="isMyStudent"></param>
        /// <param name="searchKey"></param>
        /// <param name="searchKeyword"></param>
        /// <param name="contractBeginDate">合同起始日期搜索-开始</param>
        /// <param name="contractEndDate">合同起始日期搜索-结束</param>
        /// <param name="contractBeginTime">合同截止日期搜索-开始</param>
        /// <param name="contractEndTime">合同截止日期搜索-结束</param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<User> GetStudentList(int? branchId, int? userId, int? contractStatusType, int? currLevel, bool? isLimitBook, int? sex, bool? isVip, bool? isMyStudent, int? searchKey, string searchKeyword, DateTime? contractBeginDate, DateTime? contractEndDate, DateTime? contractBeginTime, DateTime? contractEndTime, Paging page)
        {
            if (!string.IsNullOrEmpty(searchKeyword))
            {
                searchKeyword = searchKeyword.Trim();
            }

            var query = from a in Db.User.Where(q => q.UserType == ConvertEnum.UserTypeForStudent && q.Status != ConvertEnum.StatusTypeForDelete)
                        join b in Db.Student.Where(q => q.Status == ConvertEnum.StatusTypeForActive) on a.Id equals b.UserId
                        join c in Db.Contract.Where(q => q.Status == ConvertEnum.StatusTypeForActive) on b.Id equals c.StudentId
                        orderby c.BeginDate descending
                        select new { User = a, StudentId = b.Id, ContractId = c.Id };

            if (branchId.HasValue)
            {
                query = from q in query join ub in Db.UserBranch.Where(t => t.IsMain
                    && t.BranchId == branchId.Value && t.Status == ConvertEnum.StatusTypeForActive) on q.User.Id equals ub.UserId
                        select q;
            }

            if (isMyStudent.HasValue)
            {
                // 我的学员
                if (isMyStudent.Value)
                {
                    if (userId.HasValue)
                    {
                        //query = query.Where(p => p.Student.Any(s => s.SA == userId || s.CC == userId));
                    }
                }
            }

            if (contractStatusType.HasValue)
            {
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.ContractDetail.Any(d => d.ContractStatusType == contractStatusType.Value))));
            }

            //合同开始日期搜索
            if (contractBeginDate.HasValue)
            {
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.BeginDate >= contractBeginDate.Value)));
            }
            if (contractEndDate.HasValue)
            {
                contractEndDate = contractEndDate.Value.AddDays(1);
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.BeginDate <= contractEndDate.Value)));
            }
            //合同截止日期搜索
            if (contractBeginTime.HasValue)
            {
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.EndDate >= contractBeginTime.Value)));
            }
            if (contractEndTime.HasValue)
            {
                contractEndTime = contractEndTime.Value.AddDays(1);
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.EndDate <= contractEndTime.Value)));
            }

            if (currLevel.HasValue)
            {
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.ContractDetail.Any(d => d.ContractLevel.Any(l => l.ProductLevelId == currLevel && l.IsCurrent)))));
            }
            if (isLimitBook.HasValue)
            {
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.ContractDetail.Any(d => d.IsLimitBook == isLimitBook.Value))));
            }
            if (isVip.HasValue)
            {
                query = from q in query
                        join cd in Db.ContractDetail.Where(t => t.IsVip == isVip.Value) on q.ContractId equals cd.ContractId
                        select q;
                //query = query.Where(p => p.Student.Any(s => s.Contract.Any(c => c.ContractDetail.Any(d => d.IsVip == isVip.Value))));
            }
            if (sex.HasValue)
            {
                //query = query.Where(p => p.UserInfo.Any(u => u.Sex == sex.Value));
            }

            if (searchKey.HasValue && !string.IsNullOrEmpty(searchKeyword))
            {
             //               if (searchKey.Value == CommonHelper.To<int>(SearchStudentKey.KeyWord))
             //               {
             //                   query = query.Where(p =>
             //p.UserInfo.Any(u => u.CName.Contains(searchKeyword) || u.EName.Contains(searchKeyword) || u.Mobile.Contains(searchKeyword) || u.Email.Contains(searchKeyword)) ||
             //p.UserName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase));
             //               }
             //               else if (searchKey.Value == CommonHelper.To<int>(SearchStudentKey.UserName))
             //               {
             //                   query = query.Where(p => p.UserInfo.Any(u => u.CName.Contains(searchKeyword) || u.EName.Contains(searchKeyword)));
             //               }
             //               else if (searchKey.Value == CommonHelper.To<int>(SearchStudentKey.Account))
             //               {
             //                   query = query.Where(p => p.UserName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase));
             //               }
             //               else if (searchKey.Value == CommonHelper.To<int>(SearchStudentKey.SA))
             //               {
             //                   query = query.Where(p =>
             //                       p.Student.Any(s =>
             //                           s.SA.HasValue &&
             //                           Db.UserInfo.Any(u => (
             //                               u.CName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase) ||
             //                               u.EName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase)) &&
             //                               u.UserId == s.SA.Value)));
             //               }
             //               else if (searchKey.Value == CommonHelper.To<int>(SearchStudentKey.CC))
             //               {
             //                   query = query.Where(p =>
             //                       p.Student.Any(s =>
             //                           s.CC.HasValue &&
             //                           Db.UserInfo.Any(u => (
             //                               u.CName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase) ||
             //                               u.EName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase)) &&
             //                               u.UserId == s.CC.Value)));
             //               }
            }
            else if (!searchKey.HasValue && !string.IsNullOrEmpty(searchKeyword))
            {
                query = from q in query
                        join ui in Db.UserInfo on q.User.Id equals ui.UserId
                        where ui.CName.Contains(searchKeyword) || ui.EName.Contains(searchKeyword) || ui.Mobile.Contains(searchKeyword) || ui.Email.Contains(searchKeyword) || q.User.UserName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase)
                        select q;
            //                query = query.Where(p =>
            //p.UserInfo.Any(u => u.CName.Contains(searchKeyword) || u.EName.Contains(searchKeyword) || u.Mobile.Contains(searchKeyword) || u.Email.Contains(searchKeyword)) ||
            //p.UserName.Equals(searchKeyword, StringComparison.CurrentCultureIgnoreCase));
            }

            return (from q in query orderby q.User.Id descending select q.User).ToPagedList(page.PageIndex, page.PageSize);
                //query.Distinct().OrderByDescending(p => p.Id).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 8
0
 /// <summary>
 /// 作者:Beta
 /// 时间:2014.06.11
 /// 描述:获取学员报备信息 (分页)
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="page"></param>
 /// <returns></returns>
 public static PagedList<Referral> GetReferralListByUserId(int userId, Paging page)
 {
     return Db.Referral.Where(p =>
         p.UserId == userId &&
         p.Status == ConvertEnum.StatusTypeForActive)
          .OrderBy(p => p.CreateTime)
          .ToPagedList(page.PageIndex, page.PageSize);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 作者:Primo
 /// 时间:2015.04.24
 /// 描述:获取投诉列表信息,通过用户ID(分页)
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="feedbackType"></param>
 /// <param name="pageIndex"></param>
 /// <returns></returns>
 public ActionResult GetComplainListByUserId(int userId, int menuId, [DefaultValue(1)]int pageIndex)
 {
     var page = new Paging()
     {
         PageIndex = pageIndex,
         PageSize = 3
     };
     var model = ComplainBLL.GetComplainContentListByUserId(userId, menuId, page);
     return PartialView("_ComplainList", model);
 }
Exemplo n.º 10
0
        public ActionResult SearchStudentList(SearchStudentModel search, int pageIndex = 1)
        {
            if (search.IsAreaStudent.HasValue)
            {
                if (string.IsNullOrWhiteSpace(search.SearchKeyword))
                {
                    return null;
                }
            }
            else if (search.IsAllStudent.HasValue)
            {
                if (string.IsNullOrWhiteSpace(search.SearchKeyword))
                {
                    return null;
                }
            }
            else
            {
                // 我的学员
                if (
                    LoginUserManager.CurrLoginUser.RightsList.Any(
                        p => p.SCode.Equals("EM001") && p.Status == ConvertEnum.StatusTypeForActive))
                {
                    search.IsMyStudent = true;
                    search.UserId = LoginUserManager.CurrLoginUser.UserId;
                }
                else
                {
                    if (search.IsMyStudent.HasValue && search.IsMyStudent.Value)
                    {
                        search.UserId = LoginUserManager.CurrLoginUser.UserId;
                    }
                }
            }
            // Ark 注:参数应该是 SearchStudentModel,以后优化时修改
            Paging paging = new Paging
            {
                PageIndex = pageIndex,
                PageSize = 5
            };
            //var model = StudentBLL.GetStudentList(search.BranchId, search.UserId, search.ContractStatusType, search.CurrentLevel, search.IsLimitBook, search.Sex, search.IsVip, search.IsMyStudent, search.SearchKey,
            //    search.SearchKeyword, search.ContractBeginDate, search.ContractEndDate, search.ContractBeginTime, search.ContractEndTime, paging);

            var saCCInfos = new List<SACCInfo>();
            var contractInfos = new List<ContractInfo>();
            var contractDetailInfos = new List<ContractDetailInfo>();
            var contractLevelInfos = new List<ContractLevelInfo>();
            var contractFrozenInfos = new List<ContractFrozenInfo>();

            var model = StudentBLL.GetStudentList(search.BranchId, search.UserId, search.ContractStatusType, search.CurrentLevel, search.ProductId,
                search.IsLimitBook, search.Sex, search.IsVip, search.IsMyStudent, search.IsAreaStudent, search.IsAllStudent, search.SearchKey, search.SearchKeyword,
                search.ContractBeginDate, search.ContractEndDate, search.ContractBeginTime, search.ContractEndTime,search.ConditionType, paging,
                out saCCInfos, out contractInfos, out contractDetailInfos, out contractLevelInfos, out contractFrozenInfos);
            ViewBag.SACCInfos = saCCInfos;
            ViewBag.ContractInfos = contractInfos;
            ViewBag.ContractDetailInfos = contractDetailInfos;
            ViewBag.ContractLevelInfos = contractLevelInfos;
            ViewBag.ContractFrozenInfos = contractFrozenInfos;

            Session["StudentSearchModel"] = search;
            return PartialView("_StudentList", model);// PartialView("_List", model);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 作者:Raymond
        /// 时间:2014-1-3
        /// 描述:根据关键字获取产品列表
        /// ------------------------------
        /// 更新:Vincen
        /// 时间:2014.02.28
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="keyWords"></param>
        /// <returns></returns>
        public static PagedList<Product> GetProductPageList(int? branchId, string keyWords, Paging page)
        {
            var Db = new EmeEntities(dbRead);
            var query = from p in Db.Product where p.Status != ConvertEnum.StatusTypeForDelete select p;
            if (branchId.HasValue)
            {
                query = query.Where(p => p.ProductBranch.Any(b => b.BranchId == branchId.Value));
            }

            if (!string.IsNullOrEmpty(keyWords))
            {
                query = query.Where(p => p.CName.Contains(keyWords) || p.EName.Contains(keyWords) || p.Description.Contains(keyWords));
            }

            return query.OrderBy(p => p.OrderNum).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 12
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2014.02.28
 /// 描述:根据状态获取产品列表
 /// </summary>
 /// <param name="sType">产品状态</param>
 /// <param name="page"></param>
 /// <returns></returns>
 public static PagedList<Product> GetProductList(StatusType sType, Paging page)
 {
     var Db = new EmeEntities(dbRead);
     var status = CommonHelper.To<int>(sType);
     var query = from p in Db.Product where p.Status == status select p;
     return query.OrderBy(p => p.OrderNum).ToPagedList(page.PageIndex, page.PageSize);
 }
Exemplo n.º 13
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.03.27
        /// 描述:获取产品级别类型课程列表
        /// </summary>
        /// <param name="productLevelType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<ProductLevelCourseTypeCourse> GetProductLevelCourseTypeCourseList(int productLevelType, Paging page)
        {
            var Db = new EmeEntities(dbRead);

            var activeStatus = CommonHelper.To<int>(StatusType.Active);
            var query = from a in Db.ProductLevelCourseTypeCourse
                        where a.ProductLevelCourseTypeId == productLevelType && a.Status == activeStatus
                        select a;

            return query.OrderBy(p => p.Course.EName).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2015.1.5
        /// 描述:获取培训计划列表 
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="branchId"></param>
        /// <param name="beginDate"></param>
        /// <param name="endDate"></param>
        /// <param name="isOnline"></param>
        /// <param name="isSpeaker"></param>
        /// <param name="searchKeyValue"></param>
        /// <param name="searchKey"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<TrainSchedule> GetTrainScheduleListByUserId(int userId, int branchId, DateTime? beginDate, DateTime? endDate, bool? isOnline, bool? isSpeaker, string searchKeyValue, int? searchKey, Paging page)
        {
            var db = new EmeEntities();
            var query = db.TrainSchedule.Where(p => p.Status == ConvertEnum.StatusTypeForActive
                                                    && p.SpeakerId != userId
                                                    && p.IsBook
                                                    && !p.TrainRecord.Any(t => t.TrainScheduleId == p.Id && t.Status == ConvertEnum.StatusTypeForActive && t.UserId == userId && !t.IsUnBook)
                                                    && (!p.IsRights || (p.IsRights && p.TrainRights.Any(o => o.TrainSchedule.Status == ConvertEnum.StatusTypeForActive
                                                        && o.TrainScheduleId == p.Id
                                                        && o.BranchId == branchId
                                                        && o.Branch.UserBranch.Any(t => t.UserId == userId && t.BranchId == o.BranchId && t.Status == ConvertEnum.StatusTypeForActive)))));
            if (beginDate.HasValue)
            {
                query = query.Where(p => p.BeginTime >= beginDate);
            }
            if (endDate.HasValue)
            {
                var etime = endDate.Value.AddDays(1).AddSeconds(-1);
                query = query.Where(p => p.EndTime <= etime);
            }

            if (isOnline.HasValue && isOnline.Value)
            {
                query = query.Where(p => p.MeetingPlatformType != ConvertEnum.MeetingPlatformTypeForOffline);
            }

            if (isOnline.HasValue && !isOnline.Value)
            {
                query = query.Where(p => p.MeetingPlatformType == ConvertEnum.MeetingPlatformTypeForOffline);
            }

            //if (isSpeaker.HasValue)
            //{
            //    query = query.Where(p => p.SpeakerId == userId);
            //}

            //Add search key for query
            if (searchKey.HasValue && !string.IsNullOrWhiteSpace(searchKeyValue))
            {
                if (searchKey.Value == ConvertEnum.SearchTrainingForTitle)
                {
                    query =
                        query.Where(
                            r => r.Subject.Contains(searchKeyValue));
                }

                else if (searchKey.Value == ConvertEnum.SearchTrainingForContent)
                {
                    query =
                        query.Where(
                            r => r.TContent.Contains(searchKeyValue));
                }
                else if (searchKey.Value == ConvertEnum.SearchTrainingForSpeaker)
                {
                    query =
                        query.Where(
                            r => r.Speaker.Contains(searchKeyValue));
                }

            }
            //关键字默认查询
            if (!string.IsNullOrWhiteSpace(searchKeyValue))
            {
                query = query.Where(r => r.Speaker.Contains(searchKeyValue)
                    || r.User.UserInfo.Any(t => t.CName.Contains(searchKeyValue)
                        || t.EName.Contains(searchKeyValue)) || r.Subject.Contains(searchKeyValue));
            }

            return query.AsNoTracking().OrderByDescending(o => o.EndTime > DateTime.Now ? 1 : 0).OrderBy(p => p.BeginTime)
                .ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 15
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2013.12.25
 /// 描述:获取培训计划列表,通过中心编号
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="page"></param>
 /// <returns></returns>
 public static PagedList<TrainSchedule> GetTrainScheduleListByBranchId(int branchId, Paging page)
 {
     var db = new EmeEntities();
     return db.TrainSchedule.Where(p => p.Status == ConvertEnum.StatusTypeForActive && (p.IsRights && p.TrainRights.Any(o => o.BranchId == branchId)) || !p.IsRights).AsNoTracking()
          .OrderByDescending(p => p.BeginTime)
          .ToPagedList(page.PageIndex, page.PageSize);
 }
Exemplo n.º 16
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2014.04.10
        /// 描述:获取培训计划列表,用于后台管理
        /// </summary>
        /// <param name="branchId">权限中心</param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <param name="platformType"></param>
        /// <param name="searchKey"></param>
        /// <param name="searchKeyValue"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<TrainSchedule> GetTrainScheduleList(int? branchId, DateTime? beginTime, DateTime? endTime, MeetingPlatformType? platformType, int? searchKey, string searchKeyValue, Paging page)
        {
            var db = new EmeEntities();

            var query = db.TrainSchedule.Where(p => p.Status == ConvertEnum.StatusTypeForActive);
            if (branchId.HasValue)
            {
                query = query.Where(p => p.TrainRights.Any(o => o.Branch.UserBranch.Any(t => (t.BranchId == branchId
                    || t.Branch.ParentId == branchId) && t.IsMain)) || !p.IsRights);
            }
            if (beginTime.HasValue)
            {
                query = query.Where(p => p.BeginTime >= beginTime);
            }
            if (endTime.HasValue)
            {
                query = query.Where(p => p.EndTime >= endTime);
            }
            if (platformType.HasValue)
            {
                var pType = CommonHelper.To<int>(platformType);
                query = query.Where(p => p.MeetingPlatformType == pType);
            }

            if (!string.IsNullOrEmpty(searchKeyValue))
            {
                switch (searchKey)
                {
                    case 101: //主题
                        query = query.Where(p => p.Subject.Contains(searchKeyValue));
                        break;

                    case 102://内容
                        query = query.Where(p => p.TContent.Contains(searchKeyValue));

                        break;
                    case 103://speaker
                        query = query.Where(p => p.Speaker.Contains(searchKeyValue));

                        break;
                    case 104: //MeetingRoom
                        query = query.Where(p => p.MeetingRoom.Contains(searchKeyValue));

                        break;
                    default:
                        query = query.Where(p => (p.TContent.Contains(searchKeyValue) || p.Subject.Contains(searchKeyValue)));
                        break;
                }

            }
            return query.AsNoTracking().OrderByDescending(p => p.BeginTime).ThenByDescending(p => p.EndTime).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 作者:Kylin 
        /// 时间:2014.1.14
        /// 描述:获取通知列表,通过用户编号
        /// ---------------------------------
        /// 更新:Vincen
        /// 时间:2014.04.30
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="plartFormType"></param>
        /// <param name="beginDate"></param>
        /// <param name="endDate"></param>
        /// <param name="searchKey"></param>
        /// <param name="searchKeyword"></param>
        /// /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<Notice> GetNoticeList(int branchId, int? plartFormType, DateTime? beginDate, DateTime? endDate, int? searchKey, string searchKeyword, Paging page)
        {
            var Db = new EmeEntities(dbRead);
            var noRightsList = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && !p.IsRights);
            var tempList = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive).
                Where(p => p.NoticeRights.Any(n => n.BranchId == branchId && n.Status == ConvertEnum.StatusTypeForActive)).
                Union(noRightsList);

            if (plartFormType.HasValue)
            {
                tempList = tempList.Where(p => p.PlatformType == plartFormType);
            }
            if (beginDate.HasValue && beginDate != DateTime.MinValue)
            {
                tempList = tempList.Where(p => p.BeginDate >= beginDate);
            }
            if (endDate.HasValue && endDate != DateTime.MinValue)
            {
                tempList = tempList.Where(p => p.BeginDate <= endDate);
            }
            if (!searchKey.HasValue)
            {
                searchKey = 101;
            }

            if (!string.IsNullOrEmpty(searchKeyword) && searchKeyword.Length > 0)
            {
                switch (searchKey.Value)
                {
                    case 101: // 主题
                        tempList = tempList.Where(p => p.Subject.Contains(searchKeyword));
                        break;
                    case 102: // 内容
                        tempList = tempList.Where(p => p.NContent.Contains(searchKeyword));
                        break;
                    default:
                        tempList = tempList.Where(p => p.Subject.Contains(searchKeyword));
                        break;
                }
            }
            return tempList.AsNoTracking()
                    .OrderByDescending(p => p.SetTopTime)
                    .ThenByDescending(p => p.OrderNum)
                    .ThenBy(p => p.BeginDate)
                    .ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 作者:Beta
        /// 时间:2014.01.16
        /// 描述:获取公告通知 根据用户id查询(分页)
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="platformType"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<Notice> GetNoitceListByUserId(int userId, PlatformType platformType, Paging page)
        {
            var Db = new EmeEntities();
            var platform = CommonHelper.To<int>(platformType);
            var noRightsList = Db.Notice.Where(p => p.Status == ConvertEnum.StatusTypeForActive && p.PlatformType == platform && !p.IsRights);
            var tempList =
                Db.Notice.Where(
                    p =>
                        p.Status == ConvertEnum.StatusTypeForActive && p.PlatformType == platform &&
                        p.NoticeRights.Any(n => n.Branch.UserBranch.Any(u => u.UserId == userId)));
            noRightsList = noRightsList.Union(tempList);
            var allList = noRightsList.Distinct().OrderByDescending(p => p.SetTopTime).ThenBy(p => p.BeginDate).ThenBy(p => p.OrderNum).ThenByDescending(p => p.IsTop).ToPagedList(page.PageIndex, page.PageSize);

            return allList;
        }
Exemplo n.º 19
0
 /// <summary>
 /// 作者:Vincen
 /// 时间:2013.12.23
 /// 描述:获取指定接收人的消息列表
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="page"></param>
 /// <returns></returns>
 public static PagedList<MessageReceiver> GetMessageReceiverListListByUserId(int userId, Paging page)
 {
     var Db = new EmeEntities(dbRead);
     var query = from a in Db.MessageReceiver
                 where a.Receiver == userId && a.Status == 101
                 orderby a.CreateTime descending
                 select a;
     return query.ToPagedList(page.PageIndex, page.PageSize);
 }
Exemplo n.º 20
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.06.18
        /// 描述:获取学员报备信息 (分页)
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="referralStageType"></param>
        /// <param name="referralStatusType"></param>
        /// <param name="beginDateTime"></param>
        /// <param name="endDateTime"></param>
        /// <param name="searchKey"></param>
        /// <param name="searchKeyword"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<Referral> GetReferralList(int branchId, int? referralStageType, int? referralStatusType, DateTime? beginDateTime, DateTime? endDateTime, int? searchKey, string searchKeyword, Paging page)
        {
            var query = from a in Db.Referral
                        where a.Status == ConvertEnum.StatusTypeForActive &&
                              a.User.UserBranch.Any(p => p.BranchId == branchId && p.IsMain)
                        select a;

            var searchKeywords = "";
            if (!string.IsNullOrEmpty(searchKeyword))
            {
                searchKeywords = searchKeyword.Trim();
            }

            if (referralStageType.HasValue)
            {
                query = query.Where(p => p.ReferralStageType == referralStageType);
            }

            if (referralStatusType.HasValue)
            {
                query = query.Where(p => p.ReferralStatusType == referralStatusType);
            }

            if (beginDateTime.HasValue)
            {
                query = query.Where(p => p.CreateTime.HasValue ? p.CreateTime.Value >= beginDateTime.Value : true);
            }

            if (endDateTime.HasValue)
            {
                endDateTime = endDateTime.Value.AddDays(1);
                query = query.Where(p => p.CreateTime.HasValue ? p.CreateTime.Value >= endDateTime.Value : true);
            }

            if (searchKey.HasValue && !string.IsNullOrEmpty(searchKeyword))
            {
                switch (searchKey.Value)
                {
                    case 101:   // 姓名
                        query = query.Where(p =>
                            p.CName.Contains(searchKeywords) ||
                            p.EName.Contains(searchKeywords) ||
                            p.User.UserInfo.Any(u => u.CName.Contains(searchKeywords)) ||
                            p.User.UserInfo.Any(u => u.EName.Contains(searchKeywords)));
                        break;
                    case 102:   // 手机号码
                        query = query.Where(p => p.Mobile.Contains(searchKeywords));
                        break;
                    case 103:   // SA
                        query = query.Where(p =>
                            p.User.Student.Any(s =>
                                s.SA.HasValue &&
                                Db.UserInfo.Any(u =>
                                    u.UserId == s.SA.Value &&
                                    (u.CName.Contains(searchKeywords) || u.EName.Contains(searchKeywords)))));
                        break;
                    case 104:   // CC
                        query = query.Where(p =>
                            p.User.Student.Any(s =>
                                s.CC.HasValue &&
                                Db.UserInfo.Any(u =>
                                    u.UserId == s.CC.Value &&
                                    (u.CName.Contains(searchKeywords) || u.EName.Contains(searchKeywords)))));
                        break;
                    case 105:   // 地址
                        query = query.Where(p => p.Address.Contains(searchKeywords));
                        break;
                }
            }

            return query.OrderByDescending(p => p.CreateTime).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 21
0
        public ActionResult SearchObservationList(SearchObservationListModel searchModel,
            [DefaultValue(1)] int pageIndex)
        {
            Session["SearchObservationListModel"] = searchModel;
            var page = new Paging()
            {
                PageIndex = pageIndex,
                PageSize = 15
            };

            //选项卡索引
            int tabIndex = Session["ObservationTabIndex"] != null ? int.Parse(Session["ObservationTabIndex"].ToString()) : 1;

               return  ReserveCourse(pageIndex, tabIndex);
        }
Exemplo n.º 22
0
 public ActionResult SearchSurveyContent(int pageIndex, int? branchId, int? platformType, string keyWord)
 {
     var page = new Paging()
     {
         PageIndex = pageIndex,
         PageSize = WebCommon.Global.ManagerSmallPageSize
     };
     var model = SurveyBLL.GetSurveyList(branchId, platformType, keyWord, page);
     return PartialView("SurveyContent", model);
 }
Exemplo n.º 23
0
        /// <summary>
        /// 作者:Raymond
        /// 时间:2014-3-25
        /// 描述:获取产品课节分页列表
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="productLevelId"></param>
        /// <param name="productCourseTypeId"></param>
        /// <param name="branchId"></param>
        /// <param name="keyWord"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<ProductLevelCourseTypeCourse> GetProductLevelCourseTypeCoursePageList(int productId, int? productLevelId, int? productCourseTypeId, int? branchId, string keyWord, Paging page)
        {
            var Db = new EmeEntities();

            var activeStatus = CommonHelper.To<int>(StatusType.Active);

            if (string.IsNullOrEmpty(keyWord))
                keyWord = "";
            var query = from a in Db.ProductLevelCourseTypeCourse
                        join b in Db.ProductLevelCourseType on a.ProductLevelCourseTypeId equals b.Id
                        join c in Db.ProductLevel on b.ProductLevelId equals c.Id
                        where a.Status == activeStatus && c.ProductId == productId && (!productLevelId.HasValue || b.ProductLevelId == productLevelId)
                        && (!productCourseTypeId.HasValue || b.ProductCourseTypeId == productCourseTypeId)
                        && (a.Course.CName.Contains(keyWord))
                        && (!branchId.HasValue || a.BranchId == branchId || a.IsSystem)
                        select a;
            return query.Distinct().OrderBy(p => p.Course.CName).ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 24
0
 /// <summary>
 /// 作者:Beta
 /// 时间:2014/04/28
 /// 描述:获取反馈列表信息,通过用户ID(分页)
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="feedbackType"></param>
 /// <param name="pageIndex"></param>
 /// <returns></returns>
 public ActionResult GetFeedbackListByUserId(int userId, int feedbackType, [DefaultValue(1)]int pageIndex)
 {
     var page = new Paging()
     {
         PageIndex = pageIndex,
         PageSize = 3
     };
     var model = FeedbackBLL.GetFeedbackListByUserId(userId, feedbackType, page);
     return PartialView("_List", model);
 }
Exemplo n.º 25
0
 /// <summary>
 /// 作者:Raymond
 /// 时间:2013-11-26
 /// 描述:分页获取产品列表
 /// </summary>
 /// <returns></returns>
 public static PagedList<Product> GetProductListByPaging(Paging page)
 {
     var Db = new EmeEntities(dbRead);
     var query = from c in Db.Product where c.Status != ConvertEnum.StatusTypeForDelete select c;
     return query.OrderBy(p => p.OrderNum).ToPagedList(page.PageIndex, page.PageSize);
 }
Exemplo n.º 26
0
        /// <summary>
        /// 作者:Raymond
        /// 时间:2013-12-10
        /// 描述:通过中心Id,获取缓存中的班次分页列表
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="keyWord"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<WorkTime> GetWorkTimeListByBranchId(int branchId, string keyWord, Paging page)
        {
            var key = string.Format("{0}{1}", Klist, branchId);
            var keyList = new List<string>();
            if (!Icache.IsSet(key))
            {
                var wList = BranchBLL.GetWorkTimeListByBranchId(branchId, keyWord);
                foreach (var w in wList)
                {
                    SetWorkTimeCache(w);
                    keyList.Add(string.Format("{0}{1}", Kword, w.Id));
                }
                Icache.Set(key, keyList, 180 * 24 * 60);
            }
            else
            {
                keyList = Icache.Get<List<string>>(key) ?? new List<string>(); ;
            }
            var list = from k in keyList select GetWorkTimeCacheByKey(k);

            if (!string.IsNullOrEmpty(keyWord))
            {
                list = list.Where(p => p.CName.Contains(keyWord) || p.EName.Contains(keyWord));
            }
            return list.OrderBy(p => p.OrderNum).AsQueryable().ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 27
0
 public ActionResult SearchSurveyList(SearchSurveyModel search, [DefaultValue(1)]int pageIndex)
 {
     var page = new Paging() { PageIndex = pageIndex, PageSize = WebCommon.Global.ManagerSmallPageSize };
     var model = SurveyBLL.GetSurveyList(search.BranchId, search.PlatformType, search.BeginDate, search.EndDate, search.SearchKeyWord, page);
     Session["SurveySearch"] = search;
     return PartialView("_SurveyList", model);
 }
Exemplo n.º 28
0
        /// <summary>
        /// 作者:monica
        /// 时间:2014.12.20
        /// 描述:等待确认
        /// </summary>
        /// <returns></returns>
        public ActionResult WaitConfirmCourse([DefaultValue(1)] int pageIndex, [DefaultValue(1)] int tabIndex)
        {
            ;
            Session["ObservationTabIndex"] = tabIndex;
            SearchObservationListModel searchModel = Session["SearchObservationListModel"] as SearchObservationListModel ?? new SearchObservationListModel();
            var page = new Paging()
            {
                PageIndex = pageIndex,
                PageSize = 15
            };
            ViewBag.CurPageIndex = pageIndex;
            searchModel.IsConfirmed = null;
            searchModel.IsRated = null;
            searchModel.IsAttend = null;
            searchModel.IsConfirmed = false;

            ///默认起止时间
            DateTime sdate = DateTime.Now.AddDays(-(DateTime.Now.Day - 1)).Date;
            DateTime edate = DateTime.Now.AddMonths(1).AddDays(-(DateTime.Now.Day)).Date;

            var selObservationList = new List<ObservationModel>();
            var observationList = StudyBLL.GetObserationUnConfirmList(LoginUserManager.CurrLoginUser.UserId,searchModel.BeginDate ?? sdate, searchModel.EndDate ?? edate,searchModel.SearchKey,searchModel.SearchKeyValue,page);

            return PartialView("_ComfirmList", observationList);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.04.27
        /// 描述:获取教室类型列表
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="classroomType"></param>
        /// <param name="keyword"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<Classroom> GetClassroomPagedList(int? branchId, int? classroomType, string keyword, Paging page)
        {
            var key = string.Format("{0}{1}", Klist, branchId);
            var keyList = new List<string>();
            if (!Icache.IsSet(key))
            {
                var bList = BranchBLL.GetClassroomList(branchId);
                foreach (var b in bList)
                {
                    SetClassroomCache(b);
                    keyList.Add(string.Format("{0}{1}", Kword, b.Id));
                }
                Icache.Set(key, keyList, 180 * 24 * 60);
            }
            else
            {
                keyList = Icache.Get<List<string>>(key) ?? new List<string>();
            }

            var list = from k in keyList select GetClassroomCacheByKey(k);

            if (classroomType.HasValue)
            {
                list = list.Where(p => p.ClassroomTypeId == classroomType.Value);
            }

            if (!string.IsNullOrEmpty(keyword))
            {
                list = list.Where(p => p.ClassroomName.Contains(keyword));
            }

            list = list.Where(p => p.Status != ConvertEnum.StatusTypeForDelete);

            return list.OrderByDescending(p => p.CreateTime).ThenBy(p => p.ClassroomName).AsQueryable().ToPagedList(page.PageIndex, page.PageSize);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.01.21
        /// 描述:获取产品列表,通过其状态
        /// ----------------------------------------
        /// 更新:Vincen
        /// 时间:2014.02.28
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="pType"></param>
        /// <param name="keyWords"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public static PagedList<Product> GetCacheProductListByBranchId(int branchId, StatusType pType, string keyWords, Paging page)
        {
            var key = string.Format("{0}{1}", Klist, branchId);
            var keyList = new List<string>();
            if (!Icache.IsSet(key))
            {
                var pList = ProductBLL.GetProductListByBranchId(branchId);
                foreach (var p in pList)
                {
                    SetProductCache(p);
                    keyList.Add(string.Format("{0}{1}", Kword, p.Id));
                }
                Icache.Set(key, keyList, 180 * 24 * 60);
            }
            else
            {
                keyList = Icache.Get<List<string>>(key) ?? new List<string>(); ;
            }
            var list = from k in keyList select GetCacheProductByKey(k);
            list = list.Where(p => p.Status == Utility.CommonHelper.To<int>(pType));
            if (!string.IsNullOrEmpty(keyWords))
            {
                list = list.Where(p => p.CName.Contains(keyWords) || p.EName.Contains(keyWords));
            }

            return list.OrderBy(p => p.OrderNum).AsQueryable().ToPagedList(page.PageIndex, page.PageSize);
        }