Exemplo n.º 1
0
        public void RegistrarVenta(MaquinaCafe maquina, VasoCafe vasoCafe)
        {
            float precio = this.Precio * vasoCafe.Medida;

            this.TotalRecaudado += precio;
            this.CantidadVendida++;
            this.LitrosVendidos += vasoCafe.Medida;
        }
Exemplo n.º 2
0
        public void RegistrarVenta(MaquinaCafe maquina, VasoCafe vasoCafe)
        {
            float precio = this.Cafe.Precio * vasoCafe.Medida;


            this.LitrosServidos  += vasoCafe.Medida;
            this.ContenidoActual -= vasoCafe.Medida;
            this.DineroRecaudado += precio;
            this.CantidadVentas++;
        }
Exemplo n.º 3
0
        public bool GenerarVenta(MaquinaCafe maquina, VasoCafe vasoCafe)
        {
            if (maquina.ContenidoActual >= vasoCafe.Medida)
            {
                this.recaudacionTotal += (maquina.Cafe.Precio * vasoCafe.Medida);

                maquina.Cafe.RegistrarVenta(maquina, vasoCafe);

                maquina.RegistrarVenta(maquina, vasoCafe);


                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Cafeteria Cafeteria = ((Form1)this.MdiParent).Cafeteria;

            MaquinaCafe = (MaquinaCafe)listBox1.SelectedItem;
            VasoCafe    = (VasoCafe)comboBox1.SelectedItem;

            bool venta = Cafeteria.GenerarVenta(MaquinaCafe, VasoCafe);

            if (venta)
            {
                MessageBox.Show("Venta exitosa");
            }
            else
            {
                MessageBox.Show("Recargue la cafetera");
            }
        }