private void FormSystemList() { listViewSystem.Clear(); ClientViewHelper clnviewhelp = new ClientViewHelper(clnId); string input = clnviewhelp.GetTable(false); listViewSystem.View = View.Details; listViewSystem.GridLines = true; listViewSystem.FullRowSelect = true; listViewSystem.Columns.Add("FLIGHT", 80); listViewSystem.Columns.Add("FROM", 80); listViewSystem.Columns.Add("TO", 80); listViewSystem.Columns.Add("DATE", 120); listViewSystem.Columns.Add("COST", 80); listViewSystem.Columns.Add("LEFT TICKETS", 150); string[] arr = new string[7]; ListViewItem itm; string[] words = input.Split(';'); for (int itr = 0; itr < words.Length - 1; itr += 6) { for (int initr = 0; initr < 6; initr++) { arr[initr] = words[initr + itr]; } itm = new ListViewItem(arr); listViewSystem.Items.Add(itm); } }
private void RefreshWindow() { ClientViewHelper clnviewhelp = new ClientViewHelper(clnId); clnviewhelp.GetAllClientInfo(out string username, out string mail, out decimal money); labelUsername.Text = username; labelMail.Text = mail; labelMoney.Text = money.ToString(CultureInfo.InvariantCulture); FormClientList(); FormSystemList(); }
private void ButtonOrder_Click(object sender, EventArgs e) { ClientViewHelper clnviewhelp = new ClientViewHelper(clnId, clnTrack); if (isOrderOrCancelation == true) { clnviewhelp.MakeOrder(flightId, ticketsAmount); } else { clnviewhelp.DeleteOrder(flightId, ticketsAmount); } this.Close(); }
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"; } }