redondance des ligne dans la view
bonjour,
mon souci est trés simple ,je crois que c'est juste un truc que j'ai ratté .
voila,
les ligne s'affiche en doublant , chaque ligne s'affiche deux fois dans la VIEW !!
voici mon code
Code:
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 38 39 40 41 42 43 44
|
public ActionResult Index_entre()
{
if (Session["id_entreprise"] != null)
{
int id_entre = Convert.ToInt32(Session["id_entreprise"]);
var l = (from c in entity.postule
from c1 in entity.candidat
from c3 in entity.annonce
from c2 in entity.entreprise
where c.idannonce == c3.idannonce
&&
c.idcandidat == c1.idCandidat
&&
c3.identreprise == id_entre
select new liste_postule
{
id_annonce = c.idannonce,
id_candidat = c.idcandidat,
nom_candidat = c1.nomcandidat,
fonction = c3.fonction,
type_activite = c3.typeactivite,
profilrech = c3.profilrech,
date_annonce = c3.date_annonce,
nom_entre = c2.raisonsociale,
etat = c.etat
});
return View(l.ToList());
}
else {
return RedirectToAction("erreur", "Home");
}
} |
par contre avec ce code il n'y a pas de redondance (enfin c'est l'admin qui peut tout voir ) :
Code:
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
|
public ActionResult Index()
{
var l = (from c in entity.postule
from c1 in entity.candidat
from c3 in entity.annonce
from c2 in entity.entreprise
where
c.idannonce == c3.idannonce
&&
c.idcandidat == c1.idCandidat
&&
c3.identreprise==c2.Identreprise
select new liste_postule
{
id_annonce=c.idannonce,
id_candidat=c.idcandidat,
nom_candidat=c1.nomcandidat,
fonction=c3.fonction,
type_activite=c3.typeactivite,
profilrech=c3.profilrech,
date_annonce=c3.date_annonce,
nom_entre=c2.raisonsociale,
etat=c.etat
});
return View(l.ToList());
} |
merci