-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
53 lines (51 loc) · 1.72 KB
/
Copy pathProgram.cs
File metadata and controls
53 lines (51 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using SimpleHttp;
namespace CyberGardenFIrst
{
internal class Program
{
static void Main(string[] args)
{
//Авторизация в панель
AdminPoint AP = new AdminPoint();
Console.Write("WhoOoOo are you? : ");
AP.Name = Console.ReadLine();
Console.Write("Tell me our password, little boy : ");
AP.Password = Console.ReadLine();
//Синхронизация с БД
if (AP.CheckLog(AP) == true)
{
Console.WriteLine($"Welcome, {AP.Role}: {AP.Name}. Time of Log: {AP.LoginTime}");
Console.WriteLine($"Trying connection: {DateTime.Now}");
}
SQLConnection SQLcon = new SQLConnection();
SQLcon = SQLcon.MakeSomeSettings();
//Прогрузка HttpListener
Route.Add("/", (req, res, props) =>
{
res.AsText("Osmire (two).");
});
Route.Add("/users/{id}", (req, res, props) =>
{
res.AsText($"Client ID: {props["id"]}");
});
Route.Add("/{id}", (req, res, props) =>
{
res.AsText(SQLcon.FindBigSales(props["id"]));
});
Route.Add("/topmerchant", (req, res, props) =>
{
SQLcon.TopOfMerchants();
res.AsText($"Client ID: {props["id"]}");
});
HttpServer.ListenAsync(80, CancellationToken.None, Route.OnHttpRequestAsync).Wait();
}
}
}