Commented out validation for MotherID and FatherID for now, as tey arent actually required
This commit is contained in:
@@ -151,7 +151,7 @@ public partial class CritterPage : Page
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errString += "Invalid gender somehow. Please report this to the developer\n";
|
errString += "Gender is invalid somehow. Please report this to the developer\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Birthday validation
|
// Birthday validation
|
||||||
@@ -161,30 +161,31 @@ public partial class CritterPage : Page
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
errString += "Birthday is null somehow. Please report this to the developer\n";
|
errString += "Birthday is invalid somehow. Please report this to the developer\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Father ID validation
|
// Dont need to validate these yet, as they are not required
|
||||||
if (FatherPicker.SelectedItem is int fatherId)
|
// // Father ID validation
|
||||||
{
|
// if (FatherPicker.SelectedItem is int fatherId)
|
||||||
_critter.FatherId = fatherId;
|
// {
|
||||||
}
|
// _critter.FatherId = fatherId;
|
||||||
else
|
// }
|
||||||
{
|
// else
|
||||||
errString += "FatherId is null or invalid somehow. Please report this to the developer\n";
|
// {
|
||||||
}
|
// errString += "FatherId is null or invalid somehow. Please report this to the developer\n";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Mother ID validation
|
||||||
|
// if (MotherPicker.SelectedItem is int motherId)
|
||||||
|
// {
|
||||||
|
// _critter.MotherId = motherId;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// errString += "MotherId is null or invalid somehow. Please report this to the developer\n";
|
||||||
|
// }
|
||||||
|
|
||||||
// Mother ID validation
|
return errString != "" ? (false, errString) : (true, "No errors");
|
||||||
if (MotherPicker.SelectedItem is int motherId)
|
|
||||||
{
|
|
||||||
_critter.MotherId = motherId;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errString += "MotherId is null or invalid somehow. Please report this to the developer\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
return errString != "" ? (false, errString) : (true, errString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,7 @@ public partial class HomePage : Page
|
|||||||
var result = await DatabaseService.AddCritter(newCritter);
|
var result = await DatabaseService.AddCritter(newCritter);
|
||||||
AddProfileButton(newCritter);
|
AddProfileButton(newCritter);
|
||||||
Logger.LogToFile("New critter was added");
|
Logger.LogToFile("New critter was added");
|
||||||
|
ProfileButtonClicked(newCritter);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user