public OutParamSectorGuias GetddSectorGuias() { OutParamSectorGuias data = new OutParamSectorGuias(); try { DocumentsDAO dao = new DocumentsDAO(); data = dao.GetddSectorGuias(); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManageDocuments", "GetddSectorGuias", ex, ""); } return(data); }
public OutParamSectorGuias GetddSectorGuias() { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutParamSectorGuias response = new OutParamSectorGuias(); var ora = new OracleServer(connectionString); ParamSectorGuias Secguias; response.ListSectorGuias = new List <ParamSectorGuias>(); string command = string.Empty; try { command = " select * from dlg_param_sectorGuias where ind_estado = 1 order by sector "; var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { Secguias = new ParamSectorGuias(); Secguias.secuencia = DBNull.Value.Equals(rdr["SECUENCIA"]) ? 0 : double.Parse(rdr["SECUENCIA"].ToString()); Secguias.sector = DBNull.Value.Equals(rdr["SECTOR"]) ? "" : (rdr["SECTOR"].ToString()); response.ListSectorGuias.Add(Secguias); } rdr.Close(); response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("DocumentsDAO.GetddSectorGuias", ex); } finally { ora.Dispose(); } return(response); }