示例#1
0
        public void ExecuteSaveBusinessAreaCommand(Object obj)
        {
            var result = socket.ChangeBusinessUnit(businessAreaViewModel.SelectedBusinessArea);

            if (result == false)
            {
                MessageBox.Show("Fehler beim Ändern des Geschäftsbereiches!");
            }

            parent.restartBusinessUnitCommand();
        }
示例#2
0
        private void ExecuteSaveBusinessAreaCommand(Object obj)
        {
            if ((fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).SelectedBusinessArea != null)
            {
                //If Lists are equaly long
                if ((fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas.Count == (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).entryBusinessArea.Count)
                {
                    //Change every Input
                    for (int i = 0; i < (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas.Count; i++)
                    {
                        socket.ChangeBusinessUnit((fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).entryBusinessArea[i], (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas[i]);
                    }

                    //Fetch new BusinessAreas
                    fleetManagementViewModel.ActiveViewModel = new BusinessAreasViewController().Initialize();
                    (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas = new ObservableCollection <BusinessUnit>(socket.GetAllBusinessUnits());

                    //Persist Entry State BusinessAreas
                    (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).entryBusinessArea = (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas.ToList();
                }
            }
        }
示例#3
0
 public void ExecuteSaveBusinessAreaCommand(Object obj)
 {
     if (businessAreaViewModel.SelectedBusinessArea != null)
     {
         //If Lists are equaly long
         if (businessAreaViewModel.BusinessAreas.Count == businessAreaViewModel.entryBusinessArea.Count)
         {
             //Change every Input
             for (int i = 0; i < businessAreaViewModel.BusinessAreas.Count; i++)
             {
                 if (businessAreaViewModel.entryBusinessArea[i] != businessAreaViewModel.BusinessAreas[i])
                 {
                     var result = socket.ChangeBusinessUnit(businessAreaViewModel.entryBusinessArea[i], businessAreaViewModel.BusinessAreas[i]);
                     if (result == false)
                     {
                         MessageBox.Show("Fehler beim Ändern des Geschäftsbereiches!");
                     }
                 }
             }
             parent.restartBusinessUnitCommand();
         }
     }
 }