后台隐藏添加参数然后显示
public class ChanPinController : ApiController
{
Dal dal = new Dal();
{
Dal dal = new Dal();
//产品表的获取
[HttpGet]
[Route("api/ChanPin")]
public List<ChanPinModel> GetChanPin()
{
[HttpGet]
[Route("api/ChanPin")]
public List<ChanPinModel> GetChanPin()
{
return dal.GetChanPin();
}
//-------------------------------------------------------------------
////获取收藏商品参数
}
//-------------------------------------------------------------------
////获取收藏商品参数
[HttpGet]
[Route("api/GetId")]
public int ADD(int id)
{
[Route("api/GetId")]
public int ADD(int id)
{
return dal.ADD(id);
}
/// <summary>
///显示收藏商品方法
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
///
[HttpGet]
[Route("api/AddShow")]
public List<ChanPinModel> GetAddShow()
{
return dal.GetAddShow();
}
//----------------------------------------------
[Route("api/AddShow")]
public List<ChanPinModel> GetAddShow()
{
return dal.GetAddShow();
}
//----------------------------------------------
//获取收藏店铺参数
//
[HttpGet]
[Route("api/ADDdp")]
public int ADDdp(int id)
{
return dal.ADDdp(id);
[HttpGet]
[Route("api/ADDdp")]
public int ADDdp(int id)
{
return dal.ADDdp(id);
}
//显示我收藏的店铺
[HttpGet]
[Route("api/DPshow")]
public List<ChanPinModel> DPshow()
{
return dal.DPshow();
}
//显示我收藏的店铺
[HttpGet]
[Route("api/SeDianPu")]
public List<ChanPinModel> SelectDianPu(int id)
{
return dal.SelectDianPu(id);
}
-----------------------------------------------------------------
[HttpGet]
[Route("api/SeDianPu")]
public List<ChanPinModel> SelectDianPu(int id)
{
return dal.SelectDianPu(id);
}
-----------------------------------------------------------------
//获取产品表
public List<ChanPinModel> GetChanPin()
{
string sql = "select * from DPtb d join ExamDay e on d.DPid=e.dpwj ";
return LogHelper.GetShows<ChanPinModel>(sql);
}
//获取收藏商品参数
public int ADD(int id)
{
string sql = $"insert into SPTJTB values({id})";
return LogHelper.ExecuteNonQuery(sql);
public List<ChanPinModel> GetChanPin()
{
string sql = "select * from DPtb d join ExamDay e on d.DPid=e.dpwj ";
return LogHelper.GetShows<ChanPinModel>(sql);
}
//获取收藏商品参数
public int ADD(int id)
{
string sql = $"insert into SPTJTB values({id})";
return LogHelper.ExecuteNonQuery(sql);
}
//显示收藏商品
public List<ChanPinModel> GetAddShow()
{
string sql = "select * from ExamDay join SPTJTB on ExamDay.id=SPTJTB.WJid";
return LogHelper.GetShows<ChanPinModel>(sql);
}
//获取收藏店铺参数
//
public int ADDdp(int id)
{
string sql = $"insert into DPTJTB values({id})";
return LogHelper.ExecuteNonQuery(sql);
}
//显示我收藏的店铺
public List<ChanPinModel> DPshow()
{
string sql = "select * from DPTJTB d join ExamDay e on d.scdpwj=e.dpwj";
return LogHelper.GetShows<ChanPinModel>(sql);
}
//显示我收藏的店铺
public List<ChanPinModel> SelectDianPu(int id)
{
string sql = $"select * from DPtb d join ExamDay e on d.DPid = e.dpwj where d.DPid = {id} ";
return LogHelper.GetShows<ChanPinModel>(sql);
}
public List<ChanPinModel> SelectDianPu(int id)
{
string sql = $"select * from DPtb d join ExamDay e on d.DPid = e.dpwj where d.DPid = {id} ";
return LogHelper.GetShows<ChanPinModel>(sql);
}