/// <summary> /// Envia los cambios del tsh_ProductosListasDePreciosDataset a la base de datos. /// </summary> public static void Update(tsh_ProductosListasDePreciosDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsh_ProductosListasDePrecios.Rows.Count > 0, "La tabla dataSet.tsh_ProductosListasDePreciosDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tsh_ProductosListasDePrecios.Update(dataSet); }
//Fin Sabrina 20100715 - Tarea 794 //Sabrina: Tarea 1068. 20110317 public static tsh_ProductosListasDePreciosDataset GetByIdProducto(string IdProducto) { tsh_ProductosListasDePreciosDataset data = new tsh_ProductosListasDePreciosDataset(); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosListasDePrecios_SearchByIdProducto", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar)); if (IdProducto == "") { cmd.Parameters["@IdProducto"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdProducto"].Value = IdProducto; } SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = cmd; adapter.TableMappings.Add("Table", "tsh_ProductosListasDePrecios"); adapter.Fill(data); return(data); }
public static tsh_ProductosListasDePreciosDataset.tsh_ProductosListasDePreciosRow GetByPk(string IdProducto, string IdListaDePrecio) { tsh_ProductosListasDePreciosDataset data = new tsh_ProductosListasDePreciosDataset(); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosListasDePrecios_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("@IdListaDePrecio", SqlDbType.VarChar)); cmd.Parameters["@IdListaDePrecio"].Value = IdListaDePrecio; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsh_ProductosListasDePrecios"); adapter.Fill(data); if (data.tsh_ProductosListasDePrecios.Rows.Count == 1) { return((tsh_ProductosListasDePreciosDataset.tsh_ProductosListasDePreciosRow)data.tsh_ProductosListasDePrecios.Rows[0]); } return(null); }
public static tsh_ProductosListasDePreciosDataset GetList() { tsh_ProductosListasDePreciosDataset data = new tsh_ProductosListasDePreciosDataset(); return(( tsh_ProductosListasDePreciosDataset )GetList(data)); }
public static void Update(tsh_ProductosListasDePreciosDataset dataSet) { Update(dataSet.tsh_ProductosListasDePrecios); }
public static tsh_ProductosListasDePreciosDataset GetList(string IdProducto, string IdListaDePrecio, string ModoDeAplicacion, decimal Coeficiente, decimal MaxDescuento, decimal MaxDescuentoPorcentual, decimal PrecioDeVentaBruto, decimal PrecioDeVentaBrutoConImpuesto, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdEmpresa, long IdSucursal) { tsh_ProductosListasDePreciosDataset data = new tsh_ProductosListasDePreciosDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsh_ProductosListasDePrecios"); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosListasDePrecios_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("@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("@MaxDescuento", SqlDbType.Decimal)); cmd.Parameters["@MaxDescuento"].Value = MaxDescuento; cmd.Parameters.Add(new SqlParameter("@MaxDescuentoPorcentual", SqlDbType.Decimal)); cmd.Parameters["@MaxDescuentoPorcentual"].Value = MaxDescuentoPorcentual; cmd.Parameters.Add(new SqlParameter("@PrecioDeVentaBruto", SqlDbType.Decimal)); cmd.Parameters["@PrecioDeVentaBruto"].Value = PrecioDeVentaBruto; cmd.Parameters.Add(new SqlParameter("@PrecioDeVentaBrutoConImpuesto", SqlDbType.Decimal)); cmd.Parameters["@PrecioDeVentaBrutoConImpuesto"].Value = PrecioDeVentaBrutoConImpuesto; 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); }