You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
using PetaPoco;
|
|
using System.Web.Mvc;
|
|
|
|
using Pingchuan.BeijingSafeguard.BLL;
|
|
using Pingchuan.BeijingSafeguard.Model;
|
|
|
|
namespace Pingchuan.BeijingSafeguard.App.Controllers
|
|
{
|
|
public class UserManagementController : Controller
|
|
{
|
|
// GET: UserManagement
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Add(User user)
|
|
{
|
|
int id = UserBLL.Add(user);
|
|
return Json(id);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Update(User user)
|
|
{
|
|
int count = UserBLL.Update(user);
|
|
return Json(count);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Delete(int id)
|
|
{
|
|
int count = UserBLL.Delete(id);
|
|
return Json(count);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Query(int orgId, int pageIndex, int pageSize)
|
|
{
|
|
Pagination<User> users = UserBLL.Query(orgId, pageIndex, pageSize);
|
|
return Json(users);
|
|
}
|
|
}
|
|
}
|