예제 #1
0
        public IActionResult InfoServiceDemo()
        {
            InfoService svc = new InfoService();

            ViewData["Url"] = svc.GetUrl();
            return(View("Index"));
        }
예제 #2
0
 public HelpComponent(List <IGraphicObject> objects, SpriteBatch sbatch)
 {
     _info      = new InfoService("HELP", 7);
     _processor = new HelpProcessor();
     _updater   = new HelpUpdater(_info);
     _renderer  = new HelpRenderer(objects, sbatch, _info);
 }
예제 #3
0
 public HelpRenderer(List <IGraphicObject> objects, SpriteBatch sbatch, InfoService info)
 {
     _info    = info;
     _sbatch  = sbatch;
     _objects = objects;
     Hovering = -1;
 }
예제 #4
0
        protected override void AdditionalSetup()
        {
            _fixture = new Fixture().Customize(new AutoMoqCustomization());
            _fixture.Register <IReachability>(() => Mock.Of <IReachability>(r => r.IsConnected() == true));

            _mobileData            = _fixture.Create <MobileData>();
            _mobileData.GroupTitle = "Run1010";

            _infoService = _fixture.Create <InfoService>();
            _fixture.Inject <IInfoService>(_infoService);

            _mockApplicationProfile = _fixture.InjectNewMock <IApplicationProfileRepository>();
            List <ApplicationProfile> appProfiles = new List <ApplicationProfile>();
            ApplicationProfile        appProfile  = new ApplicationProfile();

            appProfile.DisplayRetention = 2;
            appProfile.DisplaySpan      = 2;
            appProfiles.Add(appProfile);

            _mockApplicationProfile.Setup(map => map.GetAllAsync()).ReturnsAsync(appProfiles);

            _mobileDataRepoMock = _fixture.InjectNewMock <IMobileDataRepository>();

            _fixture.Inject <IRepositories>(_fixture.Create <Repositories>());

            _mockMessenger = Ioc.RegisterNewMock <IMvxMessenger>();
            _mockMessenger.Setup(m => m.Unsubscribe <GatewayInstructionNotificationMessage>(It.IsAny <MvxSubscriptionToken>()));
            _mockMessenger.Setup(m => m.Subscribe(It.IsAny <Action <GatewayInstructionNotificationMessage> >(), It.IsAny <MvxReference>(), It.IsAny <string>())).Returns(_fixture.Create <MvxSubscriptionToken>());

            _mockCheckForSoftwareUpdates = Ioc.RegisterNewMock <ICheckForSoftwareUpdates>();

            _mockNavigationService = _fixture.InjectNewMock <INavigationService>();
            Ioc.RegisterSingleton <INavigationService>(_mockNavigationService.Object);
        }
예제 #5
0
 public CreditsComponent(List <IGraphicObject> objects, SpriteBatch sbatch)
 {
     _info      = new InfoService("CREDITS", 7);
     _processor = new CreditsProcessor();
     _updater   = new CreditsUpdater(_info);
     _renderer  = new CreditsRenderer(objects, sbatch, _info);
 }
예제 #6
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <param name="url">
        ///     Video/playlist to retrieve information about
        /// </param>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public DownloadInfo GetDownloadInfo(string url)
        {
            this.semaphore.Wait();
            DownloadInfo info = InfoService.GetDownloadInfo(this, url);

            this.semaphore.Release();
            return(info);
        }
예제 #7
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public DownloadInfo GetDownloadInfo()
        {
            this.semaphore.Wait();
            DownloadInfo info = InfoService.GetDownloadInfo(this, downloadTokenSource.Token);

            this.semaphore.Release();
            return(info);
        }
예제 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="tokenDto"></param>
 public NotaCreditoBusiness(TokenDto tokenDto)
 {
     this.token         = tokenDto;
     externosRepository = new InformacionServiciosExternosRepository();
     infoService        = externosRepository.ObtenerInfoServicioExterno(20);
     proxy = new ProxyNotaCredito.wsNotaCreditoSoapClient();
     proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(infoService.UrlService);
 }
예제 #9
0
 public void Setup(IGameState gameState)
 {
     _info = new InfoService("CREDITS", 7);
     _updater.RefreshService(_info);
     _renderer.RefreshService(_info);
     _processor.RefreshService();
     _processor.Hovering = -1;
 }
예제 #10
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public async Task <DownloadInfo> GetDownloadInfoAsync()
        {
            await this.semaphore.WaitAsync();

            DownloadInfo info = await InfoService.GetDownloadInfoAsync(this, downloadTokenSource.Token);

            this.semaphore.Release();
            return(info);
        }
예제 #11
0
 public Menu(Service service, Settings settings, InfoService infoService)
 {
     this.service     = service;
     this.settings    = settings;
     this.infoService = infoService;
     settings.EducationalFactorInfoSwitch(DisplayMessage);
     settings.EducationalMesSwitch(DisplayMessage);
     settings.StudentInfoSwitch(DisplayMessage);
 }
예제 #12
0
 /// <summary>
 /// Constructor por default
 /// </summary>
 public AdministracionVentaEmpleadoBusiness()
 {
     inforService       = new InfoService();
     externosRepository = new InformacionServiciosExternosRepository();
     inforService       = externosRepository.ObtenerInfoServicioExterno(15);
     proxy = new ProxyVentaEmpleado.wsVentaEmpleadoSoapClient();
     proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
     this.repositorio       = new AdministracionVentaEmpleadoRepository();
 }
예제 #13
0
 /// <summary>
 /// Repositorio de lectura luz
 /// </summary>
 public LecturaLuzBusiness(TokenDto tokenDto)
 {
     lecturaLuzRepository = new LecturaLuzRepository();
     this.token           = tokenDto;
     externosRepository   = new InformacionServiciosExternosRepository();
     infoService          = externosRepository.ObtenerInfoServicioExterno(21);
     proxy = new ProxyCapturaLuz.wsCapturaDeLuzSoapClient();
     proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(infoService.UrlService);
 }
예제 #14
0
 /// <summary>
 /// Constructor por Default
 /// </summary>
 /// <param name="tokenDto"></param>
 public RedencionCuponPromocionalBusiness(TokenDto tokenDto)
 {
     token                         = tokenDto;
     repository                    = new CuponesRedimirRepository();
     externosRepository            = new InformacionServiciosExternosRepository();
     infoService                   = externosRepository.ObtenerInfoServicioExterno(23);
     proxyCupones                  = new ProxyCupones.wsCuponesSoapClient();
     proxyCupones.Endpoint.Address = new System.ServiceModel.EndpointAddress(infoService.UrlService);
 }
예제 #15
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <param name="url">
        ///     Video/playlist to retrieve information about
        /// </param>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public DownloadInfo GetDownloadInfo(string url)
        {
            this.semaphore.Wait();
            this.UpdateExecutable().Wait();
            DownloadInfo info = InfoService.GetDownloadInfo(this, url, downloadTokenSource.Token);

            this.semaphore.Release();
            return(info);
        }
예제 #16
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <param name="url">
        ///     Video/playlist to retrieve information about
        /// </param>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public async Task <DownloadInfo> GetDownloadInfoAsync(string url)
        {
            await this.semaphore.WaitAsync();

            DownloadInfo info = await InfoService.GetDownloadInfoAsync(this, url);

            this.semaphore.Release();
            return(info);
        }
예제 #17
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length == 0)
                {
                    throw new WrongCommandLineArguments("Arguments are not specified.");
                }
                switch (args[0].Substring(1))
                {
                case "s":
                    if (args.Length < 2)
                    {
                        throw new WrongCommandLineArguments("Folder path is not specified.");
                    }
                    EstimatingService.EstimateWorkToSave(@args[1]);
                    if (args.Length < 3)
                    {
                        SavingService.Save(@args[1], null);
                    }
                    else
                    {
                        SavingService.Save(@args[1], @args[2]);
                    }
                    break;

                case "u":
                    if (args.Length < 2)
                    {
                        throw new WrongCommandLineArguments("File path is not specified.");
                    }
                    EstimatingService.EstimateWorkToUnpack(@args[1]);
                    if (args.Length < 3)
                    {
                        UnpackingService.Unpack(@args[1], null);
                    }
                    else
                    {
                        UnpackingService.Unpack(@args[1], @args[2]);
                    }
                    break;

                default:
                    throw new WrongCommandLineArguments("Arguments are not recognized.");
                }
            }
            catch (WrongCommandLineArguments e)
            {
                InfoService.ShowErrorMessage(e.Message);
                InfoService.ShowHelpMessage();
            }
            catch (Exception e)
            {
                InfoService.ShowErrorMessage(e.Message);
            }
        }
예제 #18
0
 public InfoController(InfoService infoService, LinkService linkService, NewsService newsService,
                       ProjectService projectService, PublicationService publicationService, PersonService personService)
 {
     _infoService        = infoService;
     _linkService        = linkService;
     _newsService        = newsService;
     _publicationService = publicationService;
     _personService      = personService;
     _projectService     = projectService;
 }
예제 #19
0
        static void Main(string[] args)
        {
            IUniversity   university   = new University();
            IService      service      = new Service(university);
            IInfoService  infoService  = new InfoService(university);
            IEventService eventService = new EventManager(university.GroupRating, university.Subjects);
            Menu          menu         = new Menu(service, infoService, eventService);

            menu.MainMenu();
        }
예제 #20
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="token"></param>
        public AdministracionContraseniaBusiness(TokenDto token)
        {
            InformacionServiciosExternosRepository externosRepository = new InformacionServiciosExternosRepository();
            InfoService inforService = new InfoService();

            inforService           = externosRepository.ObtenerInfoServicioExterno(13);
            proxy                  = new ProxyCambioContrasenia.wsCambioPasswordSoapClient();
            proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
            this.token             = token;
        }
예제 #21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="token"></param>
 public MayoristasBusiness(TokenDto token)
 {
     this.token                 = token;
     repository                 = new MayoristaRepository();
     inforService               = new InfoService();
     externosRepository         = new InformacionServiciosExternosRepository();
     inforService               = externosRepository.ObtenerInfoServicioExterno(17);
     wsVentaMayoristaSoapClient = new ProxyMayoristas.wsVentaMayoristaSoapClient();
     wsVentaMayoristaSoapClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
 }
예제 #22
0
        static void Main(string[] args)
        {
            University  university  = new University();
            Service     service     = new Service(university);
            InfoService infoService = new InfoService(university);
            Settings    settings    = new Settings(university);
            Menu        menu        = new Menu(service, settings, infoService);

            menu.MainMenu();
        }
예제 #23
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="token"></param>
 public TarjetaRegalosBusiness(TokenDto token)
 {
     inforService       = new InfoService();
     externosRepository = new InformacionServiciosExternosRepository();
     inforService       = externosRepository.ObtenerInfoServicioExterno(16);
     proxy = new ProxyTarjetasRegalo.wsTarjetasRegaloSoapClient();
     proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
     repository             = new TarjetasRegaloRepository();
     this.token             = token;
 }
예제 #24
0
        public TipoCambioResponse GetTipoCambio(TipoCambioRequest tipoCambioRequest)
        {
            TipoCambioResponse tipoCambioResponse = new TipoCambioResponse();
            CambioDivisaMilano cambio             = new CambioDivisaMilano();
            InfoService        inforService       = externosRepository.ObtenerInfoServicioExterno(14);

            cambio = GetTipoCambioLocal(tipoCambioRequest);
            string  codigoRespuesta = "000";
            decimal valorCambio     = 0;

            if (tipoCambioRequest.CodigoTipoDivisa == "US")
            {
                //Inicializamos el proxy que nos ayudara a hacer la llamada al metodo de Sale
                ProxyTipoCambio.Service1SoapClient proxy = new ProxyTipoCambio.Service1SoapClient();
                proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
                string xml = "<ExchangeRateRequest><credentials><username>{0}</username>"
                             + "<password>{1}</password><clientCode>{2}</clientCode></credentials>" +
                             "<exchangeInfo><currencyCode>{3}</currencyCode></exchangeInfo></ExchangeRateRequest> ";
                xml = string.Format(xml, this.credenciales.UserName, this.credenciales.Password, "", cambio.CodigoExterno);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xml);
                XmlNode result = proxy.GetRate(doc);
                codigoRespuesta = result.ChildNodes[0].ChildNodes[0].InnerText;
                if (codigoRespuesta == "000")
                {
                    if (!cambio.UsarMaximoValor)
                    {
                        valorCambio = decimal.Round(Convert.ToDecimal(result.ChildNodes[1].ChildNodes[5].ChildNodes[0].InnerText), 2);
                    }
                    else
                    {
                        valorCambio = decimal.Round(Convert.ToDecimal(result.ChildNodes[1].ChildNodes[5].ChildNodes[1].InnerText), 2);
                    }
                }
                else
                {
                    throw new Exception(result.InnerText);
                }
            }
            else
            {
                valorCambio = cambio.ValorCambio;
            }
            if (valorCambio > 0)
            {
                tipoCambioResponse.Mensaje = "Ok";
                tipoCambioResponse.TasaConversionVigente = valorCambio;
                tipoCambioResponse.ImporteMonedaNacional = tipoCambioRequest.ImporteMonedaNacional;
                // Ajuste para redondear a modo de cubrir el monto mínimo
                decimal multiplicador = Convert.ToDecimal(Math.Pow(10, Convert.ToDouble(2)));
                tipoCambioResponse.ImporteMonedaExtranjera = Math.Ceiling((tipoCambioRequest.ImporteMonedaNacional / valorCambio) * multiplicador) / multiplicador;
                // Ajuste para redondear a modo de cubrir el monto mínimo
            }
            return(tipoCambioResponse);
        }
예제 #25
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="token"></param>
 public FinlagBusiness(TokenDto token)
 {
     infoService                 = new InfoService();
     externosRepository          = new InformacionServiciosExternosRepository();
     paymentProcessingRepository = new PaymentProcessingRepository();
     finlagRepository            = new FinlagRepository();
     infoService                 = externosRepository.ObtenerInfoServicioExterno(22);
     proxy = new ProxyFinlag.VentasMilanoSoapClient();
     proxy.Endpoint.Address = new System.ServiceModel.EndpointAddress(infoService.UrlService);
     this.token             = token;
 }
예제 #26
0
        public IActionResult Get([FromBody] Info info)
        {
            var service = new InfoService(_mapper);//The Constructer in "InfoService" required _mapper
            var mapping = service.MapData(info);

            if (mapping.Equals(true))
            {
                return(Ok(mapping));   //Mapping went good
            }
            return(BadRequest(false)); //There is something Wrong
        }
예제 #27
0
        /// <summary>
        ///     Get information about the video/playlist before downloading
        /// </summary>
        /// <param name="url">
        ///     Video/playlist to retrieve information about
        /// </param>
        /// <returns>
        ///     Object representing the information of the video/playlist
        /// </returns>
        public async Task <DownloadInfo> GetDownloadInfoAsync(string url)
        {
            await this.semaphore.WaitAsync();

            await this.UpdateExecutable();

            DownloadInfo info = await InfoService.GetDownloadInfoAsync(this, url, downloadTokenSource.Token);

            this.semaphore.Release();
            return(info);
        }
예제 #28
0
        private void BindcboNguoiPheDuyet()
        {
            IInfoService InfoService;

            InfoService = (InfoService)ObjectFactory.GetObject("InfoService");
            IList <Info> lstInfo = InfoService.GetLikeMa("p_NguoiPheDuyet");

            foreach (Info obj in lstInfo)
            {
                cboNguoiPheDuyet.Properties.Items.Add(obj.GiaTri);
            }
        }
예제 #29
0
        public static void ObserverDemo()
        {
            InfoService service = new InfoService();
            Student     s1      = new Student("Hadzira", "Dervisevic");
            Student     s2      = new Student("John", "Smith");

            service.Subscribe(s1);
            service.Subscribe(s2);
            service.AddEvent("Some new event 1");
            service.AddEvent("Some new event 2");
            Console.WriteLine("-------------------------------");
        }
예제 #30
0
 /// <summary>
 /// Constructor de tiempo aire
 /// </summary>
 public TiempoAireBusiness(TokenDto token)
 {
     this.token                = token;
     credenciales              = new CredencialesServicioExterno();
     credenciales              = new InformacionServiciosExternosBusiness().ObtenerCredencialesTiempoAire();
     inforService              = new InfoService();
     externosRepository        = new InformacionServiciosExternosRepository();
     inforService              = externosRepository.ObtenerInfoServicioExterno(11);
     transact                  = new ProxyTiempoAire.transactSoapClient();
     transact.Endpoint.Address = new System.ServiceModel.EndpointAddress(inforService.UrlService);
     repository                = new PagoServiciosRepository(this.token);
 }