62,046
社区成员
发帖
与我相关
我的任务
分享
public partial class Cooperation
{
public int CooperationsID { get; set; }
public string CooperationsName { get; set; }
public string Desc { get; set; }
public string Address { get; set; }
public string Phone { get; set; }
public string ContactName { get; set; }
public int OperatorID { get; set; }
public bool IsValid { get; set; }
public string CooperationType { get; set; }
public string FaceImgPath { get; set; }
public virtual User User { get; set; }
}
public class CooperationModel
{
public PagedList<Cooperation> JoinedModel { get; set; }
public PagedList<Cooperation> BranchModel { get; set; }
}
public ActionResult Cooperation(int id = 1 , int pageIndex = 1)
{
using (var db = new FaJiErDBEntities())
{
int pageSize = 10;
var model = new CooperationModel();
//--------------------------------------------------------------------------------------------------------------------------------
//这里两个数据源提示“无法将类型“Webdiyer.WebControls.Mvc.PagedList<ORM.Cooperation>”隐式转换为“Webdiyer.WebControls.Mvc.PagedList`1<ORM.Cooperation>“
model.JoinedModel = db.Cooperations.Where(o => o.CooperationType.Equals("Joined")).OrderByDescending(p => p.CooperationsID).ToPagedList(id, pageSize);
model.BranchModel = db.Cooperations.Where(o => o.CooperationType.Equals("Branch")).OrderByDescending(p => p.CooperationsID).ToPagedList(pageIndex, pageSize);
//------------------------------------------------------------------------------------------------------------------------------------------
return View(model);
}
}