using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.LR_Desktop;
using System.Web.Mvc;
using System.Collections.Generic;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.Base.AuthorizeModule;
using Learun.Application.Organization;
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
{
///
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2023-03-06 12:21
/// 描 述:心理咨询回复
///
public class PsychologyReplyInfoController : MvcControllerBase
{
private PsychologyReplyInfoIBLL psychologyReplyInfoIBLL = new PsychologyReplyInfoBLL();
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
private UserRelationIBLL userRelationIBLL = new UserRelationBLL();
private UserIBLL userIBLL = new UserBLL();
#region 视图功能
///
/// 主页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult Form()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult FormSix()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult FormFive()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult FormFiveView()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult FormView()
{
return View();
}
///
/// 分院心理辅导站负责人列表
///
///
[HttpGet]
public ActionResult Index3()
{
return View();
}
///
/// 学工处心理老师
///
///
[HttpGet]
public ActionResult Index4()
{
return View();
}
///
/// 心理总站负责人
///
///
[HttpGet]
public ActionResult IndexFive()
{
return View();
}
///
/// 指派教师审核
///
///
[HttpGet]
public ActionResult IndexSix()
{
return View();
}
///
///
///
///
[HttpGet]
public ActionResult IndexGather()
{
return View();
}
///
/// 汇总表
///
///
[HttpGet]
public ActionResult FormGatherView()
{
return View();
}
///
/// 回复列表
///
///
[HttpGet]
public ActionResult IndexReply()
{
return View();
}
#endregion
#region 获取数据
///
/// 根据角色id获取成员
///
/// 用户主键
///
[HttpGet]
[AjaxOnly]
public ActionResult GetUserIdLists(string objectId)
{
var data = userRelationIBLL.GetUserIdList(objectId);
string userIds = "";
foreach (var item in data)
{
if (userIds != "")
{
userIds += ",";
}
userIds += item.F_UserId;
}
var userList = userIBLL.GetListByUserIds(userIds);
return JsonResult(userList);
}
///
/// 获取页面显示列表数据
///
/// 分页参数
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson, int type = 2)
{
Pagination paginationobj = pagination.ToObject();
var data = psychologyReplyInfoIBLL.GetPageList(paginationobj, queryJson, type);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
///
/// 获取页面显示列表数据
///
/// 分页参数
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList2(string pagination, string queryJson, int type)
{
Pagination paginationobj = pagination.ToObject();
var data = psychologyReplyInfoIBLL.GetPageList2(paginationobj, queryJson, type);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
///
/// 获取页面显示列表数据
///
/// 分页参数
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageListForReply(string pagination, string queryJson, int type)
{
Pagination paginationobj = pagination.ToObject();
var data = psychologyReplyInfoIBLL.GetPageListForReply(paginationobj, queryJson, type);
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 PsychologyReplyInfoData = psychologyReplyInfoIBLL.GetPsychologyReplyInfoEntity(keyValue);
var StuInfoBasicData = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(PsychologyReplyInfoData.StuNo);
var jsonData = new
{
PsychologyReplyInfo = PsychologyReplyInfoData,
StuInfoBasic = StuInfoBasicData,
};
return Success(jsonData);
}
///
/// 获取表单数据
///
/// 主键
///
[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataByPsychologyInfoId(string PsychologyInfoId, int type = 2)
{
var PsychologyReplyInfoData = psychologyReplyInfoIBLL.GetEntityByPsychologyInfoId(PsychologyInfoId, type);
var StuInfoBasicData = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(PsychologyReplyInfoData.StuNo);
var jsonData = new
{
PsychologyReplyInfo = PsychologyReplyInfoData,
StuInfoBasic = StuInfoBasicData,
};
return Success(jsonData);
}
#endregion
#region 提交数据
///
/// 删除实体数据
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
psychologyReplyInfoIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
///
/// 班级辅导员审核
///
/// 主键
/// 实体
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
PsychologyReplyInfoEntity entity = strEntity.ToObject();
psychologyReplyInfoIBLL.SaveEntity(keyValue, entity);
if (string.IsNullOrEmpty(keyValue))
{
}
return Success("保存成功!");
}
#endregion
}
}