예제 #1
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2014.07.15
        /// 描述:我的自定义任务,切换月显示
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public ActionResult SwitchMonth(int type)
        {
            var currDate = Session["ScheduleMonth"] == null
               ? DateTime.Now
               : CommonHelper.To<DateTime>(Session["ScheduleMonth"]);

            if (type != 0)
                currDate = (type == 1 ? currDate.AddDays(30) : currDate.AddDays(-30));

            //当月第一天
            var monthfirstday = DateTimeHelper.GetCurrMonthFirstDayByDateTime(currDate);
            var monthfirstweekindex = DateTimeHelper.GetWeekIndexByDateTime(monthfirstday);
            var startTime = monthfirstday.AddDays(1 - monthfirstweekindex);

            //当月最后一天
            var monthlastday = DateTimeHelper.GetCurrMonthLastDayByDateTime(currDate);
            var monthlastweekindex = DateTimeHelper.GetWeekIndexByDateTime(monthlastday);
            var endTime = monthlastday.AddDays(8 - monthlastweekindex);

            var model = new SearchUserTaskModel()
            {
                CurrDate = currDate,
                UserTaskList = UserBLL.GetUserTaskList(LoginUserManager.CurrLoginUser.UserId, startTime, endTime)
            };

            Session["ScheduleMonth"] = currDate;

            return PartialView("_ListPlan", model);
        }
예제 #2
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2014.07.10
        /// 描述:加载学员列表
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="productLevelId"></param>
        /// <param name="branchId"></param>
        /// <param name="searchKeyWord"></param>
        /// <returns></returns>
        public ActionResult LoadStudentList(int productId, int productLevelId, int branchId, bool isMyStudent, int? searchKey, string searchKeyWord)
        {
            SearchUserTaskModel search = new SearchUserTaskModel();

            var userId = 0;
            if (isMyStudent == true)
                userId = LoginUserManager.CurrLoginUser.UserId;

            search.ProductLevel = ProductBLL.GetProductLevelById(productLevelId);
            search.BranchId = branchId;
            search.ProductId = productId;
            search.IsMyStudent = isMyStudent;
            search.StudentList = null;
            //获取学员
            var studentModel = StudentBLL.GetStudentList(userId, search.BranchId, productLevelId, searchKey, searchKeyWord);
            //组装当前级别ID
            var strContractLevelId = "<Array>";
            var strStudentId = "<Array>";
            foreach (var item in studentModel)
            {
                strContractLevelId = strContractLevelId + string.Format("<PA Nums=@{0}@></PA>", item.ContractLevelId);
                strStudentId = strStudentId + string.Format("<PA Nums=@{0}@></PA>", item.StudentId);
            }
            strContractLevelId = strContractLevelId + "</Array>";
            strStudentId = strStudentId + "</Array>";
            //获取退订课记录
            var bookRecordModel = StudentBLL.GetStudentBookRecordDetailList(strContractLevelId);
            var dtNext = Eme.Utility.DateTimeHelper.GetCurrWeekLastDayByDateTime(DateTime.Now.Date).AddDays(1);
            var bookRequirementStudentModel = StudentBLL.GetStudentBookRequirementNext(strStudentId, dtNext);

            ViewBag.BookRecord = bookRecordModel;
            ViewBag.StudentInfo = studentModel;
            ViewBag.BookRequirementStudent = bookRequirementStudentModel;
            ViewData["BranchId"] = search.BranchId;
            ViewData["IsMyStudent"] = search.IsMyStudent;
            return PartialView("_Info", search);
        }