Beispiel #1
0
        public float GetValorEstante(ETipoProducto tipo)
        {
            float acum = 0;

            foreach (Producto p in this.Productos)
            {
                if (p is Galletita && ETipoProducto.Galletita == (ETipoProducto)tipo)
                {
                    acum += p.Precio;
                }
                if (p is Gaseosa && ETipoProducto.Gaseosa == (ETipoProducto)tipo)
                {
                    acum += p.Precio;
                }
                if (p is Jugo && ETipoProducto.Jugo == (ETipoProducto)tipo)
                {
                    acum += p.Precio;
                }
                if (ETipoProducto.Todos == (ETipoProducto)tipo)
                {
                    acum += p.Precio;
                }
            }
            return(acum);
        }
Beispiel #2
0
 public Producto(string nombre, int precio, int stock, ETipoProducto tipo)
 {
     this.nombreProduc = nombre;
     this.precio       = precio;
     this.stock        = stock;
     this.tipo         = tipo;
 }
Beispiel #3
0
        public BudgetLineAddForm(ETipoProducto tipo, Budget proforma, SerieInfo serie, ClienteInfo cliente, Form parent)
            : base(tipo, proforma, serie, cliente, parent)
        {
            InitializeComponent();

            this.Text = Resources.Labels.CONCEPTO_NEW_TITLE;
        }
        public float GetValorEstante(ETipoProducto tipo)
        {
            float acum = 0;

            foreach (var item in this._productos)
            {
                if (item is Galletita && tipo == ETipoProducto.Galletita)
                {
                    acum += item.Precio;
                }
                else if (item is Gaseosa && tipo == ETipoProducto.Gaseosa)
                {
                    acum += item.Precio;
                }
                else if (item is Jugo && tipo == ETipoProducto.Jugo)
                {
                    acum += item.Precio;
                }
                else if (tipo == ETipoProducto.Todos)
                {
                    acum += item.Precio;
                }
            }
            return(acum);
        }
Beispiel #5
0
        public float GetValorEstante(ETipoProducto tipoProducto)
        {
            float sumaProductos = 0;

            foreach (Producto element in listaProductos)
            {
                if (element.Equals(ETipoProducto.Galletita))
                {
                    sumaProductos += 1;
                }
                if (element.Equals(ETipoProducto.Gaseosa))
                {
                    sumaProductos += 1;
                }
                if (element.Equals(ETipoProducto.Harina))
                {
                    sumaProductos += 1;
                }
                if (element.Equals(ETipoProducto.Jugo))
                {
                    sumaProductos += 1;
                }
                else
                {
                    sumaProductos += 1;
                }
            }
            return(sumaProductos);
        }
Beispiel #6
0
        public float GetValorEstante(ETipoProducto tipo)
        {
            float precioEstante = 0;

            foreach (Producto item in this._productos)
            {
                if (tipo == ETipoProducto.Jugo && item is Jugo)
                {
                    precioEstante += item.Precio;
                }
                else if (tipo == ETipoProducto.Galletita && item is Galletita)
                {
                    precioEstante += item.Precio;
                }
                else if (tipo == ETipoProducto.Gaseosa && item is Gaseosa)
                {
                    precioEstante += item.Precio;
                }
                else
                {
                    //precioEstante += item.Precio;
                }
            }
            return(precioEstante);
        }
        public float GetValorEstante(ETipoProducto tipo)
        {
            float valor = 0;

            foreach (Producto p in this._productos)
            {
                if (p is Jugo && tipo == ETipoProducto.Jugo)
                {
                    valor += p.Precio;
                }
                else if (p is Gaseosa && tipo == ETipoProducto.Gaseosa)
                {
                    valor += p.Precio;
                }
                else if (p is Galletita && tipo == ETipoProducto.Galletita)
                {
                    valor += p.Precio;
                }
                else if (p is Harina && tipo == ETipoProducto.Harina)
                {
                    valor += p.Precio;
                }
            }
            return(valor);
        }
        public BudgetLineEditForm(ETipoProducto productType, Budget budget, SerieInfo serie, ClienteInfo client, BudgetLine line, Form parent)
            : base(productType, budget, serie, client, parent)
        {
            InitializeComponent();

            _entity = line;

            RefreshMainData();
        }
Beispiel #9
0
        public LineaPedidoAddForm(ETipoProducto tipo, Pedido albaran, SerieInfo serie, ClienteInfo cliente, Form parent)
            : base(tipo, albaran, serie, cliente, parent)
        {
            InitializeComponent();

            this.Text = Resources.Labels.CONCEPTO_NEW_TITLE;

            // Va aquí porque si no peta en el padre porque _entity es nulo
            _entity.PropertyChanged += new PropertyChangedEventHandler(Entity_PropertyChanged);
        }
        public DeliveryLinenAddForm(ETipoProducto productType, OutputDelivery delivery, SerieInfo serie, ClienteInfo client, Form parent)
            : base(productType, delivery, serie, client, parent)
        {
            InitializeComponent();

            this.Text = Resources.Labels.CONCEPTO_NEW_TITLE;

            // Va aquí porque si no peta en el padre porque _entity es nulo
            _entity.PropertyChanged += new PropertyChangedEventHandler(Entity_PropertyChanged);
        }
        public LineaPedidoUIForm(ETipoProducto tipoProducto, Pedido albaran, SerieInfo serie, ClienteInfo cliente, Form parent)
            : base(true, parent)
        {
            InitializeComponent();

            _albaran = albaran;
            _serie   = serie;
            _cliente = cliente;
            _tipo    = tipoProducto;
            SetFormData();
        }
        public DeliveryLineUIForm(ETipoProducto tipoProducto, OutputDelivery albaran, SerieInfo serie, ClienteInfo cliente, Form parent)
            : base(true, parent)
        {
            InitializeComponent();

            _delivery     = albaran;
            _serie        = serie;
            _client       = cliente;
            _product_type = tipoProducto;
            SetFormData();
        }
        public BudgetLineUIForm(ETipoProducto productType, Budget budget, SerieInfo serie, ClienteInfo client, Form parent)
            : base(true, parent)
        {
            InitializeComponent();

            _budget = budget;
            _serie  = serie;
            _client = client;
            _tipo   = productType;
            SetFormData();
        }
Beispiel #14
0
 public float GetValorEstante(ETipoProducto tipo)
 {
     float valor = 0;
     foreach (Producto producto in this.productos)
     {
         if (producto.Tipo == tipo)
         {
             valor += valor + producto.Precio;       
         }
     }
     return valor;
 }
Beispiel #15
0
        public static Boolean MismoTipo(Producto productoA, ETipoProducto tipo)
        {
            Boolean retorno = false;

            switch (tipo)
            {
            case Producto.ETipoProducto.Galletita:
            {
                if (productoA is Galletita)
                {
                    retorno = true;
                }
            }
            break;

            case Producto.ETipoProducto.Gaseosa:
            {
                if (productoA is Gaseosa)
                {
                    retorno = true;
                }
            }
            break;

            case Producto.ETipoProducto.Jugo:
            {
                if (productoA is Jugo)
                {
                    retorno = true;
                }
            }
            break;

            case Producto.ETipoProducto.Harina:
            {
                if (productoA is Harina)
                {
                    retorno = true;
                }
            }
            break;

            case Producto.ETipoProducto.Todos:
            { retorno = true; }
            break;

            default:
                break;
            }

            return(retorno);
        }
        public DeliveryLineEditForm(ETipoProducto tipo, OutputDelivery delivery, SerieInfo serie, ClienteInfo cliente, OutputDeliveryLine line, Form parent)
            : base(tipo, delivery, serie, cliente, parent)
        {
            InitializeComponent();

            this.Text = Resources.Labels.CONCEPTO_EDIT_TITLE;

            _entity = line;

            RefreshMainData();

            // Va aquí porque si no peta en el padre porque _entity es nulo
            _entity.PropertyChanged += new PropertyChangedEventHandler(Entity_PropertyChanged);
        }
Beispiel #17
0
        public float GetValorEstante(ETipoProducto tipo)
        {
            float retorno = 0;

            foreach (Producto prod in this._productos)
            {
                switch (tipo)
                {
                case ETipoProducto.Galletita:
                    if (prod is Galletita)
                    {
                        retorno = prod.CalcularCostoDeProduccion;
                    }
                    break;

                case ETipoProducto.Gaseosa:
                    if (prod is Gaseosa)
                    {
                        retorno = prod.CalcularCostoDeProduccion;
                    }
                    break;

                case ETipoProducto.Harina:
                    if (prod is Harina)
                    {
                        retorno = prod.CalcularCostoDeProduccion;
                    }
                    break;

                case ETipoProducto.Jugo:
                    if (prod is Jugo)
                    {
                        retorno = prod.CalcularCostoDeProduccion;
                    }
                    break;

                case ETipoProducto.Todos:
                    retorno = prod.CalcularCostoDeProduccion;

                    break;

                default:
                    break;
                }
            }
            return(retorno);
        }
        public ProductMngForm(bool isModal, Form parent, ProductList list, ETipoProducto tipo)
            : base(isModal, parent, list)
        {
            InitializeComponent();

            SetView(molView.Normal);

            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;

            SetMainDataGridView(Tabla);
            Datos.DataSource = ProductList.NewList().GetSortedList();
            SortProperty     = Nombre.DataPropertyName;

            _tipo = tipo;
        }
        /// <summary>
        /// Expone los datos del elemento y su lista (incluidas sus herencias)
        /// SOLO del tipo requerido
        /// </summary>
        /// <param name="c">Elemento a exponer</param>
        /// <param name="ETipo">Tipos de ítems de la lista a mostrar</param>
        /// <returns></returns>
        public string Mostrar(Changuito c, ETipoProducto tipo)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Tenemos {0} lugares ocupados de un total de {1} disponibles", c.productos.Count, c.espacioDisponible);
            sb.AppendLine("");
            foreach (Producto v in c.productos)
            {
                switch (tipo)
                {
                case ETipoProducto.Snacks:

                    if (v is Snacks)
                    {
                        sb.AppendLine(v.Mostrar());
                    }

                    break;

                case ETipoProducto.Dulce:
                    if (v is Dulce)

                    {
                        sb.AppendLine(v.Mostrar());
                    }

                    break;

                case ETipoProducto.Leche:

                    if (v is Leche)
                    {
                        sb.AppendLine(v.Mostrar());
                    }

                    break;

                default:

                    sb.AppendLine(v.Mostrar());
                    break;
                }
            }

            return(sb.ToString());
        }
        protected float GetValorEstante(ETipoProducto tipo)
        {
            float valorestante = 0;

            switch (tipo)
            {
            case ETipoProducto.Galletita:
                foreach (Producto item in this._productos)
                {
                    if (item is Galletita)
                    {
                        valorestante += item.Precio;
                    }
                }

                break;

            case ETipoProducto.Gaseosa:
                foreach (Producto item in this._productos)
                {
                    if (item is Gaseosa)
                    {
                        valorestante += item.Precio;
                    }
                }
                break;

            case ETipoProducto.Jugo:
                foreach (Producto item in this._productos)
                {
                    if (item is Jugo)
                    {
                        valorestante += item.Precio;
                    }
                }
                break;

            case ETipoProducto.Todos:
                valorestante = this.GetValorEstante();
                break;

            default:
                break;
            }
            return(valorestante);
        }
Beispiel #21
0
        public float GetValorEstante(ETipoProducto tipoProducto)
        {
            float valorTodos = 0;

            foreach (Producto element in listaProductos)
            {
                switch (tipoProducto)
                {
                case ETipoProducto.Galletita:
                    if (element is Galletita)
                    {
                        valorTodos += element.Precio;
                    }
                    break;

                case ETipoProducto.Gaseosa:
                    if (element is Gaseosa)
                    {
                        valorTodos += element.Precio;
                    }
                    break;

                case ETipoProducto.Harina:
                    if (element is Harina)
                    {
                        valorTodos += element.Precio;
                    }
                    break;

                case ETipoProducto.Jugo:
                    if (element is Jugo)
                    {
                        valorTodos += element.Precio;
                    }
                    break;

                default:
                    return(valorTodos += element.Precio);

                    break;
                }
            }
            return(valorTodos);
        }
Beispiel #22
0
        public float GetValorEstante(ETipoProducto Tipo)
        {
            float ContadorTotal = 0;
            float CG = 0, CJ = 0, CGs = 0, CH = 0;

            foreach (Producto elemento in this._list)
            {
                if (elemento is Galletita)
                {
                    CG += ((Galletita)elemento).Precio;
                }
                else if (elemento is Jugo)
                {
                    CJ += ((Jugo)elemento).Precio;
                }
                else if (elemento is Harina)
                {
                    CH += ((Harina)elemento).Precio;
                }
                else if (elemento is Gaseosa)
                {
                    CGs += ((Gaseosa)elemento).Precio;
                }
            }

            switch (Tipo)
            {
            case ETipoProducto.Galletita:
                return(CG);

            case ETipoProducto.Gaseosa:
                return(CGs);

            case ETipoProducto.Harina:
                return(CH);

            case ETipoProducto.Jugo:
                return(CJ);

            default:
                return(ContadorTotal = CG + CGs + CH + CJ);
            }
        }
        protected void ShowLineGrid(ETipoProducto productType)
        {
            switch (productType)
            {
            case ETipoProducto.Almacen:
            {
                Producto_DGW.Visible = false;
                Partida_DGW.Visible  = true;
                Store_LB.Visible     = true;
                Store_TB.Visible     = true;
                Store_BT.Visible     = false;

                switch ((ESerie)_serie.Oid)
                {
                case ESerie.GANADO:
                case ESerie.MAQUINARIA:

                    BultosIniciales.Visible = false;
                    StockBultos.Visible     = false;
                    KiloPorBulto.Visible    = false;

                    KilosIniciales.HeaderText = "Stock Inicial";
                    StockKilos.HeaderText     = "Stock";

                    break;
                }
            }
            break;

            case ETipoProducto.Libres:
            {
                Producto_DGW.Visible = true;
                Partida_DGW.Visible  = false;
                Store_LB.Visible     = (_product != null) && (!_product.NoStockSale);
                Store_TB.Visible     = Store_LB.Visible;
                Store_BT.Visible     = false;
            }
            break;
            }
        }
Beispiel #24
0
        public float GetValorEstante(ETipoProducto tipo)
        {
            float valor = 0;

            foreach (Producto item in this.GetProductos())
            {
                switch (tipo)
                {
                case ETipoProducto.Galletita:
                    if (item is Galletita)
                    {
                        valor += item.Precio;
                    }
                    break;

                case ETipoProducto.Gaseosa:
                    if (item is Gaseosa)
                    {
                        valor += item.Precio;
                    }
                    break;

                case ETipoProducto.Jugo:
                    if (item is Jugo)
                    {
                        valor += item.Precio;
                    }
                    break;

                case ETipoProducto.Todos:
                    valor += item.Precio;
                    break;

                default:
                    break;
                }
            }
            return(valor);
        }
Beispiel #25
0
        /// <summary>
        /// Expone los datos del elemento y su lista (incluidas sus herencias)
        /// SOLO del tipo requerido
        /// </summary>
        /// <param name="changuito">Elemento a exponer</param>
        /// <param name="tipo">Tipos de ítems de la lista a mostrar</param>
        /// <returns></returns>
        public static string Mostrar(Changuito changuito, ETipoProducto tipo)
        {
            StringBuilder datos = new StringBuilder();

            datos.AppendFormat("Tenemos {0} lugares ocupados de un total de {1} disponibles", changuito.productos.Count, changuito.espacioDisponible);
            datos.AppendLine("");
            foreach (Producto auxiliarProducto in changuito.productos)
            {
                switch (tipo)
                {
                case ETipoProducto.Snacks:
                    if (auxiliarProducto is Snacks)
                    {
                        datos.AppendLine(auxiliarProducto.Mostrar());
                    }
                    break;

                case ETipoProducto.Dulce:
                    if (auxiliarProducto is Dulce)
                    {
                        datos.AppendLine(auxiliarProducto.Mostrar());
                    }
                    break;

                case ETipoProducto.Leche:
                    if (auxiliarProducto is Leche)
                    {
                        datos.AppendLine(auxiliarProducto.Mostrar());
                    }
                    break;

                default:
                    datos.AppendLine(auxiliarProducto.Mostrar());
                    break;
                }
            }

            return(datos.ToString());
        }
        /// <summary>
        /// Retorna el Total por tipo de Producto
        /// </summary>
        /// <param name="tipo"></param>
        /// <returns>float total</returns>
        public float GetValorEstante(ETipoProducto tipo)
        {
            float total = 0;

            foreach (Producto p in this._productos)
            {
                switch (tipo)
                {
                case ETipoProducto.Jugo:
                    if (p is Jugo)
                    {
                        total += p.Precio();
                    }
                    break;

                case ETipoProducto.Gaseosa:
                    if (p is Gaseosa)
                    {
                        total += p.Precio();
                    }
                    break;

                case ETipoProducto.Galletita:
                    if (p is Galletita)
                    {
                        total += p.Precio();
                    }
                    break;

                case ETipoProducto.Harina:
                    if (p is Harina)
                    {
                        total += p.Precio();
                    }
                    break;
                }
            }
            return(total);
        }
Beispiel #27
0
 public Exportador(string nombreComercio, float precioAlquiler, string nombre, string apellido, ETipoProducto tipo) : base(precioAlquiler, nombreComercio, nombre, apellido)
 {
     this.tipo = tipo;
 }
Beispiel #28
0
        public float GetValorEstante(ETipoProducto tipo)
        {
            float auxPrecio = 0;

            switch (tipo)
            {
            case ETipoProducto.Galletita:
                foreach (Producto item in this._productos)
                {
                    if (item is Galletita)
                    {
                        Galletita auxGalletita;
                        auxGalletita = (Galletita)item;
                        auxPrecio   += item.Precio;
                    }
                }
                break;

            case ETipoProducto.Gaseosa:
                foreach (Producto item in this._productos)
                {
                    if (item is Gaseosa)
                    {
                        Gaseosa auxGalletita;
                        auxGalletita = (Gaseosa)item;
                        auxPrecio   += item.Precio;
                    }
                }
                break;

            case ETipoProducto.Jugo:
                foreach (Producto item in this._productos)
                {
                    if (item is Jugo)
                    {
                        Jugo auxGalletita;
                        auxGalletita = (Jugo)item;
                        auxPrecio   += item.Precio;
                    }
                }
                break;

            case ETipoProducto.Todos:
                foreach (Producto item in this._productos)
                {
                    if (item is Gaseosa)
                    {
                        Gaseosa auxGalletita;
                        auxGalletita = (Gaseosa)item;
                        auxPrecio   += item.Precio;
                    }
                }
                foreach (Producto item in this._productos)
                {
                    if (item is Galletita)
                    {
                        Galletita auxGalletita;
                        auxGalletita = (Galletita)item;
                        auxPrecio   += item.Precio;
                    }
                }
                foreach (Producto item in this._productos)
                {
                    if (item is Jugo)
                    {
                        Jugo auxGalletita;
                        auxGalletita = (Jugo)item;
                        auxPrecio   += item.Precio;
                    }
                }
                break;

            default:
                break;
            }
            return(auxPrecio);
        }
 public ProductMngForm(Form parent, ETipoProducto tipo)
     : this(false, parent, null, tipo)
 {
 }