public static DataSet GetList( [SearchParameterInfo("Codigo (IdPersona)", IsAlternativePrimaryKey = true, OrderUI = 2, MiddleSize = true)] string IdPersona, //Matias 20100612 - Tarea 19 y Revision [SearchParameterInfo("Nombre", IsDescription = true, OrderUI = 1, MiddleSize = true)] string Nombre, [SearchParameterInfo("Telefonos", OrderUI = 3)] string Telefonos ) { tsh_PersonasDataset data = mz.erp.businessrules.tsh_Personas.GetList(IdPersona /*string.Empty //Matias 20100612 - Tarea 19 y Revision*/, Nombre, Telefonos); return((DataSet)data); }
public static tsh_PersonasDataset GetList(string IdPersona, string Nombre, string Telefonos) { tsh_PersonasDataset data = new tsh_PersonasDataset(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.TableMappings.Add("Table", "tsh_Personas"); SqlCommand cmd = new SqlCommand("Pr_tsh_Personas_Search", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdPersona", SqlDbType.VarChar)); if (IdPersona == "") { cmd.Parameters["@IdPersona"].Value = System.DBNull.Value; } else { cmd.Parameters["@IdPersona"].Value = IdPersona; } cmd.Parameters.Add(new SqlParameter("@Nombre", SqlDbType.VarChar)); if (Nombre == "") { cmd.Parameters["@Nombre"].Value = System.DBNull.Value; } else { cmd.Parameters["@Nombre"].Value = Nombre; } cmd.Parameters.Add(new SqlParameter("@Telefonos", SqlDbType.VarChar)); if (Telefonos == "") { cmd.Parameters["@Telefonos"].Value = System.DBNull.Value; } else { cmd.Parameters["@Telefonos"].Value = Telefonos; } adapter.SelectCommand = cmd; adapter.Fill(data); return(data); }
/// <summary> /// Envia los cambios del tsh_PersonasDataset a la base de datos. /// </summary> public static void Update(tsh_PersonasDataset dataSet) { ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber); ApplicationAssert.Check(dataSet.tsh_Personas.Rows.Count > 0, "La tabla dataSet.tsh_PersonasDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber); //Nuevo SentenciasReplicacion replication = new SentenciasReplicacion(); replication.IdConexion = Security.IdConexion; replication.SucGeneradora = Security.IdEmpresa; //Para todas las sucursales replication.Destino = null; replication.VersionBD = null; replication.NombreTabla = "dataaccess.tsa_Cuentas"; mz.erp.dataaccess.tsh_Personas.Replicacion = replication; mz.erp.dataaccess.tsh_Personas.Update(dataSet); }
public static tsh_PersonasDataset.tsh_PersonasRow GetByPk(string IdPersona) { tsh_PersonasDataset data = new tsh_PersonasDataset(); SqlCommand cmd = new SqlCommand("Pr_tsh_Personas_GetByPk", dbhelper.Connection.GetConnection()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@IdPersona", SqlDbType.VarChar)); cmd.Parameters["@IdPersona"].Value = IdPersona; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.TableMappings.Add("Table", "tsh_Personas"); adapter.Fill(data); if (data.tsh_Personas.Rows.Count == 1) { return((tsh_PersonasDataset.tsh_PersonasRow)data.tsh_Personas.Rows[0]); } return(null); }
public static tsh_PersonasDataset GetList() { tsh_PersonasDataset data = new tsh_PersonasDataset(); return(( tsh_PersonasDataset )GetList(data)); }
public static void Update(tsh_PersonasDataset dataSet) { Update(dataSet.tsh_Personas); }