Example #1
0
 private void RecalculateTotalCarPart()
 {
     TotalCarPartsCount = new ObservableCollection <ContainerCountCarParts>
     {
         new ContainerCountCarParts
         {
             Text  = "Итого",
             Count = CurrentContainerCarParts.Sum(p => p.CountCarParts)
         }
     };
 }
Example #2
0
        private void Edit(object parameter)
        {
            int index = CurrentContainerCarParts.IndexOf(SelectedCurrentContainerCarPart);

            var viewModel = new EditContainerCarPartViewModel(SelectedCurrentContainerCarPart);

            HelperMethods.ShowView(viewModel, new AddEditContainerCarPartView());

            var carPart = viewModel.CurrentNewContainerCarPart;

            CurrentContainerCarParts.RemoveAt(index);
            CurrentContainerCarParts.Insert(index, carPart);

            RecalculateTotalCarPart();
        }
Example #3
0
 protected bool IsAnyCarParts(object parameter)
 {
     return(CurrentContainerCarParts.Any());
 }
Example #4
0
        private void Remove(object parameter)
        {
            CurrentContainerCarParts.Remove(SelectedCurrentContainerCarPart);

            RecalculateTotalCarPart();
        }
Example #5
0
        private void viewModel_AddingCarPart(CurrentContainerCarPart currentContainerCarPart)
        {
            CurrentContainerCarParts.Add(currentContainerCarPart);

            RecalculateTotalCarPart();
        }
        private void EditContainer(object parameter)
        {
            BC.EditInfoContainer(_containerId, Name, Description, DatePhysical, DateOrder, _isIncoming, CurrentContainerCarParts.ToList());

            HelperMethods.CloseWindow(parameter);
        }