/// <summary> /// Gets the arp. /// </summary> /// <returns></returns> public OutARP GetARP() { OutARP data = new OutARP(); try { ParametersDAO dao = new ParametersDAO(); data = dao.GetARP(); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManagerParameters", "GetARP", ex, ""); } return(data); }
/// <summary> /// Gets the arp. /// </summary> /// <returns></returns> /// <exception cref="Exception">ParametersDAO.GetARP</exception> public OutARP GetARP() { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutARP response = new OutARP(); var ora = new OracleServer(connectionString); ARP arp; List <ARP> list = new List <ARP>(); string command = string.Empty; try { command = " SELECT NIT, NOMBRE, CODIGO_MINISTERIO FROM BBS_WFC_PAR_ARP where nit> 0 "; var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { arp = new ARP(); arp.arpNIT = DBNull.Value.Equals(rdr["NIT"]) ? string.Empty : rdr["NIT"].ToString(); arp.arpName = DBNull.Value.Equals(rdr["NOMBRE"]) ? string.Empty : rdr["NOMBRE"].ToString(); arp.arpCodeMinistry = DBNull.Value.Equals(rdr["CODIGO_MINISTERIO"]) ? string.Empty : rdr["CODIGO_MINISTERIO"].ToString(); list.Add(arp); } rdr.Close(); response.lstARP = list; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("ParametersDAO.GetARP", ex); } finally { ora.Dispose(); } return(response); }