Ext.Net.Store.MakeUpdates C# (CSharp) Method

MakeUpdates() private method

private MakeUpdates ( IDataSource ds, XmlDocument xml ) : void
ds IDataSource
xml XmlDocument
return void
        private void MakeUpdates(IDataSource ds, XmlDocument xml)
        {
            XmlNodeList updatingRecords = xml.SelectNodes("records/Updated/record");
            
            string id = GetIdColumnName();

            foreach (XmlNode node in updatingRecords)
            {
                record = node;
                values = new SortedList(this.Reader.Reader.Fields.Count);
                keys = new SortedList();
                oldValues = new SortedList();

                foreach (RecordField field in this.Reader.Reader.Fields)
                {
                    XmlNode keyNode = node.SelectSingleNode(field.Name);
                    values[field.Name] = keyNode != null ? keyNode.InnerText : null;
                }

                confirmation = null;

                if (id.IsNotEmpty())
                {
                    XmlNode keyNode = node.SelectSingleNode(id);
                    string idStr = keyNode != null ? keyNode.InnerText : null;
                    
                    int idInt;

                    if (int.TryParse(idStr, out idInt))
                    {
                        keys[id] = idInt;
                    }
                    else
                    {
                        keys[id] = idStr;
                    }
                    
                    if (this.UseIdConfirmation && keys[id] != null)
                    {
                        confirmation = changingEventArgs.ConfirmationList[keys[id].ToString()];
                    }
                }

                BeforeRecordUpdatedEventArgs eBeforeRecordUpdated = new BeforeRecordUpdatedEventArgs(record, keys, values, oldValues, confirmation);
                this.OnBeforeRecordUpdated(eBeforeRecordUpdated);

                if (eBeforeRecordUpdated.CancelAll)
                {
                    break;
                }

                if (eBeforeRecordUpdated.Cancel)
                {
                    continue;
                }

                if (ds !=null)
                {
                    ds.GetView("").Update(keys, values, oldValues, this.UpdateCallback);
                }
                else
                {
                    this.UpdateCallback(0, null);
                }
                
            }
        }