// GET: PointOfProspection/Edit/5 public ActionResult Edit(int id) { PointOfProspection cm = new PointOfProspection(); cm = cs.Get(t => t.id == id); PointOfProspectionModel c = new PointOfProspectionModel(); c.id = cm.id; c.nom = cm.nom; c.Adress = cm.Adress; c.Type = cm.Type; return(View(c)); }
// GET: PointOfProspection public ActionResult Index() { List <PointOfProspectionModel> lc = new List <PointOfProspectionModel>(); foreach (var cm in cs.GetAll()) { PointOfProspectionModel c = new PointOfProspectionModel(); c.id = cm.id; c.nom = cm.nom; c.Adress = cm.Adress; c.Type = cm.Type; lc.Add(c); } return(View(lc)); }
public ActionResult Edit(int id, PointOfProspectionModel cm) { PointOfProspection c = new PointOfProspection(); c = cs.Get(t => t.id == id); c.id = cm.id; c.Adress = cm.Adress; c.nom = cm.nom; c.Type = cm.Type; cs.Update(c); cs.Commit(); return(RedirectToAction("Index")); }
public ActionResult Create(PointOfProspectionModel cm) { PointOfProspection c = new PointOfProspection(); c.id = cm.id; c.Adress = cm.Adress; c.nom = cm.nom; c.Type = cm.Type; cs.Add(c); cs.Commit(); return(View("Index", "~/Views/Shared/_CustomerLayout.cshtml")); }