Fix on the admin user.

This commit is contained in:
Sébastien André
2021-03-18 15:50:41 +01:00
parent b192bb7192
commit 7caf1d7df2
16 changed files with 80 additions and 37 deletions

View File

@@ -33,17 +33,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.Update(aircraft);
}
public bool Add(Aircraft newAircraft)
public int Add(Aircraft newAircraft)
{
var result = true;
int result;
try
{
_col.Insert(newAircraft);
var tmp = _col.Insert(newAircraft);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -33,17 +33,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.Update(updatedDz);
}
public bool Add(DropZone newDz)
public int Add(DropZone newDz)
{
var result = true;
int result;
try
{
_col.Insert(newDz);
var tmp = _col.Insert(newDz);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -40,17 +40,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.Update(updatedGear);
}
public bool Add(Gear newGear)
public int Add(Gear newGear)
{
var result = true;
int result;
try
{
_col.Insert(newGear);
var tmp = _col.Insert(newGear);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -34,17 +34,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public bool Add(Jump newJump)
public int Add(Jump newJump)
{
var result = true;
int result;
try
{
_col.Insert(newJump);
var tmp = _col.Insert(newJump);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -33,17 +33,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.Update(updatedJumpType);
}
public bool Add(JumpType newJumpType)
public int Add(JumpType newJumpType)
{
var result = true;
int result;
try
{
_col.Insert(newJumpType);
var tmp = _col.Insert(newJumpType);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -40,17 +40,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.Update(image);
}
public bool Add(UserImage newImage)
public int Add(UserImage newImage)
{
var result = true;
int result;
try
{
_col.Insert(newImage);
var tmp = _col.Insert(newImage);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;

View File

@@ -23,17 +23,18 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindOne(u => u.Login == login && u.Password == password);
}
public bool Add(User newUser)
public int Add(User newUser)
{
var result = true;
int result;
try
{
_col.Insert(newUser);
var tmp = _col.Insert(newUser);
result = tmp.AsInt32;
}
catch
{
result = false;
result = 0;
}
return result;