Exemple #1
0
 static void Add()
 {
     List();
     int action = GetUserOption();
     switch (context) {
         case CONTEXT_COMPANY:
             currentCompany = companies.ElementAt<Company>(action);
             currentCompany.departments.Enqueue(new Department(GetNewName(), Guid.NewGuid()));
             break;
         case CONTEXT_DEPARTMENT:
             break;
         case CONTEXT_EXECUTIVE:
             break;
     }
 }
Exemple #2
0
 static void Browse()
 {
     List();
     int action = GetUserOption();
     switch (context) {
         case CONTEXT_COMPANY:
             currentCompany = companies.ElementAt<Company>(action);
             List(currentCompany);
             action = GetUserOption();
             break;
         case CONTEXT_DEPARTMENT:
             break;
         case CONTEXT_EXECUTIVE:
             break;
     }
 }
Exemple #3
0
 static void Select()
 {
     List();
     int action = GetUserOption();
     switch (context) {
         case CONTEXT_COMPANY:
             currentCompany = companies.ElementAt<Company>(action - 1);
             context = CONTEXT_DEPARTMENT;
             break;
         case CONTEXT_DEPARTMENT:
             currentDepartment = currentCompany.departments.ElementAt<Department>(action - 1);
             context = CONTEXT_EXECUTIVE;
             break;
         case CONTEXT_EXECUTIVE:
             break;
     }
 }
Exemple #4
0
 static void List(Company company)
 {
     IEnumerator<Department> e = company.departments.GetEnumerator();
     int count = 1;
     while (e.MoveNext()) {
         Console.WriteLine("{0} - {1}", count++, e.Current.DepartmentName);
     }
 }