private void MakeDeletes(IDataSource ds, XmlDocument xml)
{
XmlNodeList deletingRecords = xml.SelectNodes("records/Deleted/record");
string id = GetIdColumnName();
foreach (XmlNode node in deletingRecords)
{
record = node;
values = new SortedList(0);
keys = new SortedList();
oldValues = new SortedList(0);
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()];
}
}
BeforeRecordDeletedEventArgs eBeforeRecordDeleted = new BeforeRecordDeletedEventArgs(record, keys, confirmation);
this.OnBeforeRecordDeleted(eBeforeRecordDeleted);
if (eBeforeRecordDeleted.CancelAll)
{
break;
}
if (eBeforeRecordDeleted.Cancel)
{
continue;
}
if (ds != null)
{
ds.GetView("").Delete(keys, oldValues, DeleteCallback);
}
else
{
this.DeleteCallback(0, null);
}
}
if (deletingRecords.Count > 0)
{
needRetrieve = true;
}
}