internal static AppDtm GetApplicationDataTimeInfo(string accountDomain, string applicationId) { var getAppDtmInfo = new GetAppDtmInfo(accountDomain, applicationId); XElement xml = getAppDtmInfo.Get(); // Request info var requestTime = long.Parse(xml.Element("RequestTime").Value); var requestNextAllowedTime = long.Parse(xml.Element("RequestNextAllowedTime").Value); // App info XElement appNode = xml.Element("app"); string appDbid = appNode.Attribute("id").Value; long appLastModifiedTime = long.Parse(appNode.Element("lastModifiedTime").Value); long appLastRecModTime = long.Parse(appNode.Element("lastRecModTime").Value); var appDtmInfo = new AppDtm(appDbid, appLastModifiedTime, appLastRecModTime, requestTime, requestNextAllowedTime); // Table info foreach (XElement node in xml.Element("tables").Elements("table")) { var tableId = node.Attribute("id").Value; var tableLastModifiedTime = long.Parse(node.Element("lastModifiedTime").Value); var tableLastRecModTime = long.Parse(node.Element("lastRecModTime").Value); appDtmInfo.AddTable(tableId, tableLastModifiedTime, tableLastRecModTime); } return(appDtmInfo); }
internal static AppDtm GetApplicationDataTimeInfo(string accountDomain, string applicationId) { var getAppDtmInfo = new GetAppDtmInfo(accountDomain, applicationId); var xml = getAppDtmInfo.Get().CreateNavigator(); // Request info var requestTime = long.Parse(xml.SelectSingleNode("/qdbapi/RequestTime").Value); var requestNextAllowedTime = long.Parse(xml.SelectSingleNode("/qdbapi/RequestNextAllowedTime").Value); // App info var appNode = xml.SelectSingleNode("/qdbapi/app"); var appDbid = appNode.GetAttribute("id", String.Empty); var appLastModifiedTime = long.Parse(appNode.SelectSingleNode("lastModifiedTime").Value); var appLastRecModTime = long.Parse(appNode.SelectSingleNode("lastRecModTime").Value); var appDtmInfo = new AppDtm(appDbid, appLastModifiedTime, appLastRecModTime, requestTime, requestNextAllowedTime); // Table info var tableNodes = xml.Select("/qdbapi/tables/table"); foreach (XPathNavigator node in tableNodes) { var tableId = node.GetAttribute("id", String.Empty); var tableLastModifiedTime = long.Parse(node.SelectSingleNode("lastModifiedTime").Value); var tableLastRecModTime = long.Parse(node.SelectSingleNode("lastRecModTime").Value); appDtmInfo.AddTable(tableId, tableLastModifiedTime, tableLastRecModTime); } return(appDtmInfo); }
internal static AppDtm GetApplicationDataTimeInfo(string accountDomain, string applicationId) { var getAppDtmInfo = new GetAppDtmInfo(accountDomain, applicationId); var xml = getAppDtmInfo.Get().CreateNavigator(); // Request info var requestTime = long.Parse(xml.SelectSingleNode("/qdbapi/RequestTime").Value); var requestNextAllowedTime = long.Parse(xml.SelectSingleNode("/qdbapi/RequestNextAllowedTime").Value); // App info var appNode = xml.SelectSingleNode("/qdbapi/app"); var appDbid = appNode.GetAttribute("id", String.Empty); var appLastModifiedTime = long.Parse(appNode.SelectSingleNode("lastModifiedTime").Value); var appLastRecModTime = long.Parse(appNode.SelectSingleNode("lastRecModTime").Value); var appDtmInfo = new AppDtm(appDbid, appLastModifiedTime, appLastRecModTime, requestTime, requestNextAllowedTime); // Table info var tableNodes = xml.Select("/qdbapi/tables/table"); foreach (XPathNavigator node in tableNodes) { var tableId = node.GetAttribute("id", String.Empty); var tableLastModifiedTime = long.Parse(node.SelectSingleNode("lastModifiedTime").Value); var tableLastRecModTime = long.Parse(node.SelectSingleNode("lastRecModTime").Value); appDtmInfo.AddTable(tableId, tableLastModifiedTime, tableLastRecModTime); } return appDtmInfo; }