Innovenergy_trunk/csharp/App/Backend/Database/Update.cs

32 lines
722 B
C#

using InnovEnergy.App.Backend.DataTypes;
namespace InnovEnergy.App.Backend.Database;
public static partial class Db
{
public static Boolean Update(Folder folder)
{
return Connection.Update(folder) > 0;
}
public static Boolean Update(Installation installation)
{
return Connection.Update(installation) > 0;
}
public static Boolean Update(User user)
{
var originalUser = GetUserById(user.Id);
if (originalUser is null) return false;
// these columns must not be modified!
user.ParentId = originalUser.ParentId;
user.Name = originalUser.Name;
return Connection.Update(user) > 0;
}
}