public OutExecutiveType GetExecutiveType() { OutExecutiveType data = new OutExecutiveType(); try { ParametersDAO dao = new ParametersDAO(); data = dao.GetExecutiveType(); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManagerParameters", "GetExecutiveType", ex, ""); } return(data); }
public OutExecutiveType GetExecutiveType() { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutExecutiveType response = new OutExecutiveType(); var ora = new OracleServer(connectionString); ExecutiveType executiveType; List <ExecutiveType> list = new List <ExecutiveType>(); string command = string.Empty; try { command = " SELECT ind_tipo_ejecutivo, descripcion FROM BBS_LIQCOM_V_TIPO_EJECUTIVO"; var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { executiveType = new ExecutiveType(); executiveType.Code = DBNull.Value.Equals(rdr["ind_tipo_ejecutivo"]) ? 0 : double.Parse(rdr["ind_tipo_ejecutivo"].ToString()); executiveType.Name = DBNull.Value.Equals(rdr["descripcion"]) ? string.Empty : rdr["descripcion"].ToString(); list.Add(executiveType); } rdr.Close(); response.lstExecutiveType = list; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("ParametersDAO.GetExecutiveType", ex); } finally { ora.Dispose(); } return(response); }