Example #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);
        }