using Lottomat.Application.Entity.SystemManage;
using Lottomat.Application.Busines.SystemManage;
using Lottomat.Util;
using Lottomat.Util.WebControl;
using System.Web.Mvc;
namespace Lottomat.Application.Admin.Areas.SystemManage.Controllers
{
///
/// 版 本 1.0
/// Copyright (c) 2016-2017
/// 创 建:超级管理员
/// 日 期:2017-12-18 10:55
/// 描 述:意见反馈
///
public class FeedbackController : MvcControllerBase
{
private FeedbackBLL feedbackbll = new FeedbackBLL();
#region 视图功能
///
/// 列表页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页面
///
///
[HttpGet]
public ActionResult Form()
{
return View();
}
#endregion
#region 获取数据
///
/// 获取列表
///
/// 分页参数
/// 查询参数
/// 返回分页列表Json
[HttpGet]
public ActionResult GetPageListJson(Pagination pagination, string queryJson)
{
var watch = CommonHelper.TimerStart();
var data = feedbackbll.GetPageList(pagination, queryJson);
var jsonData = new
{
rows = data,
total = pagination.total,
page = pagination.page,
records = pagination.records,
costtime = CommonHelper.TimerEnd(watch)
};
return ToJsonResult(jsonData);
}
///
/// 获取列表
///
/// 查询参数
/// 返回列表Json
[HttpGet]
public ActionResult GetListJson(string queryJson)
{
var data = feedbackbll.GetList(queryJson);
return ToJsonResult(data);
}
///
/// 获取实体
///
/// 主键值
/// 返回对象Json
[HttpGet]
public ActionResult GetFormJson(string keyValue)
{
var data = feedbackbll.GetEntity(keyValue);
return ToJsonResult(data);
}
#endregion
#region 提交数据
///
/// 删除数据
///
/// 主键值
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult RemoveForm(string keyValue)
{
FeedbackEntity entity = new FeedbackEntity
{
IsDelete = true
};
feedbackbll.SaveForm(keyValue, entity, "0");
return Success("删除成功。");
}
///
/// 保存表单(新增、修改)
///
/// 主键值
/// 实体对象
///
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, FeedbackEntity entity, string which = "0")
{
feedbackbll.SaveForm(keyValue, entity, which);
return Success("操作成功。");
}
#endregion
}
}