Exemple #1
0
        public OutEPS GetEPS()
        {
            OutEPS data = new OutEPS();

            try
            {
                ParametersDAO dao = new ParametersDAO();
                data = dao.GetEPS();
            }
            catch (Exception ex)
            {
                //escribir en el log
                LogHelper.WriteLog("Models", "ManagerParameters", "GetEPS", ex, "");
            }
            return(data);
        }
Exemple #2
0
        /// <summary>
        /// Gets the eps.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception">ParametersDAO.GetEPS</exception>

        public OutEPS GetEPS()
        {
            string connectionString = DataBaseHelper.GetConnectionString("DLG");
            OutEPS response         = new OutEPS();
            var    ora = new OracleServer(connectionString);

            EPS        eps;
            List <EPS> list    = new List <EPS>();
            string     command = string.Empty;

            try
            {
                command = " SELECT  NIT, NOMBRE, CODIGO_MINISTERIO  FROM BBS_WFC_PAR_EPS where nit> 0 ";
                var rdr = ora.ExecuteCommand(command);

                while (rdr.Read())
                {
                    eps                 = new EPS();
                    eps.epsNIT          = DBNull.Value.Equals(rdr["NIT"]) ? string.Empty : rdr["NIT"].ToString();
                    eps.epsName         = DBNull.Value.Equals(rdr["NOMBRE"]) ? string.Empty : rdr["NOMBRE"].ToString();
                    eps.epsCodeMinistry = DBNull.Value.Equals(rdr["CODIGO_MINISTERIO"]) ? string.Empty : rdr["CODIGO_MINISTERIO"].ToString();
                    list.Add(eps);
                }
                rdr.Close();
                response.lstEPS           = list;
                response.msg              = new Response();
                response.msg.errorCode    = "200";
                response.msg.errorMessage = "OK";
            }
            catch (Exception ex)
            {
                throw new Exception("ParametersDAO.GetEPS", ex);
            }
            finally
            {
                ora.Dispose();
            }
            return(response);
        }