private void ConfirmButton_Click(object sender, EventArgs e)
        {
            AccountManagement am = new AccountManagement();

            am.ChangePassword(accountId, passwordBox.Text);

            this.Close(); // wylacz okno
        }
Exemple #2
0
        // wybranie obiektu z listy
        private void AccountList_Click(object sender, EventArgs e)
        {
            if (AccountList.SelectedItem != null)
            {
                // Console.WriteLine("Wybrano " + AccountList.SelectedItem.ToString());
                AccountManagement am = new AccountManagement();
                availableEvents = am.GetEventMap();

                int id = getIdOfSelectedAccount();
                showUserEvents(id);
            }
        }
Exemple #3
0
        // klikniecie przycisku 'refresh'
        private void button1_Click(object sender, EventArgs e)
        {
            AccountManagement am = new AccountManagement();

            AccountList.BeginUpdate();
            AccountList.Items.Clear();
            foreach (Account acc in am.GetAllAccounts())
            {
                AccountList.Items.Add(acc.id + " - " + acc.login + " - " + acc.email + " - " + acc.type.ToString());
            }

            AccountList.EndUpdate();
        }
Exemple #4
0
        // przycisk odrzucania zapisu
        private void RejectBtn_Click(object sender, EventArgs e)
        {
            int id = getIdOfSelectedEvent();

            if (id != -1)
            {
                AccountManagement am = new AccountManagement();
                am.SetConfirmation(id, "no");

                int accId = getIdOfSelectedAccount();
                showUserEvents(accId);
            }
        }
Exemple #5
0
        // przycisk 'delete'
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            // pobierz ID zaznaczonego obiektu
            int id = getIdOfSelectedAccount();

            if (id != -1)
            {
                AccountManagement am = new AccountManagement();
                am.DeleteAccountByID(id);

                AccountList.BeginUpdate();
                AccountList.Items.Remove(AccountList.SelectedItem);
                AccountList.EndUpdate();
            }
        }
Exemple #6
0
        // wyswietl wydarzenia dla danego konta
        private void showUserEvents(int id)
        {
            AccountManagement am = new AccountManagement();

            EventList.BeginUpdate();

            EventList.Items.Clear(); // wyczysc liste

            // wstaw do niej wszystkie wydarzenia uzytkownika
            foreach (EventRegistration er in am.GetEventRegistrationList(id))
            {
                EventItem eventItem = availableEvents[er.eventId];
                EventList.Items.Add(er.eventRegistrationId + " - " +
                                    eventItem.name + " - " + er.foodType + " - " + er.type + " - " + er.confirmation);
            }

            EventList.EndUpdate();
        }