public OutExecutiveLevel GetExecutiveLevel() { OutExecutiveLevel data = new OutExecutiveLevel(); try { ParametersDAO dao = new ParametersDAO(); data = dao.GetExecutiveLevel(); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManagerParameters", "GetExecutiveLevel", ex, ""); } return(data); }
public OutExecutiveLevel GetExecutiveLevel() { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutExecutiveLevel response = new OutExecutiveLevel(); var ora = new OracleServer(connectionString); ExecutiveLevel executiveLevel; List <ExecutiveLevel> list = new List <ExecutiveLevel>(); string command = string.Empty; try { command = "select bbs_liqcom_v_nivel.codigo_nivel, bbs_liqcom_v_nivel.nombre_nivel from bbs_liqcom_v_nivel "; var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { executiveLevel = new ExecutiveLevel(); executiveLevel.Code = DBNull.Value.Equals(rdr["codigo_nivel"]) ? 0 : double.Parse(rdr["codigo_nivel"].ToString()); executiveLevel.Name = DBNull.Value.Equals(rdr["nombre_nivel"]) ? string.Empty : rdr["nombre_nivel"].ToString(); list.Add(executiveLevel); } rdr.Close(); response.lstExecutiveLevel = list; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("ParametersDAO.GetExecutiveLevel", ex); } finally { ora.Dispose(); } return(response); }