Exemplo n.º 1
0
        public static tsh_CombosDetListasDePreciosDataset.tsh_CombosDetListasDePreciosRow GetByPk(string IdProducto, long Ordinal, string IdListaDePrecio)
        {
            tsh_CombosDetListasDePreciosDataset data = new tsh_CombosDetListasDePreciosDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsh_CombosDetListasDePrecios_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;

            cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt));
            cmd.Parameters["@Ordinal"].Value = Ordinal;

            cmd.Parameters.Add(new SqlParameter("@IdListaDePrecio", SqlDbType.VarChar));
            cmd.Parameters["@IdListaDePrecio"].Value = IdListaDePrecio;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsh_CombosDetListasDePrecios");

            adapter.Fill(data);

            if (data.tsh_CombosDetListasDePrecios.Rows.Count == 1)
            {
                return((tsh_CombosDetListasDePreciosDataset.tsh_CombosDetListasDePreciosRow)data.tsh_CombosDetListasDePrecios.Rows[0]);
            }

            return(null);
        }
Exemplo n.º 2
0
        public static tsh_CombosDetListasDePreciosDataset GetByIdProductoOrdinal(string IdProducto, long Ordinal)
        {
            tsh_CombosDetListasDePreciosDataset data = new tsh_CombosDetListasDePreciosDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsh_CombosDetListasDePrecios");

            SqlCommand cmd = new SqlCommand("Pr_tsh_CombosDetListasDePrecios_SearchByIdProductoOrdinal", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;
            cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt));
            if (Ordinal == long.MinValue)
            {
                cmd.Parameters["@Ordinal"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@Ordinal"].Value = Ordinal;
            }
            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
        /// <summary>
        /// Envia los cambios del tsh_CombosDetListasDePreciosDataset a la base de datos.
        /// </summary>
        public static void Update(tsh_CombosDetListasDePreciosDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.tsh_CombosDetListasDePrecios.Rows.Count > 0, "La tabla dataSet.tsh_CombosDetListasDePreciosDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tsh_CombosDetListasDePrecios.Update(dataSet);
        }
Exemplo n.º 4
0
        public static tsh_CombosDetListasDePreciosDataset GetList(string IdProducto, long Ordinal, string IdListaDePrecio, string ModoDeAplicacion, decimal Coeficiente, decimal PrecioDeVentaBruto, DateTime FechaUltimaModificacionPrecioDeVenta, decimal DescuentoCombo, decimal DescuentoComboPorcentual, decimal PrecioDeVentaBrutoOriginal, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdEmpresa, long IdSucursal)
        {
            tsh_CombosDetListasDePreciosDataset data = new tsh_CombosDetListasDePreciosDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsh_CombosDetListasDePrecios");

            SqlCommand cmd = new SqlCommand("Pr_tsh_CombosDetListasDePrecios_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar));
            cmd.Parameters["@IdProducto"].Value = IdProducto;
            cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt));
            if (Ordinal == long.MinValue)
            {
                cmd.Parameters["@Ordinal"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@Ordinal"].Value = Ordinal;
            }
            cmd.Parameters.Add(new SqlParameter("@IdListaDePrecio", SqlDbType.VarChar));
            cmd.Parameters["@IdListaDePrecio"].Value = IdListaDePrecio;
            cmd.Parameters.Add(new SqlParameter("@ModoDeAplicacion", SqlDbType.VarChar));
            cmd.Parameters["@ModoDeAplicacion"].Value = ModoDeAplicacion;
            cmd.Parameters.Add(new SqlParameter("@Coeficiente", SqlDbType.Decimal));
            cmd.Parameters["@Coeficiente"].Value = Coeficiente;
            cmd.Parameters.Add(new SqlParameter("@PrecioDeVentaBruto", SqlDbType.Decimal));
            cmd.Parameters["@PrecioDeVentaBruto"].Value = PrecioDeVentaBruto;
            cmd.Parameters.Add(new SqlParameter("@FechaUltimaModificacionPrecioDeVenta", SqlDbType.DateTime));
            cmd.Parameters["@FechaUltimaModificacionPrecioDeVenta"].Value = FechaUltimaModificacionPrecioDeVenta;
            cmd.Parameters.Add(new SqlParameter("@DescuentoCombo", SqlDbType.Decimal));
            cmd.Parameters["@DescuentoCombo"].Value = DescuentoCombo;
            cmd.Parameters.Add(new SqlParameter("@DescuentoComboPorcentual", SqlDbType.Decimal));
            cmd.Parameters["@DescuentoComboPorcentual"].Value = DescuentoComboPorcentual;
            cmd.Parameters.Add(new SqlParameter("@PrecioDeVentaBrutoOriginal", SqlDbType.Decimal));
            cmd.Parameters["@PrecioDeVentaBrutoOriginal"].Value = PrecioDeVentaBrutoOriginal;
            cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime));
            cmd.Parameters["@FechaCreacion"].Value = FechaCreacion;
            cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt));
            if (IdConexionCreacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionCreacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionCreacion"].Value = IdConexionCreacion;
            }
            cmd.Parameters.Add(new SqlParameter("@UltimaModificacion", SqlDbType.Timestamp));
            cmd.Parameters["@UltimaModificacion"].Value = UltimaModificacion;
            cmd.Parameters.Add(new SqlParameter("@IdConexionUltimaModificacion", SqlDbType.BigInt));
            if (IdConexionUltimaModificacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion;
            }
            cmd.Parameters.Add(new SqlParameter("@IdReservado", SqlDbType.BigInt));
            if (IdReservado == long.MinValue)
            {
                cmd.Parameters["@IdReservado"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdReservado"].Value = IdReservado;
            }
            cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier));
            cmd.Parameters["@RowId"].Value = RowId;
            cmd.Parameters.Add(new SqlParameter("@IdEmpresa", SqlDbType.BigInt));
            if (IdEmpresa == long.MinValue)
            {
                cmd.Parameters["@IdEmpresa"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdEmpresa"].Value = IdEmpresa;
            }
            cmd.Parameters.Add(new SqlParameter("@IdSucursal", SqlDbType.BigInt));
            if (IdSucursal == long.MinValue)
            {
                cmd.Parameters["@IdSucursal"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdSucursal"].Value = IdSucursal;
            }
            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Exemplo n.º 5
0
        public static tsh_CombosDetListasDePreciosDataset GetList()
        {
            tsh_CombosDetListasDePreciosDataset data = new tsh_CombosDetListasDePreciosDataset();

            return((tsh_CombosDetListasDePreciosDataset)GetList(data));
        }
Exemplo n.º 6
0
 public static void Update(tsh_CombosDetListasDePreciosDataset dataSet)
 {
     Update(dataSet.tsh_CombosDetListasDePrecios);
 }