Esempio n. 1
0
        public Result <Portal> ExportPortal(Portal portal, AccessLog log)
        {
            var result = Result <Portal> .Success();

            var error = string.Empty;

            if (Proxy.AddOrUpdateDeviceControlUnits(Config.DataSource,
                                                    Mapper.PortalId(portal.ExternalId, portal.InternalId),
                                                    Mapper.PortalName(portal.Name),
                                                    portal.ReaderCount,
                                                    Mapper.PortalNetworkAddress(portal.NetworkAddress),
                                                    Mapper.PortalType(portal.DeviceType),
                                                    Mapper.PortalCapabilities(portal.Capabilities),
                                                    Config.SysId,
                                                    ref error))
            {
                result.Entity = Factory.CreatePortal(portal.ExternalId, ExternalSystem.TrackOut);
            }
            else
            {
                result.Fail(error);
            }

            result.Entity = portal;

            return(result);
        }