Exemplo n.º 1
0
        private void ProcessCharge(EventChargeModel model)
        {
            _isEditMode = (model != null);

            EventCharge = (_isEditMode) ? model : GetEventCharge();
            EventCharge.PropertyChanged += EventChargeOnPropertyChanged;
        }
Exemplo n.º 2
0
        public AddEventChargeView(EventModel eventModel, EventChargeModel charge = null)
        {
            InitializeComponent();
            DataContext = ViewModel = new AddEventChargeViewModel(eventModel, charge);

            Owner = Application.Current.MainWindow;

            Loaded += OnAddEventChargeViewLoaded;
        }
Exemplo n.º 3
0
        public EventBookedProductModel(EventBookedProduct eventBookedProduct)
        {
            IncVat             = true;
            EventBookedProduct = eventBookedProduct;

            _product = eventBookedProduct.Product;

            EventCharge = new EventChargeModel(EventBookedProduct.EventCharge);
        }
Exemplo n.º 4
0
        public AddEventChargeViewModel(EventModel eventModel, EventChargeModel charge)
        {
            _event = eventModel;

            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);

            ProcessCharge(charge);
        }
Exemplo n.º 5
0
        public EventBookedProductModel(EventBookedProduct eventBookedProduct)
        {
            IncVat = true;
            EventBookedProduct = eventBookedProduct;

            _product = eventBookedProduct.Product;

            EventCharge = new EventChargeModel(EventBookedProduct.EventCharge);
        }
Exemplo n.º 6
0
        private void CommitChargeCommandExecuted(EventChargeModel obj)
        {
            obj.IsCommited = true;

            if (_event.EventStatus.Name != "Confirmed")
            {
                // If event status is not Confirmed then we can change event status to Confirmed

                bool? dialogResult = null;

                RadWindow.Confirm(new DialogParameters()
                {
                    Owner = Application.Current.MainWindow,
                    Content = "Would you like to change event status to confirmed?",
                    Closed = (sender, args) => { dialogResult = args.DialogResult; }
                });

                if (dialogResult == true)
                {
                    _event.EventStatus = _eventStatuses.FirstOrDefault(x => x.Name == "Confirmed");
                }
            }
            AddInvoiceCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 7
0
 private bool UndoCommitChargeCommandCanExecute(EventChargeModel arg)
 {
     return AccessService.Current.UserHasPermissions(Properties.Resources.PERMISSION_UNDO_COMMIT_CHARGE);
 }
Exemplo n.º 8
0
 private void UndoCommitChargeCommandExecuted(EventChargeModel obj)
 {
     obj.IsCommited = false;
     AddInvoiceCommand.RaiseCanExecuteChanged();
 }
Exemplo n.º 9
0
        private void EditChargeCommandExecuted(EventChargeModel obj)
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddEventChargeView(Event, obj);
            window.ShowDialog();
            if (window.DialogResult != null && window.DialogResult.Value)
            {
                Event.RefreshEventPrice();
                Event.UpdatePaymentDetails();
            }
            RaisePropertyChanged("EnableParentWindow");
        }