Пример #1
0
        public bool CheckRequestsAndCommitChanges(BasicNodeViewModel fromForm, DatabaseRequest fromDatabase)
        {
            bool result = true;

            //try
            //{
            DatabaseDriver systemDriver = new DatabaseDriver();

            if (fromDatabase.RequestType == DatabaseRequestType.Create)
            {
                systemDriver.AddNode(fromForm.ToModel());
            }
            else if (fromDatabase.RequestType == DatabaseRequestType.Update)
            {
                systemDriver.UpdateNode(fromForm.ToModel());
            }
            else if (fromDatabase.RequestType == DatabaseRequestType.Delete)
            {
                systemDriver.DeleteNode(fromForm.Id);
            }
            //}
            //catch
            //{
            //    result = false;
            //}

            return(result);
        }
Пример #2
0
        private static void PushData(List <BasicNodeModel> list)
        {
            // The data has been mapped and
            DatabaseDriver driver = new DatabaseDriver();

            // Add each of the nodes
            foreach (BasicNodeModel model in list)
            {
                // Add the node
                driver.AddNode(model);
            }
        }