Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Wektory.h"
- #include "Uzytkownik.h"
- int main() {
- typedef string DATA;
- DATA login;
- DATA name;
- DATA surname;
- Wektory *a = new Wektory();
- Uzytkownik *b =new Uzytkownik("klocuch","xD","Dx");
- a->user.push_back(b);
- int choose=1;
- while(choose!=0)
- {
- cout << "============" << endl;
- cout << "MENU GLOWNE:" << endl;
- cout << "============" << endl;
- cout << "\n[0]Wyjscie.\n[1]Dodaj uzytkownika.\n[2]Edytuj uzytkownika.\n[3]Usun uzytkownika.\n[4]Wyswietl uzytkownikow." << endl;
- cout << "\nPodaj wybor: ";
- cin >> choose;
- if(choose) {
- switch (choose) {
- default:
- break;
- case 1:
- cout<<"Podaj pozadany login: ";
- cin>>login;
- for(vector<Uzytkownik*>::iterator it1 = a->user.begin(); it1 != a->user.end(); it1++)
- {
- if((*it1)->login == login)
- {
- cout<<"Login jest zajety!!!"<<endl;
- break;
- }
- else
- {
- cout<<"Podaj imie: ";
- cin>>name;
- cout<<"Podaj nazwisko: ";
- cin>>surname;
- Uzytkownik *b = new Uzytkownik(login, name, surname);
- a->user.push_back(b);
- cout<<"Dodawanie zakonczone sukcesem!"<<endl;
- break;
- }
- }
- break;
- case 2:
- cout<<"Podaj login uzytkownika, ktorego chcesz edytowac: ";
- cin>>login;
- for(vector<Uzytkownik*>::iterator it1 = a->user.begin(); it1 != a->user.end(); it1++)
- {
- if((*it1)->login == login)
- {
- for (;;)
- {
- cout<<"======================"<<endl;
- cout<<"EDYTOWANIE UZYTKOWNIKA:"<<endl;
- cout<<"======================\n\n"<<endl;
- int pick=0;
- cout<<"MENU:\n[0}Wyjscie z edycji.\n[1]Zmiana loginu.\n[2]Zmiana imienia.\n[3]Zmiana nazwiska.\n\n"<<endl;
- cin>>pick;
- if(pick!=0) {
- switch (pick) {
- case 1:
- cout << "ZMIANA LOGINU.\nPodaj nowy login: " << endl;
- cin>>login;
- (*it1)->login=login;
- break;
- case 2:
- cout << "ZMIANA IMIENIA\nPodaj nowe imie: " << endl;
- cin>>name;
- (*it1)->name=name;
- break;
- case 3:
- cout << "ZMIANA NAZWISKA.\nPodaj nowe nazwisko: " << endl;
- cin>>surname;
- (*it1)->surname=surname;
- break;
- default:
- if (pick == 0)
- break;
- }
- }else
- {
- break;
- }
- }
- }
- }
- break;
- case 3:
- for(vector<Uzytkownik*>::iterator it1 = a->user.begin(); it1 != a->user.end(); it1++)
- {
- }
- break;
- case 4:
- for(vector<Uzytkownik*>::iterator it1 = a->user.begin(); it1 != a->user.end(); it1++)
- {
- (*it1)->print();
- }
- break;
- case 0:
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement