Esempio n. 1
0
        public static void Save(PlanLM lm)
        {
            PlanDB db = PlanDB.ToDB(lm);

            db.Save();

            lm.AutoID = db.AutoID;
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public static PlanLM GetByID(string id)
 {
     return(PlanDB.ToLM(Database.Table <PlanDB>().Where(i => i.ID == id).First()));
 }
Esempio n. 4
0
 public static PlanLM Get(int autoID)
 {
     return(PlanDB.ToLM(Database.Table <PlanDB>().Where(i => i.AutoID == autoID).First()));
 }