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
|
||||
{
|
||||
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
|
||||
@@ -161,30 +161,31 @@ public partial class CritterPage : Page
|
||||
}
|
||||
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
|
||||
if (FatherPicker.SelectedItem is int fatherId)
|
||||
{
|
||||
_critter.FatherId = fatherId;
|
||||
}
|
||||
else
|
||||
{
|
||||
errString += "FatherId is null or invalid somehow. Please report this to the developer\n";
|
||||
}
|
||||
// Dont need to validate these yet, as they are not required
|
||||
// // Father ID validation
|
||||
// if (FatherPicker.SelectedItem is int fatherId)
|
||||
// {
|
||||
// _critter.FatherId = fatherId;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// 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
|
||||
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);
|
||||
return errString != "" ? (false, errString) : (true, "No errors");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -93,6 +93,7 @@ public partial class HomePage : Page
|
||||
var result = await DatabaseService.AddCritter(newCritter);
|
||||
AddProfileButton(newCritter);
|
||||
Logger.LogToFile("New critter was added");
|
||||
ProfileButtonClicked(newCritter);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user