/// <summary> /// Envia los cambios del tsh_DocumentosDataset a la base de datos. /// </summary> public static void Update(tsh_DocumentosDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsh_Documentos.Rows.Count > 0, "La tabla dataSet.tsh_DocumentosDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tsh_Documentos.Update(dataSet); }
public static tsh_DocumentosDataset.tsh_DocumentosRow GetByPk(string IdDocumento) { tsh_DocumentosDataset data = new tsh_DocumentosDataset(); SqlCommand cmd = new SqlCommand("Pr_tsh_Documentos_GetByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdDocumento", SqlDbType.VarChar)); cmd.Parameters["@IdDocumento"].Value = IdDocumento; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsh_Documentos"); adapter.Fill(data); if (data.tsh_Documentos.Rows.Count == 1) { return((tsh_DocumentosDataset.tsh_DocumentosRow)data.tsh_Documentos.Rows[0]); } return(null); }
public static tsh_DocumentosDataset GetList(string IdDocumento, long IdTipoArchivo, long IdClaseDocumento, string Descripcion, long Tamanio, byte[] Documento, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdSucursal, long IdEmpresa) { tsh_DocumentosDataset data = new tsh_DocumentosDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsh_Documentos"); SqlCommand cmd = new SqlCommand("Pr_tsh_Documentos_Search", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdDocumento", SqlDbType.VarChar)); cmd.Parameters["@IdDocumento"].Value = IdDocumento; cmd.Parameters.Add(new SqlParameter("@IdTipoArchivo", SqlDbType.BigInt)); cmd.Parameters["@IdTipoArchivo"].Value = IdTipoArchivo; cmd.Parameters.Add(new SqlParameter("@IdClaseDocumento", SqlDbType.BigInt)); cmd.Parameters["@IdClaseDocumento"].Value = IdClaseDocumento; cmd.Parameters.Add(new SqlParameter("@Descripcion", SqlDbType.VarChar)); cmd.Parameters["@Descripcion"].Value = Descripcion; cmd.Parameters.Add(new SqlParameter("@Tamanio", SqlDbType.BigInt)); cmd.Parameters["@Tamanio"].Value = Tamanio; cmd.Parameters.Add(new SqlParameter("@Documento", SqlDbType.Image)); cmd.Parameters["@Documento"].Value = Documento; cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime)); cmd.Parameters["@FechaCreacion"].Value = FechaCreacion; cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt)); 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)); cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion; cmd.Parameters.Add(new SqlParameter("@IdReservado", SqlDbType.BigInt)); cmd.Parameters["@IdReservado"].Value = IdReservado; cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier)); cmd.Parameters["@RowId"].Value = RowId; cmd.Parameters.Add(new SqlParameter("@IdSucursal", SqlDbType.BigInt)); cmd.Parameters["@IdSucursal"].Value = IdSucursal; cmd.Parameters.Add(new SqlParameter("@IdEmpresa", SqlDbType.BigInt)); cmd.Parameters["@IdEmpresa"].Value = IdEmpresa; adapter.SelectCommand = cmd; adapter.Fill(data); return(data); }
public static tsh_DocumentosDataset GetList() { tsh_DocumentosDataset data = new tsh_DocumentosDataset(); return(( tsh_DocumentosDataset )GetList(data)); }
public static void Update(tsh_DocumentosDataset dataSet) { Update(dataSet.tsh_Documentos); }