using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Util;
using System.Data;
using System.Linq;
using System.Web.Mvc;
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
///
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2023-03-13 10:37
/// 描 述:定制功能助学金
///
public class StuFellowshipController : MvcControllerBase
{
private StuFellowshipIBLL stuFellowshipIBLL = new StuFellowshipBLL();
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
#region 视图功能
///
/// 主页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult Form()
{
var logUser = LoginUserInfo.Get();
var ClassNos = "";
var Classinfo = classInfoIBLL.GetAllClass().Where(x => x.ClassTutorNo == logUser.account).ToList();
if (Classinfo.Any())
{
foreach (var item in Classinfo)
{
ClassNos += item.ClassNo + ",";
}
}
ViewBag.ClassNo = ClassNos.TrimEnd(',');
return View();
}
///
/// 表单页【查看】
///
///
[HttpGet]
public ActionResult FormView()
{
var logUser = LoginUserInfo.Get();
var ClassNos = "";
var Classinfo = classInfoIBLL.GetAllClass().Where(x => x.ClassTutorNo == logUser.account).ToList();
if (Classinfo.Any())
{
foreach (var item in Classinfo)
{
ClassNos += item.ClassNo + ",";
}
}
ViewBag.ClassNo = ClassNos.TrimEnd(',');
return View();
}
///
/// 主页面【二级学院】
///
///
[HttpGet]
public ActionResult IndexOfTwo()
{
return View();
}
///
/// 主页面【学工部】
///
///
[HttpGet]
public ActionResult IndexOfThree()
{
return View();
}
///
/// 主页面【学生】
///
///
[HttpGet]
public ActionResult IndexOfStudent()
{
return View();
}
///
/// 表单页【学生】
///
///
[HttpGet]
public ActionResult FormOfStudent()
{
var logUser = LoginUserInfo.Get();
var stuinfo = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(logUser.account);
ViewBag.StuNo = stuinfo?.StuNo;
ViewBag.StuName = stuinfo?.StuName;
ViewBag.DeptNo = stuinfo?.DeptNo;
ViewBag.ClassNo = stuinfo?.ClassNo;
ViewBag.IdentityCardNo = stuinfo?.IdentityCardNo;
ViewBag.OpenBank = stuinfo?.DepositBank;
ViewBag.OpenAccount = stuinfo?.BankCard;
return View();
}
///
/// 主页面【统计】
///
///
[HttpGet]
public ActionResult StatisticIndex()
{
return View();
}
#endregion
#region 获取数据
///
/// 获取列表数据
///
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetList(string queryJson)
{
var data = stuFellowshipIBLL.GetList(queryJson);
return Success(data);
}
///
/// 获取列表分页数据
///
/// 分页参数
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject();
var data = stuFellowshipIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
///
/// 获取表单数据
///
/// 主键
///
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
//var data = stuFellowshipIBLL.GetEntity(keyValue);
//return Success(data);
var stuFellowshipData = stuFellowshipIBLL.GetEntity(keyValue);
var jsonData = new
{
StuFellowship = stuFellowshipData,
};
return Success(jsonData);
}
///
/// 获取统计列表数据
///
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetStatisticList(string queryJson)
{
var data = stuFellowshipIBLL.GetStatisticList(queryJson);
return Success(data);
}
#endregion
#region 提交数据
///
/// 删除实体数据
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
stuFellowshipIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
///
/// 保存实体数据(新增、修改)
///
/// 主键
/// 实体
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
StuFellowshipEntity entity = strEntity.ToObject();
stuFellowshipIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
///
/// 提交
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult DoSubmit(string keyValue, string status, string step)
{
stuFellowshipIBLL.DoSubmit(keyValue, status, step);
return Success("操作成功!");
}
///
/// 退回
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult DoBack(string keyValue, string status, string step)
{
stuFellowshipIBLL.DoBack(keyValue, status, step);
return Success("操作成功!");
}
#endregion
}
}