public OutParamDocuments GetLisDocuments(string documentType) { OutParamDocuments data = new OutParamDocuments(); try { ParametersDAO dao = new ParametersDAO(); data = dao.GetLisDocuments(documentType); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManagerParameters", "GetLisDocuments", ex, ""); } return(data); }
public OutParamDocuments GetLisDocuments(string documentType) { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutParamDocuments response = new OutParamDocuments(); var ora = new OracleServer(connectionString); ParamDocuments paramDocuments; List <ParamDocuments> list = new List <ParamDocuments>(); string command = string.Empty; try { command = " SELECT SECUENCIA,DESCRIPCION_DOCUMENTO,RUTA_RAIZ,NOMBRE_DOCUMENTO,TIPO_PARAMETRO,CARPETA "; command = string.Format("{0} FROM BBS_PORTAL_RUTA_IMAGENES WHERE TIPO_PARAMETRO = '{1}'", command, documentType); var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { paramDocuments = new ParamDocuments(); paramDocuments.Code = DBNull.Value.Equals(rdr["SECUENCIA"]) ? 0 : double.Parse(rdr["SECUENCIA"].ToString()); paramDocuments.Description = DBNull.Value.Equals(rdr["DESCRIPCION_DOCUMENTO"]) ? string.Empty : rdr["DESCRIPCION_DOCUMENTO"].ToString(); paramDocuments.Path = DBNull.Value.Equals(rdr["RUTA_RAIZ"]) ? string.Empty : rdr["RUTA_RAIZ"].ToString(); paramDocuments.Name = DBNull.Value.Equals(rdr["NOMBRE_DOCUMENTO"]) ? string.Empty : rdr["NOMBRE_DOCUMENTO"].ToString(); paramDocuments.DocumentType = DBNull.Value.Equals(rdr["NOMBRE_DOCUMENTO"]) ? string.Empty : rdr["NOMBRE_DOCUMENTO"].ToString(); paramDocuments.Folder = DBNull.Value.Equals(rdr["CARPETA"]) ? string.Empty : rdr["CARPETA"].ToString(); list.Add(paramDocuments); } rdr.Close(); response.lstParamDocuments = list; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("ParametersDAO.GetLisDocuments", ex); } finally { ora.Dispose(); } return(response); }