public static PlanLM[] Search(int pageIndex, int pageSize, string author, bool isAuth) { var temp = Database.Table <PlanDB>().Where(m => m.DeleteFlag == 0).OrderByDescending(i => i.CreateTime).OrderByDescending(m => m.ReferenceCount).Skip(pageIndex * pageSize).Take(pageSize); if (!string.IsNullOrEmpty(author)) { temp = temp.Where(m => m.Author == author); } else { if (isAuth) { temp = temp.Where(m => m.AuthFlag == 1); } else { temp = temp.Where(m => m.AuthFlag == 0 && m.PlanType == 0); } } return(temp.ToArray().Select(i => PlanDB.ToLM(i)).ToArray()); }
public static PlanLM GetByID(string id) { return(PlanDB.ToLM(Database.Table <PlanDB>().Where(i => i.ID == id).First())); }
public static PlanLM Get(int autoID) { return(PlanDB.ToLM(Database.Table <PlanDB>().Where(i => i.AutoID == autoID).First())); }