예제 #1
0
        private void SnoozeCommandExecute()
        {
            RaisePropertyChanged("DisableParentWindow");
            var eventID      = EventReminder.EventReminder.EventID;
            var snoozeWindow = new SnoozeView(EventReminder);

            snoozeWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            snoozeWindow.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (snoozeWindow.DialogResult == null || snoozeWindow.DialogResult != true)
            {
                return;
            }

            var viewModel = snoozeWindow.DataContext as SnoozeViewModel;

            switch (viewModel.SnoozeTime)
            {
            case "5 mins":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(5);
                break;

            case "10 mins":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(10);
                break;

            case "30 mins":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(30);
                break;

            case "1 Hour":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromHours(1);
                break;

            case "2 Hours":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromHours(2);
                break;

            case "1 Day":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromDays(1);
                break;

            case "7 Days":
                EventReminder.DateDue = DateTime.Now + TimeSpan.FromDays(7);
                break;
            }

            _eventDataUnit.SaveChanges();

            var window        = Application.Current.MainWindow;
            var mainViewModel = window.DataContext as MainWindowModel;
            var workspaceView = mainViewModel.WindowContent as WorkspaceView;
            var tile          = workspaceView.RootTileView.MaximizedItem as Tile;

            if (tile.Name == "Events")
            {
                var eventsView = tile.Content as EventsView;
                if (eventsView != null)
                {
                    var eventsViewModel = eventsView.DataContext as EventsViewModel;
                    eventsViewModel.RefreshReminders(EventReminder, eventID);
                    eventsView.RefreshReminder(EventReminder);
                }
            }
        }
예제 #2
0
        private void SnoozeCommandExecute()
        {
            RaisePropertyChanged("DisableParentWindow");
            var eventID = EventReminder.EventReminder.EventID;
            var snoozeWindow = new SnoozeView(EventReminder);
            snoozeWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            snoozeWindow.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (snoozeWindow.DialogResult == null || snoozeWindow.DialogResult != true) return;

            var viewModel = snoozeWindow.DataContext as SnoozeViewModel;
            switch (viewModel.SnoozeTime)
            {
                case "5 mins":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(5);
                    break;
                case "10 mins":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(10);
                    break;
                case "30 mins":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromMinutes(30);
                    break;
                case "1 Hour":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromHours(1);
                    break;
                case "2 Hours":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromHours(2);
                    break;
                case "1 Day":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromDays(1);
                    break;
                case "7 Days":
                    EventReminder.DateDue = DateTime.Now + TimeSpan.FromDays(7);
                    break;
            }

            _eventDataUnit.SaveChanges();

            var window = Application.Current.MainWindow;
            var mainViewModel = window.DataContext as MainWindowModel;
            var workspaceView = mainViewModel.WindowContent as WorkspaceView;
            var tile = workspaceView.RootTileView.MaximizedItem as Tile;
            if (tile.Name == "Events")
            {
                var eventsView = tile.Content as EventsView;
                if (eventsView != null)
                {
                    var eventsViewModel = eventsView.DataContext as EventsViewModel;
                    eventsViewModel.RefreshReminders(EventReminder, eventID);
                    eventsView.RefreshReminder(EventReminder);
                }

            }
        }
예제 #3
0
        private void SnoozeCommandExecute()
        {
            RaisePropertyChanged("DisableParentWindow");

            var snoozeWindow = new SnoozeView(FollowUp);
            snoozeWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            snoozeWindow.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (snoozeWindow.DialogResult == null || snoozeWindow.DialogResult != true) return;

            var viewModel = snoozeWindow.DataContext as SnoozeViewModel;
            switch (viewModel.SnoozeTime)
            {
                case "5 mins":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(5);
                    break;
                case "10 mins":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(10);
                    break;
                case "30 mins":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(30);
                    break;
                case "1 Hour":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromHours(1);
                    break;
                case "2 Hours":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromHours(2);
                    break;
                case "1 Day":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromDays(1);
                    break;
                case "7 Days":
                    FollowUp.DateDue = DateTime.Now + TimeSpan.FromDays(7);
                    break;
            }

            _crmDataUnit.SaveChanges();

            var window = Application.Current.MainWindow;
            var mainViewModel = window.DataContext as MainWindowModel;
            var workspaceView = mainViewModel.WindowContent as WorkspaceView;
            var tile = workspaceView.RootTileView.MaximizedItem as Tile;
            if (tile.Name == "CRM")
            {
                var crmview = tile.Content as CRMView;
                var crmvm = crmview.DataContext as CRMViewModel;
                crmvm.FollowUps.ForEach(x => x.Refresh());
            }
        }
예제 #4
0
        private void SnoozeCommandExecute()
        {
            RaisePropertyChanged("DisableParentWindow");

            var snoozeWindow = new SnoozeView(FollowUp);

            snoozeWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            snoozeWindow.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (snoozeWindow.DialogResult == null || snoozeWindow.DialogResult != true)
            {
                return;
            }

            var viewModel = snoozeWindow.DataContext as SnoozeViewModel;

            switch (viewModel.SnoozeTime)
            {
            case "5 mins":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(5);
                break;

            case "10 mins":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(10);
                break;

            case "30 mins":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromMinutes(30);
                break;

            case "1 Hour":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromHours(1);
                break;

            case "2 Hours":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromHours(2);
                break;

            case "1 Day":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromDays(1);
                break;

            case "7 Days":
                FollowUp.DateDue = DateTime.Now + TimeSpan.FromDays(7);
                break;
            }

            _crmDataUnit.SaveChanges();

            var window        = Application.Current.MainWindow;
            var mainViewModel = window.DataContext as MainWindowModel;
            var workspaceView = mainViewModel.WindowContent as WorkspaceView;
            var tile          = workspaceView.RootTileView.MaximizedItem as Tile;

            if (tile.Name == "CRM")
            {
                var crmview = tile.Content as CRMView;
                var crmvm   = crmview.DataContext as CRMViewModel;
                crmvm.FollowUps.ForEach(x => x.Refresh());
            }
        }