コード例 #1
0
        // 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));
        }
コード例 #2
0
        // 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));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
        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"));
        }