Ejemplo n.º 1
0
        public static void DeleteNode(NodeDto pNode, out Result pResult)
        {
            pResult = new Result();
            using (var _db = new Rbr_Db()) {
                _db.BeginTransaction();
                try {
                    if (pNode.NodeId == (new CurrentNode()).Id)
                    {
                        throw new Exception("Cannot Delete Current Node.");
                    }
                    //LoadBalancingMapManager.Delete(_db, pNode);
                    var _nodeRow = MapToNodeRow(pNode);
                    PlatformManager.DeleteNode(_db, _nodeRow);

                    _db.CommitTransaction();
                }
                catch (Exception _ex) {
                    _db.RollbackTransaction();
                    pResult.Success      = false;
                    pResult.ErrorMessage = _ex.Message;
                    TimokLogger.Instance.LogRbr(LogSeverity.Critical, "PlatformController.DeleteNode", string.Format("Exception:\r\n{0}", _ex));
                }
            }
        }