Esempio n. 1
0
        public JsonResult GetScoreList()
        {
            var monthParam = Request["month"];

            if (string.IsNullOrEmpty(monthParam) || !Regex.IsMatch(monthParam, "\\d{4}-\\d{2}"))
            {
                return(Json(ErrorModel.InputError));
            }

            var splits = monthParam.Split('-');
            var year   = splits[0].ToInt32();
            var month  = splits[1].ToInt32();

            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var scoreBll  = new ViewInstructorReviewScoreBll();
                var condition = $"Year={year} AND Month={month}";

                int totalCount;
                var list = scoreBll.QueryPageList(pageIndex, pageSize, condition, null, false, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            });

            return(Json(json));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取数据列表的公共方法(通过表名反映获取)
        /// </summary>
        /// <returns></returns>
        public JsonResult GetList()
        {
            var instructorId = Request["instructorId"].ToInt32();
            var month        = Request["month"].ToDateTime();
            var tableName    = Request["target"];

            if (string.IsNullOrEmpty(tableName))
            {
                return(Json(ErrorModel.InputError));
            }

            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var bllInstance = BllFactory.GetBllInstance(tableName);
                if (bllInstance != null)
                {
                    var type = bllInstance.GetType();

                    try
                    {
                        // build condition
                        var conditionList = new List <string>();
                        if (instructorId > 0)
                        {
                            conditionList.Add("InstructorId=" + instructorId);
                        }

                        if (month != default(DateTime))
                        {
                            var start = month.AddDays(-1);
                            var end   = month.AddMonths(1);
                            conditionList.Add($"UploadTime>'{start}' AND UploadTime<'{end}'");
                        }

                        var condition  = string.Join(" AND ", conditionList);
                        var orderField = Request["order"] ?? "UploadTime";
                        var arguments  = new object[] { pageIndex, pageSize, condition, orderField, true, 0 };
                        var list       = type.InvokeMember("QueryPageList", BindingFlags.InvokeMethod, null, bllInstance,
                                                           arguments);

                        return(new KeyValuePair <int, object>((int)arguments[5], list));
                    }
                    catch (Exception ex)
                    {
                        ExceptionLogBll.ExceptionPersistence("InstructorController.cs", "InstructorController", ex);

                        return(new KeyValuePair <int, object>());
                    }
                }

                return(new KeyValuePair <int, object>());
            });

            return(Json(json));
        }
Esempio n. 3
0
        public JsonResult GetFiles()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(Request,
                                                                 (pageIndex, pageSize) =>
            {
                var fileBll = new ViewExamFilesBll();

                int totalCount;
                var list = fileBll.QueryPageList(pageIndex, pageSize, "AddTime", true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            });

            return(Json(json));
        }
Esempio n. 4
0
        public JsonResult GetPersons()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var viewBll = new ViewPersonInfoBll();

                int totalCount;
                var list = viewBll.QueryPageList(pageIndex, pageSize, "UpdateTime", true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            });

            return(Json(json));
        }
Esempio n. 5
0
        public JsonResult GetQuotaList()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var quotaBll = new InstructorQuotaBll();

                int totalCount;
                var list = quotaBll.QueryPageList(pageIndex, pageSize, "IsDelete=0", null, false, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            });

            return(Json(json));
        }
Esempio n. 6
0
        public JsonResult GetList()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                int totalCount;
                var bll  = new AnnouncementBll();
                var list = bll.QueryPageList(pageIndex, pageSize, "PubTime", true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            }
                );

            return(Json(json));
        }
Esempio n. 7
0
        public JsonResult GetTrainNos()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var stationBll = new TrainNoBll();

                int totalCount;
                var data = stationBll.QueryPageList(pageIndex, pageSize, "UpdateTime",
                                                    true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, data));
            }
                );

            return(Json(json));
        }
Esempio n. 8
0
        public JsonResult GetList()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) =>
            {
                var recordBll = new ViewDriveRecordBll();

                int totalCount;
                var data = recordBll.QueryPageList(pageIndex, pageSize, "AttendTime",
                                                   true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, data));
            }
                );

            return(Json(json));
        }
Esempio n. 9
0
        public JsonResult GetResults()
        {
            var json = JqueryDataTableAjaxHelper.GetPageListJson(
                Request,
                (pageIndex, pageSize) => {
                var conditionList = new List <string>();

                var notifyId = Request["notifyId"].ToInt32();
                if (notifyId > 0)
                {
                    conditionList.Add("ExamNotifyId=" + notifyId);
                }

                var departId = Request["departId"].ToInt32();
                if (departId > 0)
                {
                    conditionList.Add("DepartmentId=" + departId);
                }

                var passed = Request["passed"] ?? string.Empty;
                if (!string.IsNullOrEmpty(passed))
                {
                    conditionList.Add(string.Format("Passed='{0}'", passed));
                }

                int totalCount;
                var condition = string.Join(" AND ", conditionList);

                var resultBll = new ViewExamRecordsBll();
                var list      = resultBll.QueryPageList(pageIndex, pageSize, condition, "NotifyAddTime", true, out totalCount);

                return(new KeyValuePair <int, object>(totalCount, list));
            }
                );

            return(Json(json));
        }