Exemplo n.º 1
0
        private void StorageRecord(Record rco)
        {
            XmlNode node = XMLManager.GenRecordNode(rco);

            if (node is null)
            {
                return;
            }

            if (this.record is null)
            {
                //New record
                if (XMLManager.InsertRecord(node))
                {
                    MessageBox.Show("保存成功");
                    rcoStoraged = rco;
                    Close();
                }
                else
                {
                    MessageBox.Show("保存失败");
                }
            }
            else
            {
                //Modify existing record
                if (XMLManager.ModifyRecord(node, rco.ID.ToString()))
                {
                    MessageBox.Show("保存成功");
                    rcoStoraged = rco;
                    Close();
                }
                else
                {
                    MessageBox.Show("保存失败");
                }
            }
        }