Пример #1
0
        /// <summary>
        /// 作者:Beta
        /// 时间:2014.03.17
        /// 描述:需求提报(时间区间)切换
        /// </summary>
        /// <param name="type"></param>
        /// <param name="studentId"></param>
        /// <returns></returns>
        public ActionResult SwitchRequirement(int type, int studentId)
        {
            var currDate = Session["StudentRequirement"] == null
                ? DateTime.Now
                : CommonHelper.To<DateTime>(Session["StudentRequirement"]);

            currDate = (type == 1 ? currDate.AddDays(7) : currDate.AddDays(-7));

            var weekIndex = DateTimeHelper.GetWeekIndexByDateTime(currDate);
            var startTime = currDate.AddDays(1 - weekIndex);
            var endTime = currDate.AddDays(8 - weekIndex);

            var model = new SearchStudentRequirementModel()
            {
                CurrDate = currDate,
                StudentRequirementList = StudyBLL.GetBookRequirementListByStudentId(studentId, startTime, endTime)
            };

            Session["StudentRequirement"] = currDate;

            return PartialView("_StudentRequirementInfo", model);
        }
Пример #2
0
        public ActionResult StudentRequirementList(SearchStudentRequirementModel search)
        {
            var startTime = Utility.DateTimeHelper.GetCurrWeekFirstDayByDateTime(search.CurrDate);
            var endTime = startTime.AddDays(7);

            var model = new SearchStudentRequirementModel()
            {
                CurrDate = search.CurrDate,
                ProductId = search.ProductId,
                ProductLevel = search.ProductLevel,
                BranchId = search.BranchId,
                StudentRequirementList = null
            };

            var modelList = StudyBLL.GetStudentBookRequirementList(search.BranchId,search.ProductId, search.ProductLevel, startTime, endTime);
            ViewData["GetStudentBookRequirementList"] = modelList;
            Session["GetStudentBookRequirementList"] = modelList;
            Session["SearchStudentRequirementModel"] = search;

            return PartialView("_ListBookRequirement", model);
        }
Пример #3
0
        public ActionResult SearchStudentRequirementWeek(int branchId, int? week)
        {
            var search = Session["SearchStudentRequirementModel"] as SearchStudentRequirementModel ?? new SearchStudentRequirementModel()
            {
                BranchId = branchId,
                CurrDate = DateTime.Now
            };

            search.BranchId = branchId;

            var days = 0;
            if (!week.HasValue)
            {
                search.CurrDate = DateTime.Now;
            }
            else
            {
                days = (week.Value > 0) ? 7 : -7;
            }

            var currTime = search.CurrDate.AddDays(days);

            var startTime = Utility.DateTimeHelper.GetCurrWeekFirstDayByDateTime(currTime);
            var endTime = startTime.AddDays(7);

            var model = new SearchStudentRequirementModel()
            {
                CurrDate = currTime,
                BranchId = branchId,
                StudentRequirementList = null
            };

            var modelList = StudyBLL.GetStudentBookRequirementList(search.BranchId,search.ProductId, search.ProductLevel, startTime, endTime);
            ViewData["GetStudentBookRequirementList"] = modelList;
            Session["GetStudentBookRequirementList"] = modelList;

            search.CurrDate = currTime;
            Session["SearchStudentRequirementModel"] = search;

            return PartialView("_ListBookRequirement", model);
        }
Пример #4
0
        public ActionResult SearchStudentRequirementMonth(int branchId, int month)
        {
            var search = Session["SearchStudentRequirementModel"] as SearchStudentRequirementModel ?? new SearchStudentRequirementModel()
            {
                BranchId = branchId,
                CurrDate = DateTime.Now
            };

            search.BranchId = branchId;

            var startTime = Utility.DateTimeHelper.GetCurrMonthFirstDayByDateTime(search.CurrDate).AddMonths(month);
            var endTime = startTime.AddDays(7);

            var model = new SearchStudentRequirementModel()
            {
                CurrDate = startTime,
                BranchId = branchId,
                StudentRequirementList = null
            };

            ViewData["GetStudentBookRequirementList"] = StudyBLL.GetStudentBookRequirementList(search.BranchId,search.ProductId, search.ProductLevel, startTime, endTime);
            search.CurrDate = startTime;
            Session["SearchStudentRequirementModel"] = search;

            return PartialView("_ListBookRequirement", model);
        }
Пример #5
0
 public ActionResult Index()
 {
     var model = new SearchStudentRequirementModel()
     {
         CurrDate = DateTime.Now
     };
     return View(model);
 }
Пример #6
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2014.03.12
        /// 描述:需求提报
        /// </summary>
        /// <param name="studentId"></param>
        /// <returns></returns>
        public ActionResult BookRequirementModalDetail(int studentId)
        {
            var currDate = Session["StudentRequirement"] == null
                ? DateTime.Now
                : CommonHelper.To<DateTime>(Session["StudentRequirement"]);

            var weekIndex = DateTimeHelper.GetWeekIndexByDateTime(currDate);
            var startTime = Convert.ToDateTime(currDate.AddDays(1 - weekIndex).ToString("yyyy/MM/dd"));
            var endTime = Convert.ToDateTime(currDate.AddDays(8 - weekIndex).ToString("yyyy/MM/dd"));

            var model = new SearchStudentRequirementModel()
            {
                CurrDate = currDate,
                StudentId = studentId,
                StudentInfo = StudentBLL.GetStudentById(studentId),
                StudentRequirementList = StudyBLL.GetBookRequirementListByStudentId(studentId, startTime, endTime)
            };

            Session["StudentRequirement"] = currDate;

            return PartialView("_BookRequirementModalDetail", model);
        }