private void CmbPlataforma_SelectedIndexChanged(object sender, EventArgs e)
        {
            ClsEPlataforma Eobj = new ClsEPlataforma();
            ClsNPlataforma Nobj = new ClsNPlataforma();

            CmbNombrePlataforma.DataSource    = Nobj.MtdBuscarPlataforma(CmbPlataforma.Text);
            CmbNombrePlataforma.DisplayMember = "NombrePlat";
        }
예제 #2
0
        public void ActualizarPlataformaTest()
        {
            String codigo = "1";
            String nombre = "PS5";

            var Negocios = new ClsNPlataforma();
            var Entidad  = new ClsEPlataforma()
            {
                codplat = codigo,
                nomplat = nombre
            };
            var resultadoFinal = Negocios.MtdActualizarPlataforma(Entidad);

            Assert.IsTrue(resultadoFinal);
        }
 private void BtnAgregar_Click(object sender, EventArgs e)
 {
     if (TxtCodigo.Text != "" && TxtNombre.Text != "")
     {
         ClsEPlataforma Eobj = new ClsEPlataforma();
         ClsNPlataforma Nobj = new ClsNPlataforma();
         Eobj.codplat = TxtCodigo.Text;
         Eobj.nomplat = TxtNombre.Text;
         Nobj.MtdAgregarPlataforma(Eobj);
         DgvPlataforma.DataSource = Nobj.MtdListarPlataforma();
     }
     else
     {
         MessageBox.Show("Por favor llene todos los campos", "Mensaje");
     }
 }
예제 #4
0
        public Boolean MtdActualizarPlataforma(ClsEPlataforma objCar)
        {
            try
            {
                ClsConexion  Objconexion = new ClsConexion();
                MySqlCommand ObjCommand  = new MySqlCommand();
                ObjCommand.Connection  = Objconexion.conectar();
                ObjCommand.CommandText = "usp_E_ModificarPlataforma";
                ObjCommand.CommandType = CommandType.StoredProcedure;
                ObjCommand.Parameters.Add(new MySqlParameter("Acod", MySqlDbType.VarChar));
                ObjCommand.Parameters.Add(new MySqlParameter("Anom", MySqlDbType.VarChar));
                ObjCommand.Parameters["Acod"].Value = objCar.codplat;
                ObjCommand.Parameters["Anom"].Value = objCar.nomplat;
                ObjCommand.Connection = Objconexion.conectar();
                ObjCommand.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }