Exemplo n.º 1
0
        public DsLiquidacionVntWeb GetLiquidacionVentaWeb()
        {
            try
            {
                DsLiquidacionVntWeb ds  = new DsLiquidacionVntWeb();
                SqlParameter        liq = new SqlParameter("@LiquidacionWebID", Utiles.BaseDatos.IntToSql(this.LiquidacionWebID));
                /*cliente*/
                Config.Conexion.LlenarTypeDataSet(ds.Liquidadas, System.Data.CommandType.StoredProcedure,
                                                  "LiquidacionVentasWebONE", liq);
                /*encabezado*/
                Config.Conexion.LlenarTypeDataSet(ds.Encabezado, System.Data.CommandType.StoredProcedure,
                                                  "LiquidacionVentasWebClienteONE", liq);
                /*guias*/
                if (ds.Encabezado.Count > 0)
                {
                    DsLiquidacionVntWeb.LiquidadasRow drLiq = (DsLiquidacionVntWeb.LiquidadasRow)ds.Liquidadas.Rows[0];
                    this.LiquidacionFecha      = drLiq.LiquidacionFechaAlta;
                    this.LiquidacionNro        = drLiq.LiquidacionNro;
                    this.LiquidacionFechaDesde = drLiq.LiquidacionFechaDesde;
                    this.LiquidacionFechaHasta = drLiq.LiquidacionFechaHasta;

                    /*si existen liquidaciones en ese periodo, traigo el detalle de esas lliquidaciones*/
                    Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure,
                                                      "LiquidacionVentasWebDetalleONE", liq);
//				}
                    //				if (ds.Liquidadas.Count>0)
                    //				{
                    //					SqlParameter fDesde= new SqlParameter("@FechaEmisionDesde", Utiles.BaseDatos.FechaToSql(this.LiquidacionFechaDesde));
                    //					SqlParameter fHasta= new SqlParameter("@FechaEmisionHasta", Utiles.BaseDatos.FechaToSql(this.LiquidacionFechaHasta));
                    //					Config.Conexion.LlenarTypeDataSet(ds.ImportePeriodo, System.Data.CommandType.StoredProcedure,
                    //						"ComisionWebImporteFleteTotal",fDesde, fHasta);
                }

                return(ds);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 2
0
        public DsLiquidacionVntWeb GetLiquidacionesVentaWebDataSet()
        {
            try
            {
                DsLiquidacionVntWeb ds     = new DsLiquidacionVntWeb();
                SqlParameter        fDesde = new SqlParameter("@FechaEmisionDesde", Utiles.BaseDatos.FechaToSql(this.LiquidacionFechaDesde));
                SqlParameter        fHasta = new SqlParameter("@FechaEmisionHasta", Utiles.BaseDatos.FechaToSql(this.LiquidacionFechaHasta));
                SqlParameter        cli    = new SqlParameter("@ClienteID", Utiles.BaseDatos.IntToSql(this.ClienteID));

                /*primero mando a verificar el importe de facturacion*/
                Config.Conexion.LlenarTypeDataSet(ds.ImportePeriodo, System.Data.CommandType.StoredProcedure,
                                                  "ComisionWebImporteFleteTotal", fDesde, fHasta);

                /*traigo en un ds los clientes, y en el otro las guias de esos clientes*/

                if (ds.ImportePeriodo.Count > 0)
                {
                    DsLiquidacionVntWeb.ImportePeriodoRow dr;
                    dr = (DsLiquidacionVntWeb.ImportePeriodoRow)ds.ImportePeriodo.Rows[0];

                    SqlParameter porcVentas   = new SqlParameter("@PorcentajeVentas", dr.PorcentajeComisionVenta);
                    SqlParameter porcComerc   = new SqlParameter("@PorcentajeComercializacion", dr.PorcentajeComercializacion);
                    SqlParameter porcRedistri = new SqlParameter("@PorcentajeRedistribucion", dr.PorcentajeRedistribucion);

                    /*luego traigo los porcentajes correspondientes a las guias emitidas por web*/
                    Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure,
                                                      "LiquidacionWebSEL", fDesde, fHasta, porcVentas, porcComerc, porcRedistri, cli);
                    Config.Conexion.LlenarTypeDataSet(ds.Encabezado, System.Data.CommandType.StoredProcedure,
                                                      "LiquidacionWebSELEncabezado", fDesde, fHasta, porcVentas, porcComerc, porcRedistri, cli);
                }


                return(ds);
            }
            catch (Exception e)
            {
                throw e;
            }
        }