public object mtdlistararp(string Arp = "") { string sql = ""; if (Arp != "") { sql = "Select * From ARP Where ARP = '" + Arp + "'"; } else { sql = "Select * From ARP"; } DataTable tblARP = new DataTable(); conexion = conex.mtdconexion(); adaparp = new SqlDataAdapter(sql, conexion); conexion.Open(); adaparp.Fill(tblARP); conexion.Close(); List <EClARP> lista = new List <EClARP>(); foreach (DataRow fila in tblARP.Rows) { EClARP objEarp = new EClARP(); objEarp.IdARP = int.Parse(fila["IdARP"].ToString()); objEarp.ARP = fila["ARP"].ToString(); lista.Add(objEarp); } return(lista); }
public int mtdARP(EClARP objEARP) { string agregar = "Select Into ARP (ARP) values ('" + objEARP.ARP + "')"; conexion = conex.mtdconexion(); cmdarp = new SqlCommand(agregar, conexion); conexion.Open(); int reg = cmdarp.ExecuteNonQuery(); conexion.Close(); return(reg); }
public object mtddatos(EClARP objARP) { return(objDARP.mtdARP(objARP)); }