Ejemplo n.º 1
0
        /// <summary>
        /// Gets the applied studies.
        /// </summary>
        /// <returns></returns>
        public OutAppliedStudies GetAppliedStudies()
        {
            OutAppliedStudies data = new OutAppliedStudies();

            try
            {
                ParametersDAO dao = new ParametersDAO();
                data = dao.GetAppliedStudies();
            }
            catch (Exception ex)
            {
                //escribir en el log
                LogHelper.WriteLog("Models", "ManagerParameters", "GetAppliedStudies", ex, "");
            }
            return(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the applied studies.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception">ParametersDAO.GetAppliedStudies</exception>

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

            AppliedStudies        studies;
            List <AppliedStudies> list = new List <AppliedStudies>();
            string command             = string.Empty;

            try
            {
                command = " SELECT DFPNES08.codigo_estudio, DFPNES08.nombre_estudio FROM DFPNES08  WHERE DFPNES08.CODIGO_ESTUDIO > 0 ";
                var rdr = ora.ExecuteCommand(command);

                while (rdr.Read())
                {
                    studies             = new AppliedStudies();
                    studies.studiesID   = DBNull.Value.Equals(rdr["codigo_estudio"]) ? 0 : int.Parse(rdr["codigo_estudio"].ToString());
                    studies.studiesName = DBNull.Value.Equals(rdr["nombre_estudio"]) ? string.Empty : rdr["nombre_estudio"].ToString();
                    list.Add(studies);
                }
                rdr.Close();
                response.lstAppliedStudies = list;
                response.msg              = new Response();
                response.msg.errorCode    = "200";
                response.msg.errorMessage = "OK";
            }
            catch (Exception ex)
            {
                throw new Exception("ParametersDAO.GetAppliedStudies", ex);
            }
            finally
            {
                ora.Dispose();
            }
            return(response);
        }