Пример #1
0
        public bool PostOldSessions(string currentSessionId)
        {
            IList <string> cachedDirectories = CacheProcessor.GetCachedSessionFolders();

            if (cachedDirectories.Count <= 0)
            {
                return(true);
            }

            foreach (string cachedDirectory in cachedDirectories)
            {
                NameValueCollection postParams = null;
                string dirName = (new DirectoryInfo(cachedDirectory)).Name;
                if (currentSessionId.Equals(dirName))
                {
                    continue;
                }

                LogController.GetInstance().LogData(LogController.
                                                    GetInstance().LogFormat.GetNetworkLine("Data Uploading"));
                string response = PrepareDataAndPostSession(dirName, false, ref postParams);

                if (response.Equals("EMPTY_FOLDER"))
                {
                    LogController.GetInstance().LogData(LogController.
                                                        GetInstance().LogFormat.GetNetworkLine(string.Format("\"{0}\"", response)));
                }
                else
                {
                    LogController.GetInstance().LogData(LogController.
                                                        GetInstance().LogFormat.GetNetworkLine(string.Format("Server Reply \"{0}\"", response)));
                }

                AnalizePostResponse(response, dirName, null);
            }
            return(true);
        }