Beispiel #1
0
 public void UpdateUser(string userId, string password)
 {
     using (var context = new MyappEntities())
     {
         var user = context.TBL_USERS.Single(x => x.user_id == userId);
         user.password = password;
         context.SaveChanges();
     }
 }
Beispiel #2
0
 public void DeleteUser(string userId)
 {
     using (var context = new MyappEntities())
     {
         var user = context.TBL_USERS.Single(x => x.user_id == userId);
         context.TBL_USERS.Remove(user);
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public void AddUser(string userId, string password)
 {
     using (var context = new MyappEntities())
     {
         context.TBL_USERS.Add(new TBL_USERS()
         {
             user_id  = userId,
             password = password
         });
         context.SaveChanges();
     }
 }