Exemple #1
0
        public void RefreshEmployees()
        {
            List <Entity> entities = new List <Entity>();

            entities.AddRange(employees);
            byte[]          recentVersion = AdditionalTools.GetMaxTimestamp(entities);
            EmployeePack    pack          = App.proxy.GetAllEmployees(recentVersion);
            List <Employee> employeesBuf  = new List <Employee>();

            employeesBuf.AddRange(employees);
            if (!UpdateEmployeesBufByPack(pack, employeesBuf))
            {
                TrimEmployees(employeesBuf);
            }
            UploadFromEmployeesBuf(employeesBuf);
        }
Exemple #2
0
        protected void UpdateMessages(FolderType folderType, MessageTypes messageTypes, List <Message> messages)
        {
            List <Entity> entities = new List <Entity>();

            entities.AddRange(messages);
            byte[]         recentVersion = AdditionalTools.GetMaxTimestamp(entities);
            MessagesPack   pack          = App.proxy.GetMessages(folderType, messageTypes, recentVersion);
            List <Message> messagesBuf   = new List <Message>();

            messagesBuf.AddRange(messages);
            if (!UpdateMessagesByPack(pack, messagesBuf))
            {
                TrimMessages(messagesBuf, folderType, messageTypes);
            }
            UploadFromMessagesBuf(messages, messagesBuf);
        }