//Matias - 20110906 - Tarea 0000131 public static DataRow GetByNroComprobante(string nroComprobante) { tsa_ComprobantesDataset data = new tsa_ComprobantesDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsa_Comprobantes"); SqlCommand cmd = new SqlCommand("Pr_tsa_Comprobantes_GetByNroComprobante", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@nroComprobante", SqlDbType.VarChar)); if (nroComprobante == null || nroComprobante.Equals(string.Empty)) { cmd.Parameters["@nroComprobante"].Value = System.DBNull.Value; } else { cmd.Parameters["@nroComprobante"].Value = nroComprobante; } adapter.SelectCommand = cmd; adapter.Fill(data); if (data.tsa_Comprobantes.Rows.Count == 1) { return((tsa_ComprobantesDataset.tsa_ComprobantesRow)data.tsa_Comprobantes.Rows[0]); } return(null); }
/// <summary> /// Envia los cambios del tsa_ComprobantesDataset a la base de datos. /// </summary> public static void Update(tsa_ComprobantesDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsa_Comprobantes.Rows.Count > 0, "La tabla dataSet.tsa_ComprobantesDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tsa_Comprobantes.Update(dataSet); }
public static tsa_ComprobantesDataset GetList( ) { tsa_ComprobantesDataset data = new tsa_ComprobantesDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsa_Comprobantes"); SqlCommand cmd = new SqlCommand("Pr_tsa_Comprobantes_Search", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; adapter.SelectCommand = cmd; adapter.Fill(data); return(data); }
public static tsa_ComprobantesDataset.tsa_ComprobantesRow GetByPk(string IdComprobante) { tsa_ComprobantesDataset data = new tsa_ComprobantesDataset(); SqlCommand cmd = new SqlCommand("Pr_tsa_Comprobantes_GetByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdComprobante", SqlDbType.VarChar)); cmd.Parameters["@IdComprobante"].Value = IdComprobante; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsa_Comprobantes"); adapter.Fill(data); if (data.tsa_Comprobantes.Rows.Count == 1) { return((tsa_ComprobantesDataset.tsa_ComprobantesRow)data.tsa_Comprobantes.Rows[0]); } return(null); }
public static void Update(tsa_ComprobantesDataset dataSet) { Update(dataSet.tsa_Comprobantes); }