This commit is contained in:
MarcEricMartel 2022-09-12 15:21:11 -07:00
parent 166db82ed3
commit e6959a82f2
3 changed files with 20 additions and 13 deletions

View File

@ -9,9 +9,13 @@ namespace GrossesMitaines.Models
{
public class RequestViewModel
{
[Display(Prompt ="NOM COMPLET")]
public string Name { get; set; }
[Display(Prompt = "COURRIEL")]
public string Email { get; set; }
[Display(Prompt = "TÉLÉPHONE")]
public string Phone { get; set; }
[Display(Prompt = "VOS COMMENTAIRES")]
public string Message { get; set; }
}
@ -24,12 +28,12 @@ namespace GrossesMitaines.Models
.MinimumLength(2).WithMessage("Votre nom doit être de 2 lettres minimum");
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Un Email est requis")
.Matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$").WithMessage("Format non valide!");
.NotEmpty().WithMessage("Une adresse courriel est requise")
.EmailAddress().WithMessage("Format non valide!");
RuleFor(x => x.Phone)
.NotEmpty().WithMessage("Vous devez entrer votre téléphone")
.Matches("^[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]$").WithMessage("Téléphone non valide!");
.Matches("^\\s*(?:\\+?(\\d{1}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})$").WithMessage("Téléphone non valide!");
}
}
}

View File

@ -21,37 +21,40 @@
<br>
<br>
<vc:en-vedette></vc:en-vedette>
<br>
<br>
<br>
<br>
<div class="row">
<div class="col-md-12 bg-info">
<section>
<form asp-controller="Home" asp-action="Demande" asp-route-returnurl="/Home/Index" method="post" class="form-horizontal" role="form">
<h4 class="text-center text-white">Demander une renconte!</h4>
<h4 class="text-center text-white">Demander une rencontre!</h4>
<div class="form-group">
<div class="col-md-12">
<label class="text-white">Nom*</label>
<input asp-for="Name" class="form-control" value="NOM COMPLET" />
<input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<label class="text-white">Email*</label>
<input asp-for="Email" class="form-control" value="COURRIEL" />
<input asp-for="Email" class="form-control" />
<span asp-validation-for="Email" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<label class="text-white">Téléphone*</label>
<input asp-for="Phone" class="form-control" value="TÉLÉPHONE EX: 450-111-1111" />
<input asp-for="Phone" class="form-control" />
<span asp-validation-for="Phone" class="text-danger"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<label class="text-white">Message</label>
<input asp-for="Message" class="form-control" value="VOS COMMENTAIRES" rows="3"/>
<input asp-for="Message" class="form-control" rows="3"/>
<span asp-validation-for="Message" class="text-danger"></span>
</div>
</div>

View File

@ -10,7 +10,7 @@
<div class="carousel-item bg-secondary rounded active">
<div class="row text-primary" style="font-family:Arial;">
<div class="col-6 my-auto">
<img class="d-block w-100" src="img/ceintureflechee.jpg" style="width:auto;max-height:200px;">
<img class="d-block w-100" src="~/img/ceintureflechee.jpg" style="width:auto;max-height:200px;">
</div>
<div class="col-6 text-white">
<h3>Ceinture flèchée</h3>
@ -23,7 +23,7 @@
<div class="carousel-item bg-secondary rounded">
<div class="row text-primary" style="font-family:Arial;">
<div class="col-6 my-auto">
<img class="d-block w-100" src="img/pantouflesCH.jpg" style="width:auto;max-height:200px;">
<img class="d-block w-100" src="~/img/pantouflesCH.jpg" style="width:auto;max-height:200px;">
</div>
<div class="col-6 text-white">
<h3>Pantoufles du Canadien en Phentex</h3>
@ -36,7 +36,7 @@
<div class="carousel-item bg-secondary rounded">
<div class="row text-primary" style="font-family:Arial;">
<div class="col-6 my-auto">
<img class="d-block w-100" src="img/jeanlucmongrain.jpg" style="width:auto;max-height:200px;">
<img class="d-block w-100" src="~/img/jeanlucmongrain.jpg" style="width:auto;max-height:200px;">
</div>
<div class="col-6 text-white">
<h3>Jean-Luc Mongrain</h3>