1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Search(string arrive, string depart, string codeVille, int rate)
{
if (arrive != null && depart != null && codeVille != null && rate != null)
{
string format = "d/M/yyyy";
var provider = new CultureInfo("fr-FR");
var dateArrive = DateTime.ParseExact(arrive, format, provider);
var dateDepart = DateTime.ParseExact(arrive, format, provider);
var resultat = from lProduit in _ctx.ListeProduits
where lProduit.CodeVille == codeVille && lProduit.Cote == rate &&
lProduit.DateHeureVente_Local >= dateArrive &&
lProduit.DateHeureVenteFin_Local <= dateDepart
select new
{
lProduit.Salle.NomSalle,
lProduit.NomVille,
lProduit.Cote,
lProduit.GammePrixMin,
lProduit.GammePrixMax,
lProduit.Salle.Adresse,
lProduit.Salle.DescSalleLang,
};
ViewData["resultat"] = resultat;
if (resultat.Count() != 0)
{
//return RedirectToAction("Resultat");
return View("Resultat", resultat);
}
}
return PartialView("AucunResultat");
} |
Partager