39 lines
867 B
C#
39 lines
867 B
C#
using InnovEnergy.App.Backend.DataTypes;
|
|
|
|
namespace InnovEnergy.App.Backend.Database;
|
|
|
|
|
|
public static partial class Db
|
|
{
|
|
private static Boolean Update(Object obj)
|
|
{
|
|
var success = Connection.Update(obj) > 0;
|
|
if(success) BackupDatabase();
|
|
return success;
|
|
}
|
|
|
|
public static Boolean Update(Folder folder)
|
|
{
|
|
return Update(obj: folder);
|
|
}
|
|
|
|
public static Boolean Update(Installation installation)
|
|
{
|
|
return Update(obj: installation);
|
|
}
|
|
|
|
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 Update(obj: user);
|
|
}
|
|
|
|
|
|
|
|
} |