Esempio n. 1
0
 public static GoalModel Fetch(int userId)
 {
     DataClassesDataContext db = new DataClassesDataContext();
     user t;
     var query = (from g in db.users
                  where g.user_id == userId
                  select g);
     if (query.ToList().Count == 0)
     {
         t = new user();
         t.user_id = userId;
         DatabaseHelper.Insert<user>(t);
         db.SubmitChanges();
     }
     else
     {
         t = query.First();
     }
     GoalModel goal = new GoalModel(t);
     return goal;
 }
Esempio n. 2
0
 private GoalModel(user g)
 {
     this.data = g;
 }
Esempio n. 3
0
 partial void Updateuser(user instance);
Esempio n. 4
0
 partial void Deleteuser(user instance);
Esempio n. 5
0
 partial void Insertuser(user instance);