public List <clsIntegranteGrupo> ListarIntegrantesGrupo()
        {
            MySqlConnection con = new MySqlConnection(cadenaConexion);
            MySqlCommand    cmd = new MySqlCommand("select * from tbl_IntegranteGrupo", con);

            List <clsIntegranteGrupo> listaintegrantes = new List <clsIntegranteGrupo>();

            con.Open();
            MySqlDataReader lector = cmd.ExecuteReader();

            while (lector.Read())
            {
                clsIntegranteGrupo integrante = new clsIntegranteGrupo();

                integrante.Idintegrantegrupo     = lector.GetInt32(0);
                integrante.Nombreintegrantegrupo = lector.GetString(1);

                integrante.Idtipointegrante = lector.GetInt32(2);

                listaintegrantes.Add(integrante);
            }

            con.Close();

            return(listaintegrantes);
        }
        public bool IngresarTipoIntegrante(clsIntegranteGrupo tipointegrante)
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

            builder.Server   = "localhost";
            builder.Port     = 3306;
            builder.UserID   = "root";
            builder.Password = "******";
            builder.SslMode  = MySqlSslMode.None;
            builder.Database = "dbcoordinacion";

            MySqlConnection con = new MySqlConnection(builder.ToString());

            MySqlCommand cmd = new MySqlCommand("insert into tbl_TipoIntegranteGrupo(cargo_tipointegrante,descripcion_tipointegrante)" +
                                                "values(@cargotipointegrante,@descripciontipointegrante)", con);

            cmd.Parameters.Add("@cargotipointegrante", MySqlDbType.VarChar).Value       = tipointegrante.Cargotipointegrante;
            cmd.Parameters.Add("@descripciontipointegrante", MySqlDbType.VarChar).Value = tipointegrante.Descripciontipointegrante;


            con.Open();

            int exito = cmd.ExecuteNonQuery();

            if (exito == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool IngresarIntegranteGrupo(clsIntegranteGrupo integrante)
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

            builder.Server   = "localhost";
            builder.Port     = 3306;
            builder.UserID   = "root";
            builder.Password = "******";
            builder.SslMode  = MySqlSslMode.None;
            builder.Database = "dbcoordinacion";

            MySqlConnection con = new MySqlConnection(builder.ToString());

            MySqlCommand cmd = new MySqlCommand("insert into tbl_IntegranteGrupo(tbl_TipoIntegranteGrupo_id,nombre_integrantegrupo,empresa_integrantegrupo)" +
                                                "values(@tipointegrante,@nombreintegrante,@empresaintegrante)", con);


            cmd.Parameters.Add("@tipointegrante", MySqlDbType.Int32).Value      = integrante.Idtipointegrante;
            cmd.Parameters.Add("@nombreintegrante", MySqlDbType.VarChar).Value  = integrante.Nombreintegrantegrupo;
            cmd.Parameters.Add("@empresaintegrante", MySqlDbType.VarChar).Value = integrante.Empresaintegrantegrupo;


            con.Open();

            int exito = cmd.ExecuteNonQuery();

            if (exito == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public List <clsDetalleGrupoTrabajo> ListarGruposTrabajo(string nombregrupo)
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

            builder.Server   = "localhost";
            builder.Port     = 3306;
            builder.UserID   = "root";
            builder.Password = "******";
            builder.SslMode  = MySqlSslMode.None;
            builder.Database = "dbcoordinacion";

            MySqlConnection con = new MySqlConnection(builder.ToString());

            MySqlCommand cmd = new MySqlCommand("SELECT nombre_grupotrabajo,numero_grupotrabajo,nombre_integrantegrupo,cargo_tipointegrante FROM tbl_DetalleGrupoTrabajo LEFT JOIN tbl_IntegranteGrupo ON tbl_DetalleGrupoTrabajo.tbl_IntegranteGrupo_id = tbl_IntegranteGrupo.idtbl_IntegranteGrupo LEFT JOIN tbl_TipoIntegranteGrupo ON tbl_IntegranteGrupo.tbl_TipoIntegranteGrupo_id = tbl_TipoIntegranteGrupo.idtbl_TipoIntegranteGrupo AND tbl_DetalleGrupoTrabajo.tbl_TipoIntegranteGrupo_id = tbl_TipoIntegranteGrupo.idtbl_TipoIntegranteGrupo AND nombre_grupotrabajo =" + nombregrupo, con);

            List <clsDetalleGrupoTrabajo> listagrupotrabajo = new List <clsDetalleGrupoTrabajo>();


            con.Open();


            MySqlDataReader lector = cmd.ExecuteReader();

            while (lector.Read())
            {
                clsDetalleGrupoTrabajo grupotrabajo = new clsDetalleGrupoTrabajo();
                clsIntegranteGrupo     integrante   = new clsIntegranteGrupo();

                grupotrabajo.Nombregrupotrabajo  = lector.GetString(0);
                grupotrabajo.Numerogrupotrabajo  = lector.GetInt32(1);
                integrante.Nombreintegrantegrupo = lector.GetString(2);
                integrante.Cargotipointegrante   = lector.GetString(3);


                listagrupotrabajo.Add(grupotrabajo);
            }


            con.Close();

            return(listagrupotrabajo);
        }
        public List <clsIntegranteGrupo> ListarIntegrantesGrupo()
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

            builder.Server   = "localhost";
            builder.Port     = 3306;
            builder.UserID   = "root";
            builder.Password = "******";
            builder.SslMode  = MySqlSslMode.None;
            builder.Database = "dbcoordinacion";

            MySqlConnection con = new MySqlConnection(builder.ToString());

            MySqlCommand cmd = new MySqlCommand("select * from tbl_IntegranteGrupo", con);

            List <clsIntegranteGrupo> listaintegrantes = new List <clsIntegranteGrupo>();


            con.Open();


            MySqlDataReader lector = cmd.ExecuteReader();

            while (lector.Read())
            {
                clsIntegranteGrupo integrante = new clsIntegranteGrupo();

                integrante.Idintegrantegrupo      = lector.GetInt32(0);
                integrante.Idtipointegrante       = lector.GetInt32(1);
                integrante.Nombreintegrantegrupo  = lector.GetString(2);
                integrante.Empresaintegrantegrupo = lector.GetString(3);


                listaintegrantes.Add(integrante);
            }


            con.Close();

            return(listaintegrantes);
        }
        public bool IngresarIntegranteGrupo(clsIntegranteGrupo integrante)
        {
            MySqlConnection con = new MySqlConnection(cadenaConexion);
            MySqlCommand    cmd = new MySqlCommand("insert into tbl_IntegranteGrupo(idtbl_IntegranteGrupo,nombre_integrantegrupo,tbl_TipoIntegranteGrupo_id)" +
                                                   "values(@integranteid,@nombreintegrante,@tipointegrante)", con);

            cmd.Parameters.Add("@integranteid", MySqlDbType.Int32).Value       = integrante.Idintegrantegrupo;
            cmd.Parameters.Add("@nombreintegrante", MySqlDbType.VarChar).Value = integrante.Nombreintegrantegrupo;

            cmd.Parameters.Add("@tipointegrante", MySqlDbType.Int32).Value = integrante.Idtipointegrante;

            con.Open();

            int exito = cmd.ExecuteNonQuery();

            if (exito == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }