private void LoadAsync()
 {
     MainVM      = ResourcesBase.GetMainWindowViewModel();
     Jenises     = ResourcesBase.GetEnumCollection <StatusKehadiran>();
     SaveCommand = new CommandHandler {
         CanExecuteAction = SaveValidate, ExecuteAction = SaveCommandAction
     };
     CloseCommand = new CommandHandler {
         CanExecuteAction = x => true, ExecuteAction = x => WindowClose()
     };
     MainVM.PerizinanCollection.OnChangeSource += PerizinanCollection_OnChangeSource;
 }
Esempio n. 2
0
        public PenjualanCreateVM()
        {
            this.MainVM        = ResourcesBase.GetMainWindowViewModel();
            this.AppConfig     = MainVM.SystemConfiguration;
            this.TypeOfWeights = ResourcesBase.GetEnumCollection <TypeOfWeight>();
            this.PortTypes     = ResourcesBase.GetEnumCollection <PortType>();
            this.PayTypes      = ResourcesBase.GetEnumCollection <PayType>();

            ShipersSource  = new ObservableCollection <customer>(MainVM.CustomerCollection.Source);
            ReciversSource = new ObservableCollection <customer>(MainVM.CustomerCollection.Source);
            WillPaySource  = new ObservableCollection <customer>(MainVM.CustomerCollection.Source);
            CitiesSource   = new ObservableCollection <city>(MainVM.CityCollection.Source);

            this.Origins      = (CollectionView)CollectionViewSource.GetDefaultView(CitiesSource);
            this.Destinations = (CollectionView)CollectionViewSource.GetDefaultView(CitiesSource);
            this.Shipers      = (CollectionView)CollectionViewSource.GetDefaultView(ShipersSource);
            this.Recivers     = (CollectionView)CollectionViewSource.GetDefaultView(ReciversSource);
            this.WillPays     = (CollectionView)CollectionViewSource.GetDefaultView(WillPaySource);


            Shipers.Filter  = ShiperFilter;
            Recivers.Filter = ReciverFilter;
            WillPays.Filter = WillPayFilter;


            Save = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = SaveAction
            };
            Print = new CommandHandler {
                CanExecuteAction = x => PrintSelected != null, ExecuteAction = x => PrintAction()
            };
            PrintWithForm = new CommandHandler {
                CanExecuteAction = x => PrintSelected != null, ExecuteAction = x => PrintFormAction()
            };
            SaveAndPrint = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = x => SaveAndPrintAction()
            };
            Cancel = new CommandHandler {
                CanExecuteAction = x => true, ExecuteAction = x => CancalAction()
            };
            Search = new CommandHandler {
                ExecuteAction = SearchAction
            };
            ChangeWeight = new CommandHandler {
                ExecuteAction = x => ChangeWeightAction()
            };
            PriceUpdate = new CommandHandler {
                CanExecuteAction = PriceUpdateValidation, ExecuteAction = PriceUpdateAction
            };
            CreateNewSTT();
        }
Esempio n. 3
0
        public PortCreateVM()
        {
            var vm = ResourcesBase.GetMainWindowViewModel();

            Collection     = vm.PortCollection;
            CityCollection = vm.CityCollection;
            PortTypes      = ResourcesBase.GetEnumCollection <ModelsShared.Models.PortType>();

            Save = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = x => SaveAction()
            };
            Cancel = new CommandHandler {
                CanExecuteAction = x => true, ExecuteAction = c => CancelAction()
            };
        }
        public PenjualanCreateVM()
        {
            this.MainVM        = ResourcesBase.GetMainWindowViewModel();
            this.AppConfig     = MainVM.SystemConfiguration;
            this.TypeOfWeights = ResourcesBase.GetEnumCollection <TypeOfWeight>();
            this.PortTypes     = ResourcesBase.GetEnumCollection <PortType>();
            this.PayTypes      = ResourcesBase.GetEnumCollection <PayType>();

            STTModel = new STTCreateModel(0)
            {
                ChangeDate = DateTime.Now
            };

            // ShiperControl=new CustomerControl();

            CitiesSource = new ObservableCollection <ModelsShared.Models.City>(MainVM.CityCollection.Source);

            this.Origins      = (CollectionView)CollectionViewSource.GetDefaultView(CitiesSource);
            this.Destinations = (CollectionView)CollectionViewSource.GetDefaultView(CitiesSource);
            Save = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = SaveAction
            };
            Print = new CommandHandler {
                CanExecuteAction = x => PrintSelected != null, ExecuteAction = x => PrintAction()
            };
            PrintWithForm = new CommandHandler {
                CanExecuteAction = x => PrintSelected != null, ExecuteAction = x => PrintFormAction()
            };
            SaveAndPrint = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = x => SaveAndPrintAction()
            };
            Cancel = new CommandHandler {
                CanExecuteAction = x => true, ExecuteAction = x => CancalAction()
            };
            Search = new CommandHandler {
                ExecuteAction = SearchAction
            };
            ChangeWeight = new CommandHandler {
                ExecuteAction = x => ChangeWeightAction()
            };
            PriceUpdate = new CommandHandler {
                CanExecuteAction = PriceUpdateValidation, ExecuteAction = PriceUpdateAction
            };
            CreateNewSTT();
        }
        public ManifestOutGoingCreateVM()
        {
            this.PortTypes       = ResourcesBase.GetEnumCollection <ModelsShared.Models.PortType>();
            this.PortCollection  = ResourcesBase.GetMainWindowViewModel().PortCollection;
            this.OriginView      = (CollectionView)CollectionViewSource.GetDefaultView(this.PortCollection.Source);
            DestinationSource    = new ObservableCollection <ModelsShared.Models.Port>();
            this.DestinationView = (CollectionView)CollectionViewSource.GetDefaultView(DestinationSource);


            this.AgentCollection  = ResourcesBase.GetMainWindowViewModel().AgentCollection;
            BrowseManifestCommand = new CommandHandler {
                CanExecuteAction = x => BrowseManifestCommandValidate(), ExecuteAction = x => BrowseManifestCommandAction()
            };

            this.PenjualanTemporaty     = new List <Models.PenjualanView>();
            this.PenjualanTemporaryView = (CollectionView)CollectionViewSource.GetDefaultView(this.PenjualanTemporaty);
            DeleteSTTFromList           = new CommandHandler {
                CanExecuteAction = x => (STTSelectedItem != null), ExecuteAction = x => DeleteSTTFromListAction()
            };
            Save = new CommandHandler {
                CanExecuteAction = x => SaveValidation(), ExecuteAction = x => SaveAction()
            };
            Preview = new CommandHandler {
                ExecuteAction = x => PreviewAction(), CanExecuteAction = x => PreviewValidation()
            };
            Cancel = new CommandHandler {
                ExecuteAction = CancelAction, CanExecuteAction = x => true
            };
            PortCollection.RefreshCompleted += PortCollection_RefreshCompleted;


            if (PortCollection.Source.Count <= 0)
            {
                PortCollection.Refresh();
            }
            this.OriginView.Filter = PortFilter;
            DestinationView.Filter = PortFilter;
        }