真-API控制器AJAS

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);
}

posted @ 2020-06-26 19:51  G蠢蠢  阅读(103)  评论(0编辑  收藏  举报