Ejemplo n.º 1
0
        private void bForward_Click(object sender, EventArgs e)
        {
            Llibre l1 = new Llibre("Windows 10 for Dummies", 240, "250x190", "Dan Forden", "Amarillo", 2015, "Sistemas Operativos"); //ENCAPUSULACIÓN DE DATOS, TODOS LOS DATOS SE GUARDAN EN LA VARIABLE "l".

            llibreglobal[1] = l1;

            /*
             * lTitol.Text = r.getTitol(); //Label.Tipodedato = Variable-encapsulada-de-Constructor-inicializado-con-parámetros.métodoGet;
             * lPag.Text = Convert.ToString(r.getPag());
             * lDim.Text = r.getDim();
             * lAutor.Text = r.getTitol();
             * lColorPortada.Text = r.getColor();
             * lAny.Text = Convert.ToString(r.getAny());
             * lContingut.Text = r.getContingut();
             */
        }
Ejemplo n.º 2
0
        private void bGuarda_Click(object sender, EventArgs e)
        {
            String titol, dim, autor, color, contingut;
            int    pag, any;

            titol     = TBtitol.Text;
            dim       = TBdimensions.Text;
            autor     = TBautor.Text;
            color     = TBcolor.Text;
            contingut = TBcontingut.Text;
            pag       = Convert.ToInt32(TBpag.Text);
            any       = Convert.ToInt32(TBany.Text);

            Llibre l = new Llibre(titol, pag, dim, autor, color, any, contingut); //Se crean primero las variables y se asocian, luego se pasan hacia el constructor.

            //Constructor = SEGUIR EL ORDEN ESCUETO TAL Y COMO SE CREÓ ANTERIORMENTE!!

            llibreglobal[0] = l;
        }