Ejemplo n.º 1
0
        //[Authorize]
        public ActionResult NewProductRegistration(NieuweProductRegistratiePM nprpm)
        {
            nprpm.Klanten = new SelectList(ks.GetKlanten(), "ID", "Naam");

            Productregistratie pr = new Productregistratie();

            pr            = nprpm.Productregistratie;
            pr.Winkelmand = new Winkelmand();
            pr.Winkelmand.DatumTijdstip = DateTime.Now;
            pr.Winkelmand.Klant         = ks.GetKlantByID(nprpm.KlantID);
            pr.Product = ps.GetProductByID(nprpm.Product.ID);

            ps.InsertProductregistration(pr);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        //[Authorize]
        public ActionResult NewProductRegistration(int?id)
        {
            if (id.HasValue)
            {
                NieuweProductRegistratiePM pm = new NieuweProductRegistratiePM();

                var values = ks.GetKlanten().Select(u => new { ID = u.ID, Naam = u.Naam + " " + u.Voornaam });

                pm.Product            = ps.GetProductByID(id.Value);
                pm.Klanten            = new SelectList(values, "ID", "Naam");
                pm.Productregistratie = new Productregistratie();
                pm.Winkelmand         = new Winkelmand();
                return(View(pm));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult NewProductRegistration(NieuweProductRegistratiePM nprpm)
        {
            nprpm.Klanten = new SelectList(ks.GetKlanten(), "ID", "Naam");

            Productregistratie pr = new Productregistratie();
            pr = nprpm.Productregistratie;
            pr.Winkelmand = new Winkelmand();
            pr.Winkelmand.DatumTijdstip = DateTime.Now;
            pr.Winkelmand.Klant = ks.GetKlantByID(nprpm.KlantID);
            pr.Product = ps.GetProductByID(nprpm.Product.ID);

            ps.InsertProductregistration(pr);
            return RedirectToAction("Index");
        }
        public ActionResult NewProductRegistration(int? id)
        {
            if (id.HasValue)
            {
                NieuweProductRegistratiePM pm = new NieuweProductRegistratiePM();

                var values = ks.GetKlanten().Select(u => new { ID = u.ID, Naam = u.Naam + " " + u.Voornaam });

                pm.Product = ps.GetProductByID(id.Value);
                pm.Klanten = new SelectList(values, "ID", "Naam");
                pm.Productregistratie = new Productregistratie();
                pm.Winkelmand = new Winkelmand();
                return View(pm);
            }
            else
            {
                return RedirectToAction("Index");
            }
        }