Пример #1
0
 public bool UpdateUser(User user)
 {
     DbCommand cmd = db.CreateCommand(UPDATE_CMD);
     db.DefineParameter(cmd, "@id", System.Data.DbType.UInt32, user.Id);
     db.DefineParameter(cmd, "@first", System.Data.DbType.String, user.FirstName);
     db.DefineParameter(cmd, "@last", System.Data.DbType.String, user.LastName);
     db.DefineParameter(cmd, "@email", System.Data.DbType.String, user.EmailAddress);
     db.DefineParameter(cmd, "@password", System.Data.DbType.String, user.Password);
     return db.ExecuteNonQuery(cmd) >= 1;
 }
Пример #2
0
 public bool DeleteUser(User user)
 {
     DbCommand cmd = db.CreateCommand(DELETE_CMD);
     db.DefineParameter(cmd, "@id", System.Data.DbType.UInt32, user.Id);
     return cmd.ExecuteNonQuery() >= 1;
 }