internal void UpdateUser(User User)
 {
     using (DbConnection conn = Connect())
     {
         DbCommand cmd = conn.CreateCommand();
         cmd.CommandText = "UPDATE Users" +
                           " Set" +
                           " description='" + SqlVal.SqlString(User.Description) + "'," +
                           " lastName='" + SqlVal.SqlString(User.LastName) + "'," +
                           " firstName='" + SqlVal.SqlString(User.FirstName) + "'," +
                           " email='" + SqlVal.SqlString(User.Email) + "'," +
                           //" password="******"'," +
                           " lastChange=" + SqlVal.SqlDate(DateTime.Now) + "," +
                           //" lastPasswordChange=" + SqlVal.SqlDate(DateTime.Now) + "," +
                           //" creationTime=" + SqlVal.SqlDate(User.CreationTime)  + "," +
                           " salt='" + SqlVal.SqlString(User.Salt) + "'," +
                           " isEnabled=" + SqlVal.SqlBool(User.IsEnabled) +
                           " idUserCategory=" + SqlVal.SqlInt(User.IdUserCategory) +
                           " WHERE username='******'" +
                           ";";
         cmd.ExecuteNonQuery();
         cmd.Dispose();
     }
 }
Beispiel #2
0
 internal void UpdateUserOverride(string username, string lastname, string firstname, string password, string email, string description, DateTime last, DateTime lastpassw, DateTime creation, string salt, bool isenabled, int idusercateogry)
 {
     using (DbConnection conn = Connect())
     {
         DbCommand cmd = conn.CreateCommand();
         cmd.CommandText = "UPDATE Users" +
                           " Set" +
                           " description='" + SqlVal.SqlString(description) + "'," +
                           " lastName='" + SqlVal.SqlString(lastname) + "'," +
                           " firstName='" + SqlVal.SqlString(firstname) + "'," +
                           " email='" + SqlVal.SqlString(email) + "'," +
                           " password="******"'," +
                           " lastChange=" + SqlVal.SqlDate(last) + "," +
                           " lastPasswordChange=" + SqlVal.SqlDate(lastpassw) + "," +
                           " creationTime=" + SqlVal.SqlDate(creation) + "," +
                           " salt='" + SqlVal.SqlString(salt) + "'," +
                           " isEnabled=" + SqlVal.SqlBool(isenabled) +
                           " idUserCategory=" + SqlVal.SqlInt(idusercateogry) +
                           " WHERE username='******'" +
                           ";";
         cmd.ExecuteNonQuery();
         cmd.Dispose();
     }
 }