Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        #region Constructor

        public MainWindowViewModel(UIVisualizerService uiVisualizerService, IAuthenticationProvider authenticationProvider)
        {
            Argument.IsNotNull(() => authenticationProvider);
            Argument.IsNotNull(() => uiVisualizerService);
            _uiVisualizerService    = uiVisualizerService;
            _authenticationProvider = authenticationProvider;
            RoleCollection          = new ObservableCollection <string>(new[] { "Read-Only", "Administrator" });
            ShowView = new Command(OnShowViewExecute, OnShowViewCanExecute, "ShowView");
        }
Пример #2
0
        /// <summary>
        /// Execute ServiceChargeCommand
        /// </summary>
        /// <param name="item">Selected item to be processed.</param>
        private void ExecuteServiceChargeCommand(Order item)
        {
            try
            {
                KeyPadViewModel viewModel = new KeyPadViewModel("Service Charge");
                bool?           result    = UIVisualizerService.ShowDialog("KeyPadPopup", viewModel);

                if (result.HasValue && result.Value)
                {
                    item.ServiceCharge = Convert.ToInt64(viewModel.ReturnedValue);
                    (ModelManager as IOrderManager).UpdateServiceCharge(item);

                    // refresh item list
                    this.ExecuteRefreshCommand();
                    // refresh table list
                    RefreshTablesCommand.Execute(null);
                }
            }
            catch (Exception ex)
            {
                this.MessageBoxService.ShowError(this.GetType().FullName + System.Reflection.MethodBase.GetCurrentMethod().Name + ": " + ex.Message);
            }
        }