Exemplo n.º 1
0
        //Editar Registros
        public ActionResult EditJardin(String nombre1, String nombre2, String dir, String tel, int id)
        {
            jardin ja = db.jardin.FirstOrDefault(x => x.Id_Jardin == id);

            ja.NomEnc    = nombre1;
            ja.NomJar    = nombre2;
            ja.Direccion = dir;
            ja.Telefono  = tel;

            db.SaveChanges();

            ViewBag.result = "Record Inserted Successfully!";
            return(RedirectToAction("Indice", "Home"));
        }
Exemplo n.º 2
0
        public ActionResult altaJardin(String nombre1, String nombre2, String dir, String tel)
        {
            jardin jar = new jardin();

            jar.NomEnc    = nombre1;
            jar.NomJar    = nombre2;
            jar.Direccion = dir;
            jar.Telefono  = tel;

            db.jardin.Add(jar);
            db.SaveChanges();
            ViewBag.result = "Record Inserted Successfully!";

            return(RedirectToAction("Indice", "Home"));
        }