Esempio n. 1
0
        public void CreateCassandraTables()
        {
            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();
            clnTrack.CreateTables();
        }
Esempio n. 2
0
        public void DropCassandraTables()
        {
            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();
            clnTrack.DropTables();
        }
Esempio n. 3
0
        private void GoToOrder(int flightId, bool isOrder)
        {
            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();
            Order order = new Order(clnId, flightId, isOrder, clnTrack);

            if (clnId >= 0 && flightId >= 0)
            {
                clnTrack.Start_Timer(flightId, clnId, isOrder);
                order.ShowDialog();
                clnTrack.End_Timer();
                RefreshWindow();
            }
        }
Esempio n. 4
0
        public void GetClientInfoFromRedis(int clnId, ref string name, ref string email, ref string money, ref string booked)
        {
            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();

            ClientUtil clnUt = new ClientUtil();
            BankUtil   bnkUt = new BankUtil();

            clnUt.GetClientInfo(clnId, out name, out email);
            money = bnkUt.GetClientsAmount(clnId).ToString();

            var row = clnTrack.GetClientBookedTotal(clnId).First();

            booked = row.GetValue <int>("system.sum(action)").ToString();
        }
Esempio n. 5
0
        public string GetDetailedData(int flightId, int clientId)
        {
            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();

            string data      = "";
            string delimiter = ";";

            var trackerInfo = clnTrack.GetVisistsDetails(flightId, clientId);

            foreach (var row in trackerInfo)
            {
                data += row.GetValue <DateTime>("starttime").ToString() + delimiter;
                data += row.GetValue <double>("durration").ToString() + delimiter;
                data += row.GetValue <int>("action").ToString() + delimiter;
            }

            return(data);
        }
Esempio n. 6
0
        public Order(int cId, int flId, bool isOrder, ClientTracker clnT)
        {
            clnTrack = clnT;
            clnId    = cId;
            flightId = flId;
            InitializeComponent();
            ClientViewHelper clnviewhelp = new ClientViewHelper(clnId);

            ticketsMaxAmount     = clnviewhelp.GetLeftTicketsAmount(flightId);
            oneTicketCost        = clnviewhelp.GetTicketsCost(flightId);
            ticketsCost          = oneTicketCost;
            isOrderOrCancelation = isOrder;
            if (isOrder)
            {
                ButtonOrder.Text = "Book Seats";
            }
            else
            {
                ButtonOrder.Text = "Unbook Seats";
            }
        }
Esempio n. 7
0
        private List <string> GetFlightFromClnTrack(int clnId)
        {
            List <string> Results = new List <string>();

            ClientTracker clnTrack = new ClientTracker();

            clnTrack.Start_Tracking();

            var      clnInfo       = clnTrack.GetFlightInfoByClient(clnId);
            int      totalVisits   = 0;
            double   totalDuration = 0;
            DateTime lastDate      = new DateTime();

            int flightId = -1;

            foreach (var row in clnInfo)
            {
                if (flightId != row.GetValue <int>("flightid") && flightId != -1)
                {
                    Results.Add(flightId.ToString());
                    Results.Add(totalDuration.ToString());
                    Results.Add(totalVisits.ToString());
                    Results.Add(lastDate.ToString());

                    totalVisits   = 0;
                    totalDuration = 0;
                }
                flightId       = row.GetValue <int>("flightid");
                totalDuration += row.GetValue <double>("durration");
                totalVisits++;
                lastDate = row.GetValue <DateTime>("starttime");
            }
            Results.Add(flightId.ToString());
            Results.Add(totalDuration.ToString());
            Results.Add(totalVisits.ToString());
            Results.Add(lastDate.ToString());

            return(Results);
        }
Esempio n. 8
0
 public ClientViewHelper(int clientId, ClientTracker clnT)
 {
     clnId    = clientId;
     clnTrack = clnT;
 }