//根据Pid查询众筹 public CrowShow Crowselect(string Pid) { string ordersql = "select * from [CrowdFunding] where ID='{0}'"; CrowShow order = db.Database.SqlQuery <CrowShow>(string.Format(ordersql, Pid)).FirstOrDefault(); return(order); }
//查询众筹 public List <CrowShow> Crowshw() { CrowShow i = new CrowShow(); StringBuilder sql = new StringBuilder("select a.Number,a.ID,a.Pid,a.ShowTime,a.StarTime,a.EndTime,a.isBool,a.ListTille,a.Banner,b.PartName from CrowdFunding a left join Parts b on a.Pid=b.ID where 1=1"); List <CrowShow> orders = db.Database.SqlQuery <CrowShow>(sql.ToString()).ToList(); sql.Append("order by [Time] desc"); return(orders); }