Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            FormationService ps = new FormationService();
            Producteur       p  = new Producteur {
                Nom = "test", prenom = "test", DateNaissance = DateTime.Now
            };

            ps.Add(p);
            ps.Commit();
            CandiratService fs = new CandiratService();
            Film            f  = new Film
            {
                Titre       = "film1",
                Description = "Test",
                // DateProd = DateTime.Now,
                DateProd   = new DateTime(2016, 1, 1, 12, 00, 00),
                Price      = 15,
                Genre      = "Action",
                Evaluation = "Super",
                //avec validation
                // Genre = "ok",
                //Evaluation = "suoer",
                ImageUrl     = "image",
                ProducteurId = 1
            };

            fs.Add(f);
            fs.Commit();
        }
Ejemplo n.º 2
0
        public ActionResult Create(Candidat Can, HttpPostedFileBase Image)
        {
            Can.Image = Image.FileName;
            serviceCandidat.Add(Can);
            serviceCandidat.Commit();
            var path = Path.Combine(Server.MapPath("~/Content/Upload/"), Image.FileName);

            Image.SaveAs(path);
            return(RedirectToAction("Index"));
        }