Пример #1
0
        /// <summary>
        /// 作者:Kylin
        /// 时间:2014.08.01
        /// 描述:获取中心老师授课量统计报表数据集
        /// </summary>
        /// <param name="searchModel"></param>
        /// <returns></returns>
        public ActionResult SearchTeachRecordTotal(SearchTeachRecordModel searchModel)
        {
            if (!searchModel.SearchDate.HasValue)
            {
                searchModel.BeginDate = searchModel.BeginDate ?? new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                searchModel.EndDate = (searchModel.EndDate ?? DateTime.Now.Date).AddDays(1).AddSeconds(-1);
                ViewBag.IsFulltime = false;
            }
            else
            {
                if (searchModel.EndDate != null)
                    searchModel.EndDate = searchModel.EndDate.Value.AddDays(1).AddSeconds(-1);
                ViewBag.IsFulltime = true;
            }

            searchModel.TeacherType = string.IsNullOrEmpty(searchModel.TeacherType)
                ? BaseEnum.EmeEnum<TeacherType>.GetEnumEnumerator("Ename")
                .Aggregate(string.Empty, (current, teacherType) => current + "," + teacherType.Value) : searchModel.TeacherType;
            return PartialView("_TeachRecord", ReportBLL.GetTeacherRecordTotal(searchModel.BranchId, searchModel.BeginDate.Value, searchModel.EndDate.Value, searchModel.TeacherType, searchModel.IsFulltime));
        }
Пример #2
0
        public ActionResult TeachRecordTotal(SearchTeachRecordModel searchModel)
        {
            if (searchModel.BranchId == 0)
            {
                searchModel.BranchId = Eme.WebCommon.LoginUserManager.CurrLoginUser.BranchId;
            }

            if (searchModel.SearchDate.HasValue)
            {
                return View("TeachRecordTotal", new SearchTeachRecordModel()
                {
                    BeginDate = searchModel.SearchDate.Value, //月初
                    EndDate = searchModel.SearchDate.Value.AddMonths(1).AddDays(-1),//月末
                    BranchId = searchModel.BranchId,
                    TeacherType = searchModel.TeacherType,
                    IsFulltime = true
                });
            }

            else
            {
                return View("TeachRecordTotal", new SearchTeachRecordModel()
                {
                    BeginDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1),
                    EndDate = DateTime.Now.Date,
                    IsFulltime = false,
                    BranchId = searchModel.BranchId
                });
            }
        }
Пример #3
0
        public ActionResult ExportTeachRecordTotal(int branchId, DateTime? beginDate, DateTime? endDate, string teacherType, bool? isFulltime)
        {
            beginDate = beginDate ?? new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            endDate = (endDate ?? DateTime.Now.Date).AddDays(1).AddSeconds(-1);
            teacherType = string.IsNullOrEmpty(teacherType) ? BaseEnum.EmeEnum<TeacherType>.GetEnumEnumerator("Ename").Aggregate(string.Empty, (current, ttype) => current + "," + ttype.Value) : teacherType;

            Session["ExportTeachRecordTotal"] = string.Format("{0}{1}{2}老师授课量统计报表",
                branchId <= 0 ? "全国" : BranchCache.GetBranchCacheById(branchId).EName, beginDate.Value.ToString("yy-MM-dd"), endDate.Value.ToString("yy-MM-dd"));
            var searchModel = new SearchTeachRecordModel()
            {
                BranchId = branchId,
                BeginDate = beginDate,
                EndDate = endDate,
                TeacherType = teacherType
            };
            return PartialView("_ExportTeachRecord", ReportBLL.GetTeacherRecordTotal(searchModel.BranchId, beginDate.Value, endDate.Value, searchModel.TeacherType, isFulltime));
        }