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

真-API控制器AJAS

上一篇:大数据之Hbase的API操作


下一篇:Exchange Server 2010 LAB Part7.邮箱数据库可用性组DAG