using System.Data;
using Microsoft.AspNetCore.Mvc;using WMS.BZWeb;
using WMS.Info;
using WMS.Util;
using WMS.Core;
namespace WMS.BZWeb
{
///
/// 描 述:用户组
///
[Area("ACLManager")]
public class UserGrpController : MvcControllerBase
{
ACLUserGrp bll = new ACLUserGrp();
///
/// 主页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页
///
///
[HttpGet]
public ActionResult Form()
{
return View();
}
///
/// 获取列表数据
///
///
[HttpGet]
////[AjaxOnly]
public ActionResult GetList(string keyword)
{
var data = bll.GetList(keyword);
return Success("", data);
}
[HttpGet]
////[AjaxOnly]
public ActionResult GetListForDeptNo(string DeptNo)
{
var data = bll.GetList(DeptNo);
return Success("", data);
}
///
/// 获取分页数据
///
/// 分页参数
/// 查询关键字
///
[HttpGet]
////[AjaxOnly]
public ActionResult GetPageList(string pagination, string keyword)
{
Pagination paginationobj = InitPagination(pagination);
return ToPageDataResult(paginationobj, bll.GetPageList(keyword, paginationobj));
}
///
/// 获取表单数据
/// 主键
///
///
[HttpGet]
////[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var data = bll.GetEntity(keyValue);
return Success("", data);
}
///
/// 删除实体数据
/// 主键
///
///
[HttpPost]
////[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
bll.DeleteEntity(keyValue);
return Success("删除成功。");
}
///
/// 保存实体数据(新增、修改)
/// 主键
///
///
[HttpPost]
[ValidateAntiForgeryToken]
////[AjaxOnly]
public ActionResult SaveForm(string keyValue, ACL_USERGRP entity)
{
LoginUserInfo LoginUser = LoginBLLCore.GetLoginUser();
bll.SaveEntity(LoginUser, keyValue, entity);
return Success("保存成功!");
}
///
/// 获取映射数据
///
///
[HttpGet]
////[AjaxOnly]
public ActionResult GetMap(string ver)
{
var data = bll.GetMap();
string md5 = SecurityUtil.MD5(data.ToJson(), 32);
if (md5 == ver)
{
return Success("no update");
}
else
{
var jsondata = new
{
data = data,
ver = md5
};
return Success("", jsondata);
}
}
}
}