}//constructor

        public bool crearPlanta(Entity.Planta planta)
        {
            SqlCommand cmd = new SqlCommand("sp_crearPlanta", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Nombre", planta.nombre);
            connection.Open();
            int i = cmd.ExecuteNonQuery();
            connection.Close();
            if (i >= 1)
                return true;
            else
                return false;
        }//Añadir un planta en el sistema
 public ActionResult RegistrarPlantaView(Entity.Planta planta)
 {
         if (ModelState.IsValid)
         {
             PlantaModel sdb = new PlantaModel();
             if (sdb.crearPlanta(planta))
             {
                 TempData["success"] = "true";
                 return RedirectToAction("RegistrarPlantaView");
             }
             else
             {
                 TempData["error"] = "false";
             }
         }
         return View();
 }//Registrar Planta
        }//obtener todas las plantas del sistemas.

        public bool actualizarPlanta(Entity.Planta planta)
        {
            SqlCommand cmd = new SqlCommand("sp_actualizarPlanta", connection);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@Id", planta.id);
            cmd.Parameters.AddWithValue("@Nombre", planta.nombre);

            connection.Open();
            int i = cmd.ExecuteNonQuery();
            connection.Close();

            if (i >= 1)
                return true;
            else
                return false;
        }//actualizar los datos un planta