首页 > Windows开发 > 详细

真-API控制器AJAS

时间:2020-06-26 21:05:37      阅读:59      评论:0      收藏:0      [点我收藏+]

GoodBll bll = new GoodBll();

/// <summary>
/// 添加
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public int Add(string o=null)
{
Good model = JsonConvert.DeserializeObject<Good>(o);
return bll.Add(model);
}
/// <summary>
/// 绑定分类
/// </summary>
/// <returns></returns>
[HttpGet]
public List<GoodType> BandType()
{
return bll.BandType();
}
/// <summary>
/// 绑定供应商
/// </summary>
/// <returns></returns>
[HttpGet]
public List<Supplier> BandSupplier()
{
return bll.BandSupplier();
}

/// <summary>
/// 显示,查询
/// </summary>
/// <returns></returns>
[HttpGet]
public List<Good> Show(string GoodName="", int TypeId=0, int SupplierId=0)
{
return bll.Show(GoodName, TypeId, SupplierId);
}

/// <summary>
/// 删除,批量删除
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
public int Delete(string id)
{
return bll.Delete(id);
}

#region 修改
/// <summary>
/// 反填
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
public Good FanTian(int id)
{
return bll.FanTian(id);
}

/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public int Update(string o)
{
Good model = JsonConvert.DeserializeObject<Good>(o);
return bll.Update(model);
}

真-API控制器AJAS

原文:https://www.cnblogs.com/gc1229/p/13196143.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!