Example #1
0
        void listHelper_UpdateComplete(object sender, UpdateListItemsCompletedEventArgs e)
        {
            XElement xresults = e.Result;
            string message = "";
            int ID = 0;

            // bool containsDelete = false;
            var columns = from x in xresults.Descendants()
                          where x.Name == NSSoap + "Result"
                          select x;
            foreach (XElement row in columns)
            {
                ID = Convert.ToInt32(row.Attribute("ID").Value.HFirstHalf(","));
                RowHandler handler = CurrentlyProcessingHandlers[ID];
                RowHandler.RowStatuss newStatus = RowHandler.RowStatuss.Normal;
                string ErrorText = "";
                var errorCode = from y in row.Descendants()
                                where y.Name == NSSoap + "ErrorText"
                                select y;

                if (errorCode.Count() > 0)
                    ErrorText = errorCode.First<XElement>().Value.Replace('\n', ' ');

                if (ErrorText != "")
                    handler.ChangeRowStatus(RowHandler.RowStatuss.Errored, ErrorText);
                else
                {
                    handler.UpdateSuccessfullyComplete();
                    switch (handler.RowStatus)
                    {
                        case RowHandler.RowStatuss.Adding:
                            message = "Row successfully added";
                            handler.SetData(InitializeRow((XElement)row.LastNode));
                            break;
                        case RowHandler.RowStatuss.Deleting:
                            _excelParams.GridControl.HideRow(handler);
                            message = "Row successfully deleted";
                            newStatus = RowHandler.RowStatuss.Deleted;
                            break;
                        case RowHandler.RowStatuss.Updating:
                            message = "Row succesfully updated";
                            handler.SetData(InitializeRow((XElement)row.LastNode));
                            break;
                    }

                    handler.ChangeRowStatus(newStatus, message);
                }

                CurrentlyProcessingHandlers.Remove(ID);
            }
            _readyForNextUpdate = true;
            //     ProcessQueue();

        }
Example #2
0
        void listHelper_UpdateComplete(object sender, UpdateListItemsCompletedEventArgs e)
        {
            var columns = from x in e.Result.Descendants()
                          where x.Name == NsSoap + "Result"
                          select x;

            int iErrorCount = 0;
            foreach (XElement row in columns)
            {
                int ID = Convert.ToInt32(row.Attribute("ID").Value.Substring(0, row.Attribute("ID").Value.IndexOf(",")));
                string ErrorText = "";
                var errorCode = from y in row.Descendants()
                                where y.Name == NsSoap + "ErrorText"
                                select y;

                if (errorCode.Any())
                {
                    ErrorText = errorCode.First().Value.Replace('\n', ' ');
                }

                string currentID1 = _currentUpdateCheck[ID].FindCell(ID1).rawData.ToString();
                if (ErrorText != "")
                {
                    iErrorCount++;
                    _mainPage.AddToLog(currentID1 + ": " + ErrorText + "\n");
                }
                else
                {
                    _mainPage.AddToLog(currentID1 + ": updated successfully.\n");
                
                }
            }

            _mainPage.StatusHide();
                
            string message = "Live Update Complete\n\n";
            if (iErrorCount > 0)
                message += "There were problems updating " + iErrorCount + " tasks. Please see the log for more information.";
            else
                message += "All live tasks updated successfully.";

            MessageDialog.ShowMessage(message);
            Clear();
        }
 void svc_UpdateListItemsCompleted(object sender, UpdateListItemsCompletedEventArgs e)
 {
     //TODO: svc_UpdateListItemCompleted code here
     Deployment.Current.Dispatcher.BeginInvoke(SaveCompleteAction);
 }
Example #4
0
 void Service_UpdateListItemsCompleted(object sender, UpdateListItemsCompletedEventArgs e)
 {           
     if (UpdateComplete != null) 
         UpdateComplete(sender, e);            
 }
Example #5
0
        void ServiceParent_UpdateListItemsCompleted(object sender, UpdateListItemsCompletedEventArgs e)
        {
            Dictionary<string, object> state = (Dictionary<string, object>)e.UserState;
            if (state["Source"].ToString() == Constants.Delete)
            {
                if (e.Error == null && GetErrorText(e.Result).Length == 0) 
                {
                    SPList list = (SPList)state["List"];
                    _service.DeleteListAsync(list.Id);
                }
                else
                    if (DeleteComplete != null) DeleteComplete(sender, e);
            }
            else if (state["Source"].ToString() == Constants.Update)
            {
                if (e.Error == null && GetErrorText(e.Result).Length == 0) 
                {
                    SPList list = (SPList)state["List"];
                    UpdateList(list);
                }
                else                    
                {

                    UpdateListComplete(sender, e);
                }
            }
        }
 void svc_UpdateListItemsCompleted(object sender, UpdateListItemsCompletedEventArgs e)
 {
     //TODO: svc_UpdateListItemCompleted code here
 }
Example #7
0
        static void wslist_UpdateListItemsCompleted(object sender, UpdateListItemsCompletedEventArgs e)
        {
            SharepointListWrapper wrapper = (SharepointListWrapper)e.UserState;
            if (e.Error != null)
            {
                wrapper.Exception = e.Error;
                wrapper.RaiseCallback(false);
            }
            else
            {
                var exceptions = from r in e.Result.Elements(XName.Get("Result", Xmlns))
                                 from errorcode in r.Elements(XName.Get("ErrorCode", Xmlns))
                                 where errorcode.Value != "0x00000000"
                                 select errorcode.Parent.Element(XName.Get("ErrorText", Xmlns)).Value;
                if (exceptions.Count() > 0)
                {
                    wrapper.Exception = new Exception(string.Join("\n", exceptions.ToArray()));
                    wrapper.RaiseCallback(false);
                }
                else
                {
                    var data = (from r in e.Result.Elements(XName.Get("Result", Xmlns))
                                from d in r.Elements(XName.Get("row", Xmlnsz))
                                let item = wrapper.List.ParseData(d)
                                where item != null
                                select item);
                    wrapper.Data = data.ToDictionary(i => i.Id);

                    wrapper.RaiseCallback(true);
                }
            }
        }