示例#1
0
文件: XmlDb.cs 项目: skepee/XmlDb
        public void UpdateItem(string tableName, Dictionary <string, string> myCurrentData, Dictionary <string, string> myNewData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                xmldt.Update(myCurrentData, myNewData);
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }

            if (LogDataObject != null)
            {
                AddLogItem(myNewData, "update", tableName);
            }
        }
示例#2
0
文件: XmlDb.cs 项目: skepee/XmlDb
        public void RemoveItem(string tableName, Dictionary <string, string> myData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                xmldt.Remove(myData);
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }

            if (LogDataObject != null)
            {
                AddLogItem(myData, "remove", tableName);
            }
        }
示例#3
0
文件: XmlDb.cs 项目: skepee/XmlDb
        public void AddListItem(string tableName, List <Dictionary <string, string> > myData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                foreach (var item in myData)
                {
                    AddItem(tableName, item);

                    if (LogDataObject != null)
                    {
                        AddLogItem(item, "add", tableName);
                    }
                }
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }
        }