Ejemplo n.º 1
0
 public static bool CreatUser(User user)
 {
     using (PetaPoco.Database db = new PetaPoco.Database("sqlconnection"))
     {
         user.Password = XBBS.Core.Utils.MD5(user.Password);
         return db.Insert(user) != null;
     }
 }
Ejemplo n.º 2
0
 public static User GetUser(int uid)
 {
     User user = null;
     using (PetaPoco.Database db = new PetaPoco.Database("sqlconnection"))
     {
         user = db.SingleOrDefault<Models.User>("WHERE uid=@0 ", uid);
     }
     if (user == null)
         user = new User();
     return user;
 }