public IntegrationTest()
 {
     priceService            = new PriceService();
     scanService             = new ScanService();
     calculationService      = new CalculationService();
     totalcalculationService = new TotalCalculatorService(calculationService);
 }
Exemplo n.º 2
0
 public StartController(ILogger <MarketController> logger, IMultiTaskService multiTaskService, IBotService botService, IScanService scanService)
 {
     _logger = logger;
     this.multiTaskService = multiTaskService;
     this.botService       = botService;
     this.scanService      = scanService;
 }
 public void Dispose()
 {
     priceService            = null;
     scanService             = null;
     totalcalculationService = null;
     calculationService      = null;
 }
Exemplo n.º 4
0
 public ComputerController(IScanService scanService = null, IComputerService computerService = null, IDataBaseService dataBaseService = null)
 {
     // IOC injection
     dataBaseService  = dataBaseService ?? new DataBaseService();
     _computerService = computerService ?? new ComputerService(dataBaseService);
     _scanService     = scanService ?? new ScanService(dataBaseService, _computerService);
 }
Exemplo n.º 5
0
 public CompleteRememberViewModel(IScanService scanService, IBackService backService, IRememberService rememberService)
 {
     _scanService     = scanService;
     _backService     = backService;
     _rememberService = rememberService;
     FillCount();
 }
Exemplo n.º 6
0
        public ScanServiceTests()
        {
            _mockDataStore = MockHelper.GetMockDataStore();
            _shoppingList  = new ShoppingList();

            _scanService = new ScanService(_mockDataStore.Object, _shoppingList);
        }
Exemplo n.º 7
0
    public Facade()
    {
        //construct all the instances of relevant external libraries / systems / etc.
        scanner = new RandomScanService(0);
        printer = new ConsolePrintService();

        scanner.onRead += LevelRead;
    }
Exemplo n.º 8
0
        /// <example>
        ////    IScanService client = null;
        ////    try
        ////    {
        ////        client = ScanServiceClient.CreateProxy(Program.SCAN_IP);
        ////        var keys = Security.CreateInstance().GenerateSecurityKeys();
        ////        var list = client.ReadHistory(Program.currentUser.CountryID, Program.currentUser.UserID,
        ////            data, fromTime, toTime, keys.Item1, keys.Item2);
        ////        return list;
        ////    }
        ////    finally
        ////    {
        ////        ((IDisposable)client).DisposeSf();
        ////    }
        /// </example>
        public static IScanService CreateProxy()
        {
            ///net.tcp://localhost:8080/ReceivingServiceLib.ScanService/mex
            var          tcpBinding      = GetBinding();
            var          endpointAddress = GetEnpoint();
            IScanService proxy           = ChannelFactory <IScanService> .CreateChannel(tcpBinding, endpointAddress);

            return(proxy);
        }
Exemplo n.º 9
0
 public ApiController(IPackageService packageSvc, IScanService scanSvc, IPackageFileService packageFileSvc, IUserService userSvc, INuGetExeDownloaderService nugetExeDownloaderSvc, IConfiguration settings)
 {
     this.packageSvc = packageSvc;
     this.scanSvc = scanSvc;
     this.packageFileSvc = packageFileSvc;
     this.userSvc = userSvc;
     this.nugetExeDownloaderSvc = nugetExeDownloaderSvc;
     this.settings = settings;
 }
Exemplo n.º 10
0
 public ApiController(IPackageService packageSvc, IScanService scanSvc, IPackageFileService packageFileSvc, IUserService userSvc, INuGetExeDownloaderService nugetExeDownloaderSvc, IConfiguration settings)
 {
     this.packageSvc            = packageSvc;
     this.scanSvc               = scanSvc;
     this.packageFileSvc        = packageFileSvc;
     this.userSvc               = userSvc;
     this.nugetExeDownloaderSvc = nugetExeDownloaderSvc;
     this.settings              = settings;
 }
Exemplo n.º 11
0
 public ScanViewModel(INavigationService navigationService, IScanService scanService, IToddlerService toddlerService, ITripService tripService, ITeacherService teacherService)
 {
     scanService        = AppContainer.Resolve <IScanService>();
     toddlerService     = AppContainer.Resolve <IToddlerService>();
     tripService        = AppContainer.Resolve <ITripService>();
     teacherService     = AppContainer.Resolve <ITeacherService>();
     _navigationService = navigationService;
     _scanService       = scanService;
     _toddlerService    = toddlerService;
     _tripService       = tripService;
     _teacherService    = teacherService;
     QRScanned          = new Command(tripScan);
 }
Exemplo n.º 12
0
        public TransferFileInfo[] GetTransferFile(int countryId, int beginNumber, int endNumber, string siteCode)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                return(client.GetTransferFile(countryId, beginNumber, endNumber, siteCode, keys.Item1, keys.Item2));
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 13
0
        public void DeleteAllFilesInFolder(int folderId)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client.DeleteAllFilesInFolder(folderId, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 14
0
        public void AddFolder(int?parentId, string name)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client.AddFolder(parentId, name, Program.currentUser.CountryID, Program.currentUser.UserID, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 15
0
        public void RenameFolder(int id, string name)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client.RenameFolder(id, name, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 16
0
        public void EmailNotaDebito(List <EmailInfo> emailInfo)
        {
            IScanService client = null;

            try
            {
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client = ScanServiceClient.CreateProxy();
                client.EmailNotaDebito(emailInfo.ToArray(), keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 17
0
        public List <VoucherInfo> SelectVouchersByRetailer(int countryId, int retailerId)
        {
            IScanService client = null;

            try
            {
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client = ScanServiceClient.CreateProxy();
                return(new List <VoucherInfo>(client.ReadData(countryId, retailerId, keys.Item1, keys.Item2)));
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 18
0
        public void UpdateVouchersOrFilesBySql(string setSql, string whereCause, bool isVoucher)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client.UpdateVouchersOrFilesBySql(setSql, whereCause, isVoucher, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 19
0
        public static IScanService CreateProxy(string ip)
        {
            ///net.tcp://localhost:8080/ReceivingServiceLib.ScanService/mex
            var           endPointAddr = string.Concat("net.tcp://", ip, ":8080/ReceivingServiceLib.ScanService");
            NetTcpBinding tcpBinding   = new NetTcpBinding();

            tcpBinding.TransactionFlow = false;
            tcpBinding.Security.Transport.ProtectionLevel      = ProtectionLevel.None;
            tcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None;
            tcpBinding.Security.Mode = SecurityMode.None;
            EndpointAddress endpointAddress = new EndpointAddress(endPointAddr);
            IScanService    proxy           = ChannelFactory <IScanService> .CreateChannel(tcpBinding, endpointAddress);

            return(proxy);
        }
Exemplo n.º 20
0
        public void DeleteFile(int id, bool isVoucher)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client.DeleteFile(id, isVoucher, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 21
0
        public fileInfo[] ReadFileList(int folderId, int from)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                var list = client.SelectFilesByFolder2(folderId, from, Program.ITEMS_SHOWN, keys.Item1, keys.Item2);
                return(list);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 22
0
        public fileInfo[] SelectVouchersByNumber(int countryId, int voucherId)
        {
            IScanService client = null;

            try
            {
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client       = ScanServiceClient.CreateProxy();
                string where = string.Format("[iso_id] = {0} and [v_number] = {1}", countryId, voucherId);
                return(client.SelectFilesBySql(where, keys.Item1, keys.Item2));
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 23
0
        public void SaveHistory(OperationHistory operationType, Guid operationId,
                                int brIsoId, int brId, int vId, int v2Id, int count, string details, Tuple <string, string> keys)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                client.SaveHistory(Program.currentUser.CountryID, Program.currentUser.UserID, operationType, operationId, brIsoId, brId, vId, v2Id, count, details,
                                   keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 24
0
        public fileInfo[] SelectFilesBySql(string whereCause)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                var list = client.SelectFilesBySql(whereCause, keys.Item1, keys.Item2);
                return(list);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 25
0
        public file2Info[] ReadCoverList(int folderId)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                var list = client.SelectCoversByFolder(folderId, keys.Item1, keys.Item2);
                return(list);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 26
0
        public FolderInfo[] ReadFolderList(int?parentId, int countryId)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                var list = client.SelectFoldersByParent(parentId, countryId, keys.Item1, keys.Item2);
                return(list);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 27
0
        public HistoryByCountryInfo[] ReadHistory(OperationHistory data, DateTime fromTime, DateTime toTime)
        {
            IScanService client = null;

            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_URL);
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                var list = client.ReadHistory(Program.currentUser.CountryID, Program.currentUser.UserID,
                                              data, fromTime, toTime, keys.Item1, keys.Item2);
                return(list);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 28
0
        public ScanResultViewModel(IScanService scanService, INavigationService navigationService, IMealDataService mealService, IUserDataService userService, IMenuDataService menuService)
        {
            _scanService       = scanService;
            _mealService       = mealService;
            _navigationService = navigationService;
            _userService       = userService;
            _menuService       = menuService;

            ScannedUsers        = new List <ScannedUser>();
            ScannedMeals        = new List <ScannedMeal>();
            FilterdScannedMeals = new List <ScannedMeal>();

            ScannedPerson = new User();

            ICommand setupCommand = new Command(async() => await ScanMealAndPerson());

            setupCommand.Execute(null);
        }
Exemplo n.º 29
0
        public ApiController(IPackageService packageSvc, IScanService scanSvc, IPackageFileService packageFileSvc, IUserService userSvc, INuGetExeDownloaderService nugetExeDownloaderSvc, IConfiguration settings)
        {
            this.packageSvc            = packageSvc;
            this.scanSvc               = scanSvc;
            this.packageFileSvc        = packageFileSvc;
            this.userSvc               = userSvc;
            this.nugetExeDownloaderSvc = nugetExeDownloaderSvc;
            this.settings              = settings;

            var forbiddenPackageNames = Configuration.ReadAppSettings("ForbiddenPackageNames");

            if (!string.IsNullOrWhiteSpace(forbiddenPackageNames))
            {
                foreach (var forbiddenPackageName in forbiddenPackageNames.Split(new [] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    _forbiddenPackageNames.Add(forbiddenPackageName.to_string().Trim());
                }
            }
        }
Exemplo n.º 30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="countryId"></param>
        /// <param name="officeId"></param>
        /// <param name="date"></param>
        /// <param name="invoiceNumber"></param>
        /// <param name="format">ATOM, HTML4.0, MHTML, IMAGE, EXCEL, WORD, CSV, PDF, XML</param>
        /// <param name="outputFormat">&OutputFormat=JPEG&</param>
        /// <returns></returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms152835.aspx</remarks>
        /// <remarks>http://msdn.microsoft.com/en-us/library/hh231593.aspx</remarks>
        public byte[] DownloadNotaDebitoReport(int countryId, int officeId, DateTime date, int invoiceNumber, string format = "PDF", string moreOptions = "")
        {
            //02/12/2013
            string uri = string.Format("http://192.168.53.144/Reportserver/Pages/ReportViewer.aspx?%2fNota+Debito%2fNota+Debito+0032&rs:Command=Render&rs:format={4}{5}&iso_id={0}&Office={1}&in_date={2:dd/MM/yyyy}&invoicenumber={3}",
                                       countryId, officeId, date, invoiceNumber, format, moreOptions);

            IScanService client = null;

            try
            {
                var keys = Security.CreateInstance().GenerateSecurityKeys();
                client = ScanServiceClient.CreateProxy();
                byte[] data = client.DownloadReport(uri, keys.Item1, keys.Item2);
                return(data);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
        }
Exemplo n.º 31
0
        public void LogOperation(OperationHistory operation, Guid session, int countryId, int branchId, int voucherId,
                                 int voucher2Id = 0, int count = 0, string message = null)
        {
#if SCANNING
            IScanService client = null;
            try
            {
                client = ScanServiceClient.CreateProxy(Program.SCAN_IP);
                var keys = Security.CreateInstance().GenerateSecurityKeys();


                client.SaveHistory(Program.currentUser.CountryID, Program.currentUser.UserID,
                                   operation, session, countryId, branchId, voucherId, voucher2Id, count, message, keys.Item1, keys.Item2);
            }
            finally
            {
                ((IDisposable)client).DisposeSf();
            }
#endif
        }