private void QueryUserList() { string strWhereCondition = GetWhereSqlString(); string strSql = @" SELECT UOL.*, ALT.DISPLAYNAME AS APP_DISPLAYNAME, AOT.DISPLAYNAME AS OP_DISPLAYNAME FROM USER_OPEATION_LOG UOL, APP_LOG_TYPE ALT, APP_OPERATION_TYPE AOT WHERE AOT.GUID = UOL.OP_GUID AND ALT.GUID = UOL.APP_GUID AND AOT.APP_GUID = ALT.GUID " + strWhereCondition + @" ORDER BY ID DESC " ; int iStart = Convert.ToInt32(_RootElement.GetAttribute("lastKey")); int iLength = Convert.ToInt32(_RootElement.GetAttribute("rows")); using (DbContext context = DbContext.GetContext(LogResource.ConnAlias)) { Database database = DatabaseFactory.Create(context); _XmlResult = InnerCommon.GetXmlDoc(database.ExecuteDataSet(CommandType.Text, strSql, iStart, iLength, "USER_OPEATION_LOG")); string strCount = @" SELECT COUNT(UOL.ID) FROM USER_OPEATION_LOG UOL WHERE 1=1 " + strWhereCondition; XmlHelper.AppendNode <string>(_XmlResult.DocumentElement, "NUMBER", database.ExecuteScalar(CommandType.Text, strCount).ToString()); } }
private void GetOpSelectList() { XmlElement root = _XmlRequest.DocumentElement; string strDisplayname = root.GetAttribute("appDisplayname"); string strSql = @"SELECT AOT.DISPLAYNAME FROM APP_LOG_TYPE ALT, APP_OPERATION_TYPE AOT WHERE AOT.APP_GUID = ALT.GUID AND AOT.VISIBLE = 'y' AND ALT.DISPLAYNAME = " + TSqlBuilder.Instance.CheckQuotationMark(strDisplayname, true); _XmlResult = InnerCommon.GetXmlDoc(InnerCommon.ExecuteDataset(strSql)); }
private void QuerySysList() { string strWhereCondition = GetWhereSqlString(); string strSql = @" SELECT USER_LOGONNAME, HOST_IP, LOG_DATE, ID, IE_VERSION, WINDOWS_VERSION, KILL_VIRUS, STATUS, HOST_NAME, USER_DISTINCTNAME FROM SYS_USER_LOGON WHERE 1=1 " + strWhereCondition + @" ORDER BY ID DESC " ; int iStart = Convert.ToInt32(_RootElement.GetAttribute("lastKey")); int iLength = Convert.ToInt32(_RootElement.GetAttribute("rows")); using (DbContext context = DbContext.GetContext(LogResource.ConnAlias)) { Database database = DatabaseFactory.Create(context); _XmlResult = InnerCommon.GetXmlDoc(database.ExecuteDataSet(CommandType.Text, strSql, iStart, iLength, "SYS_USER_LOGON")); string strCount = @" SELECT COUNT(ID) FROM SYS_USER_LOGON WHERE 1=1 " + strWhereCondition; XmlHelper.AppendNode <string>(_XmlResult.DocumentElement, "NUMBER", database.ExecuteScalar(CommandType.Text, strCount).ToString()); } }