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.
44 lines
1.0 KiB
44 lines
1.0 KiB
using PetaPoco;
|
|
using System.Web.Mvc;
|
|
using System.Collections.Generic;
|
|
|
|
using Pingchuan.BeijingSafeguard.BLL;
|
|
using Pingchuan.BeijingSafeguard.Model;
|
|
|
|
namespace Pingchuan.BeijingSafeguard.App.Controllers
|
|
{
|
|
public class PointController : BaseController
|
|
{
|
|
[HttpPost]
|
|
public JsonResult Add(Point point)
|
|
{
|
|
User user = GetLoginUser();
|
|
point.UserId = user.Id;
|
|
|
|
int id = PointBLL.Add(point);
|
|
return Json(id);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Update(Point point)
|
|
{
|
|
int count = PointBLL.Update(point);
|
|
return Json(count);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Delete(int id)
|
|
{
|
|
int count = PointBLL.Delete(id);
|
|
return Json(count);
|
|
}
|
|
|
|
[HttpPost]
|
|
public JsonResult Query()
|
|
{
|
|
User user = GetLoginUser();
|
|
List<Point> points = PointBLL.Query(user.Id);
|
|
return Json(points);
|
|
}
|
|
}
|
|
}
|