|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Util;
- using Nancy;
-
- namespace Learun.Application.WebApi.Modules
- {
- public class StuPunishmentApi : BaseApi
- {
- public StuPunishmentApi()
- : base("/StuPunishment")
- {
- Get["/academicAndSemesterList"] = GetAcademicAndSemesterList;
- Get["/punishmentList"] = GetPunishmentList;
-
- }
-
- private StuPunishmentIBLL stuPunishmentIBLL = new StuPunishmentBLL();
-
- /// <summary>
- /// 获取学年学期列表
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- private Response GetAcademicAndSemesterList(dynamic _)
- {
- var result = stuPunishmentIBLL.GetAcademicAndSemesterList();
- return Success(result);
- }
-
- /// <summary>
- /// 获取列表
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- private Response GetPunishmentList(dynamic _)
- {
- var param = this.GetReqData<Times>();
-
- var value = param.value;
- if (string.IsNullOrEmpty(value))
- {
- return Fail("时间选择不能为空!");
- }
-
- var academic = value.Split(',')[0];
- var semester = value.Split(',')[1];
-
- var result = stuPunishmentIBLL.GetPunishmentListByStuNo(academic, semester, userInfo.account);
- return Success(result);
-
- }
-
- public class Times
- {
- /// <summary>
- /// 18-19,1
- /// </summary>
- public string value { get; set; }
- }
-
- }
- }
|