Exemplo n.º 1
0
        public void ActualizarPrecios(Int32 IndPrecioPublico,
                                      Int32 IndPrecio2,
                                      Int32 IndPrecio3,
                                      Int32 IndPrecio4,
                                      Int32 IndPorcentaje,
                                      Int32 IndPorCosto,
                                      Int32 IndPorUltimoCosto,
                                      Int32 IndCostoPromedio,
                                      Int32 IndMonto,
                                      //Double Porcentaje,
                                      Decimal Monto,
                                      Int32?FamiliaID,
                                      Int32?MarcaID,
                                      String TipoProducto,
                                      DateTime?FechaDesde,
                                      DateTime?FechaHasta,
                                      String CodigoArticuloDesde,
                                      String CodigoArticuloHasta)
        {
            //Validamos que precio sera afectado
            if (IndPrecioPublico != 1 && IndPrecio2 != 1 && IndPrecio3 != 1 && IndPrecio4 != 1)
            {
                throw new Exception("Debe Seleccionar al menos un precio a actualizar");
            }
            else if (IndPorCosto == 1 && (IndPorUltimoCosto != 1 && IndCostoPromedio != 1))
            {
                throw new Exception("Debe seleccionar al menos un costo como parametro");
            }
            else if (IndMonto != 1 && IndPorcentaje != 1)
            {
                throw new Exception("Debe indicador un metodo de actualizacion de precio");
            }
            else if (Monto <= 0)
            {
                throw new Exception("Debe especificar un monto");
            }

            else
            {
                InventarioDA.ActualizarPrecios(IndPrecioPublico,
                                               IndPrecio2,
                                               IndPrecio3,
                                               IndPrecio4,
                                               IndPorcentaje,
                                               IndPorCosto,
                                               IndPorUltimoCosto,
                                               IndCostoPromedio,
                                               IndMonto,
                                               //Porcentaje,
                                               Monto,
                                               FamiliaID,
                                               MarcaID,
                                               TipoProducto,
                                               FechaDesde,
                                               FechaHasta,
                                               CodigoArticuloDesde,
                                               CodigoArticuloHasta);
            }
        }