public User getSessionActiveCmClient(string username) { try { sql.Append("SELECT DISTINCT VS.SID, VS.SERIAL# "); sql.Append("FROM V$SESSION VS "); sql.Append("WHERE LOWER(VS.STATUS) <> 'KILLED' "); sql.Append("AND LOWER(VS.USERNAME)='" + username + "' "); DataRow dr = ConnectionOracleDal.ExecutaSqlRetornoRegistro(sql.ToString()); User user = new User(); if (dr != null) { user.id = Convert.ToInt32(dr["SID"]); user.serial = Convert.ToInt32(dr["SERIAL#"]); } return(user); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } finally { sql.Clear(); } }
public int getCodLogradouroByIdLogradouro(int idLogradouro) { try { sql.Append("SELECT ATTR.A_VALUE FROM ARD_ATTR_RED ATTR "); sql.Append("WHERE ATTR.AT_NAME = 'COD_LOG' "); sql.Append("AND ATTR.LINK_ID = " + idLogradouro + " "); return(Convert.ToInt32(ConnectionOracleDal.ExecutaSqlRetornoRegistro(sql.ToString())["A_VALUE"])); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } finally { sql.Clear(); } }