コード例 #1
0
ファイル: LogIn.cs プロジェクト: kkms30/SmartShop
        public bool CheckLoginData(string id, string password, ref ProductsClient productsClient, ref CashierClient cashierClient, ref Cashier cashier, ref List <Product> products, ref string token)
        {
            token = TokenRequester.ReuqestToken(id, password);
            bool result = false;

            if (token != null)
            {
                cashierClient  = new CashierClient(token);
                productsClient = new ProductsClient(token);

                cashier  = cashierClient.Login(id);
                products = productsClient.GetProducts();
                result   = true;
            }
            else
            {
                result = false;
            }

            if (cashier != null && products.Count > 0 && result)
            {
                result = true;;
            }
            else
            {
                result = false;
            }
            return(result);
        }
コード例 #2
0
        static async Task Main(string[] args)
        {
            var http   = new HttpClient();
            var client = new swaggerClient("http://localhost:5001", http);

            var products = await client.ProductsAllAsync(new ProductFilter());

            foreach (var product in products)
            {
                System.Console.WriteLine(product.Name);
            }

            System.Console.WriteLine("------------");

            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .Build();

            var products_client = new ProductsClient(configuration);

            var pp = products_client.GetProducts();

            foreach (var product in pp.Products)
            {
                System.Console.WriteLine(product.Name);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: dark1981ness/WebStoreN
        static void Main(string[] args)
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .Build();

            var products_client = new ProductsClient(configuration);

            foreach (var product in products_client.GetProducts().Products)
            {
                Console.WriteLine($"{product.Name} - {product.Price}");
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .Build();

            var product_client = new ProductsClient(configuration);

            Console.WriteLine("После запуска Hosting приложения нажмите любую клавишу");
            Console.ReadKey();
            foreach (var product in product_client.GetProducts())
            {
                Console.WriteLine($"{product.Id} - {product.Name} - {product.Price}");
            }
            Console.ReadLine();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: F1ame-Dance/Part2
        static void Main(string[] args)
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .Build();

            var products_client = new ProductsClient(configuration);

            Console.WriteLine("К запросу готов!");
            Console.ReadLine();

            foreach (var product in products_client.GetProducts())
            {
                Console.WriteLine("{0} - {1}", product.Name, product.Price);
            }

            Console.WriteLine("Запрос завершён");
            Console.ReadLine();
        }