public static tsh_ProductosPedidosPendientesDataset.tsh_ProductosPedidosPendientesRow GetByPk(string IdComprobante, string IdProducto, DateTime FechaRecepcion, long Ordinal) { tsh_ProductosPedidosPendientesDataset data = new tsh_ProductosPedidosPendientesDataset(); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosPedidosPendientes_GetByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); cmd.Parameters["@IdComprobante"].Value = IdComprobante; cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar)); cmd.Parameters["@IdProducto"].Value = IdProducto; cmd.Parameters.Add(new SqlParameter("@FechaRecepcion", SqlDbType.DateTime)); cmd.Parameters["@FechaRecepcion"].Value = FechaRecepcion; cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt)); cmd.Parameters["@Ordinal"].Value = Ordinal; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsh_ProductosPedidosPendientes"); adapter.Fill(data); if (data.tsh_ProductosPedidosPendientes.Rows.Count == 1) { return((tsh_ProductosPedidosPendientesDataset.tsh_ProductosPedidosPendientesRow)data.tsh_ProductosPedidosPendientes.Rows[0]); } return(null); }
/// <summary> /// Envia los cambios del tsh_ProductosPedidosPendientesDataset a la base de datos. /// </summary> public static void Update(tsh_ProductosPedidosPendientesDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsh_ProductosPedidosPendientes.Rows.Count > 0, "La tabla dataSet.tsh_ProductosPedidosPendientesDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tsh_ProductosPedidosPendientes.Update(dataSet); }
public static tsh_ProductosPedidosPendientesDataset.tsh_ProductosPedidosPendientesRow GetByIdComprobanteIdProductoOrdinal(string IdComprobante, string IdProducto, long Ordinal, bool Cerrado) { tsh_ProductosPedidosPendientesDataset data = new tsh_ProductosPedidosPendientesDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsh_ProductosPedidosPendientes"); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosPedidosPendientes_GetByIdComprobanteIdProductoOrdinal", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); if (IdComprobante.Equals(String.Empty)) { cmd.Parameters["@IdComprobante"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdComprobante"].Value = IdComprobante; } cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar)); if (IdProducto.Equals(String.Empty)) { cmd.Parameters["@IdProducto"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdProducto"].Value = IdProducto; } cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt)); if (Ordinal.Equals(long.MinValue)) { cmd.Parameters["@Ordinal"].Value = System.DBNull.Value; } else { cmd.Parameters["@Ordinal"].Value = Ordinal; } cmd.Parameters.Add(new SqlParameter("@Cerrado", SqlDbType.Bit)); cmd.Parameters["@Cerrado"].Value = Cerrado; adapter.SelectCommand = cmd; adapter.Fill(data); if (data.tsh_ProductosPedidosPendientes.Rows.Count == 1) { return((tsh_ProductosPedidosPendientesDataset.tsh_ProductosPedidosPendientesRow)data.tsh_ProductosPedidosPendientes.Rows[0]); } return(null); }
public static DataSet GetList(string codigo) { tsh_ProductosPedidosPendientesDataset data = new tsh_ProductosPedidosPendientesDataset(); return(( DataSet )GetExList(DateTime.MinValue, false, "", codigo, "", DateTime.MinValue, decimal.MinValue, long.MinValue)); }
public static tsh_ProductosPedidosPendientesDataset GetList() { tsh_ProductosPedidosPendientesDataset data = new tsh_ProductosPedidosPendientesDataset(); return(( tsh_ProductosPedidosPendientesDataset )GetList(data)); }
public static void Update(tsh_ProductosPedidosPendientesDataset dataSet) { Update(dataSet.tsh_ProductosPedidosPendientes); }
public static tsh_ProductosPedidosPendientesDataset GetList(DateTime FechaCierre, bool Cerrado, string IdComprobante, string IdProducto, string IdProveedor, DateTime FechaRecepcion, decimal Cantidad, long Ordinal) { tsh_ProductosPedidosPendientesDataset data = new tsh_ProductosPedidosPendientesDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsh_ProductosPedidosPendientes"); SqlCommand cmd = new SqlCommand("Pr_tsh_ProductosPedidosPendientes_Search", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@FechaCierre", SqlDbType.DateTime)); if (FechaCierre.Equals(DateTime.MinValue)) { cmd.Parameters["@FechaCierre"].Value = System.DBNull.Value; } else { cmd.Parameters["@FechaCierre"].Value = FechaCierre; } cmd.Parameters.Add(new SqlParameter("@Cerrado", SqlDbType.Bit)); cmd.Parameters["@Cerrado"].Value = Cerrado; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); if (IdComprobante.Equals(String.Empty)) { cmd.Parameters["@IdComprobante"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdComprobante"].Value = IdComprobante; } cmd.Parameters.Add(new SqlParameter("@IdProducto", SqlDbType.VarChar)); if (IdProducto.Equals(String.Empty)) { cmd.Parameters["@IdProducto"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdProducto"].Value = IdProducto; } cmd.Parameters.Add(new SqlParameter("@IdProveedor", SqlDbType.VarChar)); if (IdProveedor.Equals(String.Empty)) { cmd.Parameters["@IdProveedor"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdProveedor"].Value = IdProveedor; } cmd.Parameters.Add(new SqlParameter("@FechaRecepcion", SqlDbType.DateTime)); if (FechaRecepcion.Equals(DateTime.MinValue)) { cmd.Parameters["@FechaRecepcion"].Value = System.DBNull.Value; } else { cmd.Parameters["@FechaRecepcion"].Value = FechaRecepcion; } cmd.Parameters.Add(new SqlParameter("@Cantidad", SqlDbType.Decimal)); if (Cantidad.Equals(decimal.MinValue)) { cmd.Parameters["@Cantidad"].Value = System.DBNull.Value; } else { cmd.Parameters["@Cantidad"].Value = Cantidad; } cmd.Parameters.Add(new SqlParameter("@Ordinal", SqlDbType.BigInt)); if (Ordinal.Equals(long.MinValue)) { cmd.Parameters["@Ordinal"].Value = System.DBNull.Value; } else { cmd.Parameters["@Ordinal"].Value = Ordinal; } adapter.SelectCommand = cmd; adapter.Fill(data); return(data); }