Académique Documents
Professionnel Documents
Culture Documents
Create Web
Create Web
Temchi taayet lel les interfacesService mteaaik ili hachtekk behom exemple :
IOffreService offreService;
IEntrepriseService entrepriseService;
Etape 2 :
Tamel Constructeur : ekteb cotr ( double tabulation yjik fonction )
public OffreController(IOffreService o, IEntrepriseService entrepriseService)
{
this.offreService = o;
this.entrepriseService = entrepriseService;
}
Etape 3
Ken aandek ajout roulant maneha haja haka :
// GET: *****Controller/Create
return View();
}
Tafsiiiiiiiiiiiiiir :
EntrepriseFK : temchi lel entité offre o declarer thot
[ForeignKey("Entreprise")]
// POST: OffreController1/Create
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(Offre o)
{
OffreService.Add(o);
OffreService.Commit();
return RedirectToAction(nameof(Index));
Etape 5
Creation vue :
Etape 6
Fi ficher ili taamal taht view f west esm entité ili amltha create.cshtml
Thabetttt lenaaa :
Kima declarineha f
Nfsha win aamalna
entité etape 3
ajout roulant f get
create
Etape 7
Click droite o jareeeeb baed mtamel l’ajout chiuf f base o dima réfrechi