protected override void OnInitializing()
 {
     ButtonCommandOV         = new MSW_SMP_ButtonCommandOV(this);
     FilterChangedCommand    = new EventCommandModel(FilterChangedEvent);
     ShowSupplierInfoCommand = new EventCommandModel(ShowSupplierInfoEvent);
     InstantiateItems();
 }
Beispiel #2
0
        public async Task PerformEvent(EventTypeEnum type, CommandParametersModel parameters)
        {
            if (this.CanPerformEvent(type, parameters))
            {
                UserViewModel user = parameters.User;
                if (user == null)
                {
                    user = ChannelSession.GetCurrentUser();
                }

                if (this.userEventTracking.ContainsKey(type))
                {
                    lock (this.userEventTracking)
                    {
                        this.userEventTracking[type].Add(user.ID);
                    }
                }

                await ChannelSession.Services.User.AddOrUpdateActiveUser(user);

                user.UpdateLastActivity();

                EventCommandModel command = this.GetEventCommand(type);
                if (command != null)
                {
                    Logger.Log(LogLevel.Debug, $"Performing event trigger: {type}");

                    await ChannelSession.Services.Command.Queue(command, parameters);
                }
            }
        }
Beispiel #3
0
        protected override void OnInitializing()
        {
            ButtonCommandOV = new MSW_UMP_UIP_ButtomCommandOV(this);

            NewUser          = new tblUser();
            NewUser.Username = "";

            UserNameAwareTextBlockVisibility = string.IsNullOrEmpty(NewUser.Username) ?
                                               Visibility.Visible : Visibility.Collapsed;
            UserNameAwareTextBlockContent       = UserNameAwareMessage.Empty.GetStringValue();
            UserNameVerifiedTextBlockVisibility = Visibility.Collapsed;
            UserNameVerifingTextBlockVisibility = Visibility.Collapsed;
            FullNameAwareTextBlockVisibility    = string.IsNullOrEmpty(NewUser.FullName) ?
                                                  Visibility.Visible : Visibility.Collapsed;
            PhoneAwareTextBlockVisibility = string.IsNullOrEmpty(NewUser.Phone) ?
                                            Visibility.Visible : Visibility.Collapsed;
            JobTitleAwareTextBlockVisibility = string.IsNullOrEmpty(NewUser.Job) ?
                                               Visibility.Visible : Visibility.Collapsed;

            UserImageSource = FileIOUtil.
                              GetBitmapFromName(NewUser.Username, FileIOUtil.USER_IMAGE_FOLDER_NAME).
                              ToImageSource();

            NewPasswordChangedCommand      = new EventCommandModel(OnNewPasswordChagedEvent);
            VerifiedPasswordChangedCommand = new EventCommandModel(OnVerifiedPasswordChagedEvent);
        }
        protected override void OnInitializing()
        {
            CurrentModifiedCustomer = MSW_DataFlowHost.Current.CurrentModifiedCustomer;

            ButtonCommandOV        = new MSW_CMP_CMoP_ButtonCommandOV(this);
            GridSizeChangedCommand = new EventCommandModel(OnGridSizeChangedEvent);
        }
Beispiel #5
0
        public async Task PerformEvent(EventTrigger trigger)
        {
            if (this.CanPerformEvent(trigger))
            {
                UserViewModel user = trigger.User;
                if (user == null)
                {
                    user = ChannelSession.GetCurrentUser();
                }

                if (this.userEventTracking.ContainsKey(trigger.Type))
                {
                    lock (this.userEventTracking)
                    {
                        this.userEventTracking[trigger.Type].Add(user.ID);
                    }
                }

                EventCommandModel command = this.GetEventCommand(trigger.Type);
                if (command != null)
                {
                    Logger.Log(LogLevel.Debug, $"Performing event trigger: {trigger.Type}");

                    await command.Perform(new CommandParametersModel(user, platform : trigger.Platform, arguments : trigger.Arguments, specialIdentifiers : trigger.SpecialIdentifiers) { TargetUser = trigger.TargetUser });
                }
            }
        }
Beispiel #6
0
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            EventCommandModel eCommand = (EventCommandModel)command;

            eCommand.EventType = this.EventType;
        }
Beispiel #7
0
        protected override void OnInitializing()
        {
            ButtonCommandOV = new MSW_PIP_ButtonCommandOV(this);

            GridSizeChangedCommand         = new EventCommandModel(OnGridSizeChangedEvent);
            CurrentPasswordChangedCommand  = new EventCommandModel(OnCurrentPasswordChagedEvent);
            NewPasswordChangedCommand      = new EventCommandModel(OnNewPasswordChagedEvent);
            VerifiedPasswordChangedCommand = new EventCommandModel(OnVerifiedPasswordChagedEvent);
        }
Beispiel #8
0
        private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            EventCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <EventCommandModel>();

            if (command != null)
            {
                CommandEditorWindow window = new CommandEditorWindow(command);
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        protected override void OnInitializing()
        {
            MedicineItemSource = new ObservableCollection <tblMedicine>();
            ButtonCommandOV    = new MSW_MMP_ButtonCommandOV(this);

            FilterMedicineTypeCommand = new CommandModel(FilterMedicineTypeClickEvent);
            SearchTextChangedCommand  = new EventCommandModel(SearchTextChangedEvent);
            ShowMedicineInfoCommand   = new EventCommandModel(ShowMedicineInfoEvent);

            InstantiateItems();
        }
        private EventCommandItemViewModel GetEventCommand(EventTypeEnum eventType)
        {
            EventCommandModel command = ChannelSession.Services.Events.GetEventCommand(eventType);

            if (command != null)
            {
                return(new EventCommandItemViewModel(command));
            }
            else
            {
                return(new EventCommandItemViewModel(eventType));
            }
        }
Beispiel #11
0
 private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         EventCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <EventCommandModel>();
         if (command != null)
         {
             ChannelSession.EventCommands.Remove(command);
             ChannelSession.Settings.RemoveCommand(command);
             this.viewModel.RefreshCommands();
             await ChannelSession.SaveSettings();
         }
     });
 }
        protected override void OnInitializing()

        {
            ButtomCommandOV     = new MSW_UMP_UMoP_ButtomCommandOV(this);
            CurrentModifiedUser = MSW_DataFlowHost.Current.CurrentModifiedUser;

            UserNameAwareTextBlockVisibility = string.IsNullOrEmpty(CurrentModifiedUser.Username) ?
                                               Visibility.Visible : Visibility.Collapsed;
            UserNameVerifiedTextBlockVisibility = Visibility.Collapsed;
            FullNameAwareTextBlockVisibility    = string.IsNullOrEmpty(CurrentModifiedUser.FullName) ?
                                                  Visibility.Visible : Visibility.Collapsed;
            PhoneAwareTextBlockVisibility = string.IsNullOrEmpty(CurrentModifiedUser.Phone) ?
                                            Visibility.Visible : Visibility.Collapsed;
            JobTitleAwareTextBlockVisibility = string.IsNullOrEmpty(CurrentModifiedUser.Job) ?
                                               Visibility.Visible : Visibility.Collapsed;

            GridSizeChangedCommand         = new EventCommandModel(OnGridSizeChangedEvent);
            NewPasswordChangedCommand      = new EventCommandModel(OnNewPasswordChagedEvent);
            VerifiedPasswordChangedCommand = new EventCommandModel(OnVerifiedPasswordChagedEvent);

            UserImageSource = FileIOUtil.
                              GetBitmapFromName(CurrentModifiedUser.Username, FileIOUtil.USER_IMAGE_FOLDER_NAME).
                              ToImageSource();
        }
 public EventCommandItemViewModel(EventCommandModel command)
 {
     this.Command   = command;
     this.EventType = this.Command.EventType;
 }
Beispiel #14
0
 public EventCommandEditorWindowViewModel(EventCommandModel existingCommand)
     : base(existingCommand)
 {
     this.EventType = existingCommand.EventType;
     this.Name      = EnumLocalizationHelper.GetLocalizedName(this.EventType);
 }
 public MainScreenWindowViewModel()
 {
     _pageSourceWatcher = new PageSourceWatcher(OnPageSourceChange);
     _pageHost.Subcribe(_pageSourceWatcher);
     PagePreviewNavigateEventCommand = new EventCommandModel(OnPagePreviewNavigate);
 }
Beispiel #16
0
 public MSW_IMP_EventCommandOV(BaseViewModel parentVM) : base(parentVM)
 {
     StartDateChangedCommand  = new EventCommandModel(OnStartDateChangedEvent);
     EndDateChangedCommand    = new EventCommandModel(OnEndDateChangedEvent);
     SearchTextChangedCommand = new EventCommandModel(OnSearchTextChangedEvent);
 }
Beispiel #17
0
 public MSW_CMP_EventCommandOV(BaseViewModel parentsModel) : base(parentsModel)
 {
     SearchTextChangedCommand = new EventCommandModel(OnSearchTextChangedEvent);
 }
Beispiel #18
0
 public override Dictionary <string, string> GetTestSpecialIdentifiers()
 {
     return(EventCommandModel.GetEventTestSpecialIdentifiers(this.EventType));
 }