using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;
using System;
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-08-11 09:51
/// 描 述:新生在线咨询
///
public class StuInfoFreshOnlineServiceController : MvcControllerBase
{
private StuInfoFreshOnlineServiceIBLL stuInfoFreshOnlineServiceIBLL = new StuInfoFreshOnlineServiceBLL();
#region 视图功能
///
/// 主页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult Form()
{
ViewBag.QuestionCode = "ZX_" + CommonHelper.CreateNo();
return View();
}
///
/// 表单查看页
///
///
[HttpGet]
public ActionResult FormView()
{
ViewBag.QuestionCode = "ZX_" + CommonHelper.CreateNo();
return View();
}
///
/// 主页面【新生在线咨询回复】
///
///
[HttpGet]
public ActionResult AnswerIndex()
{
return View();
}
///
/// 表单页【新生在线咨询回复】
///
///
[HttpGet]
public ActionResult AnswerForm()
{
return View();
}
///
/// 表单查看页【新生在线咨询回复】
///
///
[HttpGet]
public ActionResult AnswerFormView()
{
return View();
}
///
/// 常见咨询问题主页面
///
///
[HttpGet]
public ActionResult IndexList()
{
return View();
}
#endregion
#region 获取数据
///
/// 获取页面显示列表数据
///
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject();
var data = stuInfoFreshOnlineServiceIBLL.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 StuInfoFreshOnlineServiceData = stuInfoFreshOnlineServiceIBLL.GetStuInfoFreshOnlineServiceEntity(keyValue);
var jsonData = new
{
StuInfoFreshOnlineService = StuInfoFreshOnlineServiceData,
};
return Success(jsonData);
}
#endregion
#region 提交数据
///
/// 删除实体数据
/// 主键
///
///
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
stuInfoFreshOnlineServiceIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
///
/// 保存实体数据(新增、修改)
/// 主键
///
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
var loginUserInfo = LoginUserInfo.Get();
StuInfoFreshOnlineServiceEntity entity = strEntity.ToObject();
entity.QuestionUserId = loginUserInfo.userId;
entity.QuestionUserName = loginUserInfo.realName;
entity.QuestionCreateTime = DateTime.Now;
entity.QuestionStatus = "0";
entity.AnswerStatus = "0";
stuInfoFreshOnlineServiceIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
#endregion
#region 扩展数据
///
/// 提交咨询问题
/// 主键
///
///
[HttpPost]
[AjaxOnly]
public ActionResult SubmitQuestion(string keyValue)
{
stuInfoFreshOnlineServiceIBLL.SumbitQuestion(keyValue);
return Success("删除成功!");
}
///
/// 保存实体数据(新增、修改)【新生在线咨询回复】
/// 主键
///
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveFormOfAnswer(string keyValue, string strEntity)
{
var loginUserInfo = LoginUserInfo.Get();
StuInfoFreshOnlineServiceEntity entity = strEntity.ToObject();
entity.AnswerUserId = loginUserInfo.userId;
entity.AnswerUserName = loginUserInfo.realName;
entity.AnswerCreateTime = DateTime.Now;
entity.AnswerStatus = "1";
stuInfoFreshOnlineServiceIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
#endregion
}
}