Deleted stuff from validation branch
This commit is contained in:
1 parent
fe72a360ae
commit
9052c11194
4 files changed
+15
-41
No files matched your search
@@ -8,41 +8,17 @@ namespace RobotsWantedLeague.Controllers;
|
|||||||
|
|
||||||
public class RobotRequest
|
public class RobotRequest
|
||||||
{
|
{
|
||||||
// [AllowedCountry(ErrorMessage = "Le pays n'est pas autorisé.")]
|
|
||||||
// public string NewCountry { get; set; }
|
|
||||||
public string Country { get; set; }
|
public string Country { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public int Height { get; set; }
|
public int Height { get; set; }
|
||||||
public int Weight { get; set; }
|
public int Weight { get; set; }
|
||||||
|
|
||||||
// public static readonly List<string> AllowedCountries = new List<string>
|
|
||||||
// {
|
|
||||||
// "Canada",
|
|
||||||
// "United States of America",
|
|
||||||
// "Mexico",
|
|
||||||
|
|
||||||
// };
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public class AllowedCountryAttribute : ValidationAttribute
|
|
||||||
// {
|
|
||||||
// protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
|
||||||
// {
|
|
||||||
// string country = value as string;
|
|
||||||
// if (string.IsNullOrEmpty(country))
|
|
||||||
// {
|
|
||||||
// return ValidationResult.Success;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!CountryConstants.AllowedCountries.Contains(country, StringComparer.OrdinalIgnoreCase))
|
|
||||||
// {
|
|
||||||
// return new ValidationResult(ErrorMessage);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return ValidationResult.Success;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
public class RobotsController : Controller
|
public class RobotsController : Controller
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ public class Robot
|
|||||||
public int Weight { get; set; }
|
public int Weight { get; set; }
|
||||||
public int Height { get; set; }
|
public int Height { get; set; }
|
||||||
public string Country { get; set; }
|
public string Country { get; set; }
|
||||||
// public string NewCountry { get; set; }
|
|
||||||
|
public string NewCountry { get; set; }
|
||||||
public List<string> VisitedCountries { get; set; } = new List<string>();
|
public List<string> VisitedCountries { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +19,6 @@ public class Robot
|
|||||||
this.Weight = Weight;
|
this.Weight = Weight;
|
||||||
this.Height = Height;
|
this.Height = Height;
|
||||||
this.Country = Country;
|
this.Country = Country;
|
||||||
// this.NewCountry = NewCountry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
// public static class CountryConstants
|
|
||||||
// {
|
|
||||||
// public static readonly List<string> AllowedCountries = new List<string>
|
|
||||||
// {
|
|
||||||
// "Canada",
|
|
||||||
// "United States of America",
|
|
||||||
// "Mexico",
|
|
||||||
// // Ajoutez les 7 autres pays autorisés ici
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
@@ -12,6 +12,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@* <div class="container">
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<div class="card mb-3" style="width: 10rem;">
|
||||||
|
<iframe class="card-img-top" src="https://good-hawk-21.deno.dev/ljl"></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> *@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="table table-hover" style="width: 40%; margin-left: auto; margin-right: auto;">
|
<table class="table table-hover" style="width: 40%; margin-left: auto; margin-right: auto;">
|
||||||
|
|
||||||
@@ -66,9 +76,7 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="newCountry">Entrez le nouveau pays :</label>
|
<label for="newCountry">Entrez le nouveau pays :</label>
|
||||||
<input type="text" class="form-control" name="NewCountry" id="newCountry" placeholder="Italie">
|
<input type="text" class="form-control" name="NewCountry" id="newCountry" placeholder="Italie" data-val="true">
|
||||||
@* à mettre dans input du haut : data-val="true"
|
|
||||||
<span asp-validation-for="NewCountry" class="text-danger"></span> *@
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
Reference in new issue
Block a user