Beispiel #1
0
        public WorkspaceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit<IWorkspaceDataUnit>();
            _crmDataUnit = dataUnitLocator.ResolveDataUnit<ICrmDataUnit>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            var time = (int?)ApplicationSettings.Read("LogoutTime");
            _logoutTime = (time.HasValue && time.Value > 0) ? time.Value : 30; // 30 minutes - default logout time

            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, new RoutedEventHandler(Window_KeyDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseDownEvent, new RoutedEventHandler(Window_MouseDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseMoveEvent, new RoutedEventHandler(Window_MouseMove));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseWheelEvent, new RoutedEventHandler(Window_MouseWheel));

            _timer = new Timer(LogoutByInactivity, null, 1000 * 60 * _logoutTime, Timeout.Infinite);

            _updateTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimer.Tick += UpdateTimer_Tick;

            _updateTimer.Start();

            _updateTimerEvents = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimerEvents.Tick += _updateTimerEvents_Tick;

            _updateTimerEvents.Start();
        }
Beispiel #2
0
        public UpdatesViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsModuleDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            ShowHistoryCommand    = new RelayCommand <EventUpdateModel>(ShowHistoryCommandExecuted);
        }
Beispiel #3
0
        public WorkspaceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit <IWorkspaceDataUnit>();
            _crmDataUnit       = dataUnitLocator.ResolveDataUnit <ICrmDataUnit>();
            _eventDataUnit     = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            var time = (int?)ApplicationSettings.Read("LogoutTime");

            _logoutTime = (time.HasValue && time.Value > 0) ? time.Value : 30; // 30 minutes - default logout time

            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, new RoutedEventHandler(Window_KeyDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseDownEvent, new RoutedEventHandler(Window_MouseDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseMoveEvent, new RoutedEventHandler(Window_MouseMove));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseWheelEvent, new RoutedEventHandler(Window_MouseWheel));

            _timer = new Timer(LogoutByInactivity, null, 1000 * 60 * _logoutTime, Timeout.Infinite);

            _updateTimer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(30)
            };
            _updateTimer.Tick += UpdateTimer_Tick;

            _updateTimer.Start();

            _updateTimerEvents = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(30)
            };
            _updateTimerEvents.Tick += _updateTimerEvents_Tick;

            _updateTimerEvents.Start();
        }
        public AddEventReminderViewModel(IEnumerable <EventModel> events, EventReminderModel eventReminderModel)
        {
            var Today = DateTime.Now;

            Events = events.Where(x => x.Date.Date > Today.Date).OrderBy(x => x.Date).ThenBy(x => x.Name).ToList();

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

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminders      = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            OpenEventCommand = new RelayCommand(OpenEventCommandExecute, OpenEventCommandCanExecute);
            if (eventReminderModel != null)
            {
                ProcessEventReminder(eventReminderModel);
                SelectedEvent  = Events.FirstOrDefault(x => x.Event == eventReminderModel.EventReminder.Event);
                _originalEvent = SelectedEvent.Clone();
            }
            else
            {
                EventReminder = GetEventReminderWithoutEvent();
                EventReminder.PropertyChanged += EventReminderOnPropertyChanged;
            }
        }
Beispiel #5
0
        public FromTemplateViewModel(EventModel eventModel)
        {
            _event = eventModel;
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            OKCommand       = new RelayCommand(OKCommandExecuted, OKCommandCanExecute);
        }
        public UpdatedRemindersViewModel(ObservableCollection<EventReminderModel> eventRemindersToBeUpdated)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
            EventRemindersToBeUpdated = eventRemindersToBeUpdated;
            UpdateRemindersCommand = new RelayCommand(UpdateRemindersCommandExecuted);

        }
Beispiel #7
0
        public RemindersViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit        = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            DeleteReminderCommand = new RelayCommand <EventReminderModel>(DeleteReminderCommandExecuted);
            EditReminderCommand   = new RelayCommand <EventReminderModel>(EditReminderCommandExecuted);
        }
        public EventCorrespondenceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            SendEmailCommand = new RelayCommand(SendEmailCommandExecuted);
            ShowCorrespondenceCommand = new RelayCommand<CorrespondenceModel>(ShowCorrespondenceCommandExecuted);
        }
Beispiel #9
0
        public UpdatedRemindersViewModel(ObservableCollection <EventReminderModel> eventRemindersToBeUpdated)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit            = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            EventRemindersToBeUpdated = eventRemindersToBeUpdated;
            UpdateRemindersCommand    = new RelayCommand(UpdateRemindersCommandExecuted);
        }
Beispiel #10
0
        public FromTemplateViewModel(EventModel eventModel)
        {
            _event = eventModel;
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
            OKCommand = new RelayCommand(OKCommandExecuted, OKCommandCanExecute);

        }
Beispiel #11
0
        public EventCorrespondenceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SendEmailCommand          = new RelayCommand(SendEmailCommandExecuted);
            ShowCorrespondenceCommand = new RelayCommand <CorrespondenceModel>(ShowCorrespondenceCommandExecuted);
        }
Beispiel #12
0
        public EventPaymentsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            AddPaymentCommand = new RelayCommand(AddPaymentCommandExecuted);
            DeletePaymentCommand = new RelayCommand<EventPaymentModel>(DeletePaymentCommandExecuted);
            EditPaymentCommand = new RelayCommand<EventPaymentModel>(EditPaymentCommandExecuted);
        }
Beispiel #13
0
        public EventPaymentsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddPaymentCommand    = new RelayCommand(AddPaymentCommandExecuted);
            DeletePaymentCommand = new RelayCommand <EventPaymentModel>(DeletePaymentCommandExecuted);
            EditPaymentCommand   = new RelayCommand <EventPaymentModel>(EditPaymentCommandExecuted);
        }
        public EventAlternativeContactsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            AddAlternativeContactCommand = new RelayCommand(AddAlternativeContactCommandExecuted);
            FindContactCommand = new RelayCommand(FindContactCommandExecuted);
            DeleteAlternativeContactCommand = new RelayCommand<EventContact>(DeleteAlternativeContactCommandExecuted);
            EditAlternativeContactCommand = new RelayCommand<EventContact>(EditAlternativeContactCommandExecuted);
        }
Beispiel #15
0
        public EventsBookedViewModel(ObservableCollection <EventModel> model)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            EditEventCommand   = new RelayCommand <EventModel>(EditEventCommandExecuted, EditEventCommandCanExecute);
            DetailsItemCommand = new RelayCommand <EventModel>(DetailsItemCommandExecuted);
            Events             = model;
        }
        public AddCalendarNoteViewModel(CalendarNoteModel note)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            SaveCommand = new RelayCommand(SaveCommandExecuted, SaveCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessNote(note);
        }
Beispiel #17
0
        public EventDetailsViewModel(EventModel model)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
            _contactsDataUnit = dataUnitLocator.ResolveDataUnit<IContactsDataUnit>();

            EditEventCommand = new RelayCommand<EventModel>(EditEventCommandExecuted, EditEventCommandCanExecute);

            Event = model;
        }
Beispiel #18
0
        public EventNotesViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            AddNoteCommand = new RelayCommand(AddNoteCommandExecuted);
            DeleteNoteCommand = new RelayCommand<EventNoteModel>(DeleteNoteCommandExecuted);
            EditNoteCommand = new RelayCommand<EventNoteModel>(EditNoteCommandExecuted);
            OpenEnquiryCommand = new RelayCommand(OpenEnquiryCommandExecute);
        }
Beispiel #19
0
        public EventDetailsViewModel(EventModel model)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit   = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            _contactsDataUnit = dataUnitLocator.ResolveDataUnit <IContactsDataUnit>();

            EditEventCommand = new RelayCommand <EventModel>(EditEventCommandExecuted, EditEventCommandCanExecute);

            Event = model;
        }
        public AddCalendarNoteViewModel(CalendarNoteModel note)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SaveCommand   = new RelayCommand(SaveCommandExecuted, SaveCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessNote(note);
        }
        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);
        }
Beispiel #22
0
        public EventAlternativeContactsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddAlternativeContactCommand    = new RelayCommand(AddAlternativeContactCommandExecuted);
            FindContactCommand              = new RelayCommand(FindContactCommandExecuted);
            DeleteAlternativeContactCommand = new RelayCommand <EventContact>(DeleteAlternativeContactCommandExecuted);
            EditAlternativeContactCommand   = new RelayCommand <EventContact>(EditAlternativeContactCommandExecuted);
        }
Beispiel #23
0
        public EventNotesViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddNoteCommand     = new RelayCommand(AddNoteCommandExecuted);
            DeleteNoteCommand  = new RelayCommand <EventNoteModel>(DeleteNoteCommandExecuted);
            EditNoteCommand    = new RelayCommand <EventNoteModel>(EditNoteCommandExecuted);
            OpenEnquiryCommand = new RelayCommand(OpenEnquiryCommandExecute);
        }
Beispiel #24
0
        //public RelayCommand<ReportModel> DeleteDocumentCommand { get; private set; }

        #endregion

        #region Constructor

        public EventReportsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            ShowFunctionSheetCommand = new RelayCommand(ShowFunctionSheetCommandExecuted, () => true);
            ShowDocumentCommand = new RelayCommand<ReportModel>(ShowDocumentCommandExecuted, report => true);
            ShowQuoteCommand = new RelayCommand(ShowQuoteCommandExecuted, () => true);
            ShowConfirmationCommand = new RelayCommand(ShowConfirmationCommandExecuted, () => true);
            AttachDocumentCommand = new RelayCommand(AttachDocumentCommandExecuted);
            //DeleteDocumentCommand = new RelayCommand<ReportModel>(DeleteDocumentCommandExecuted);
        }
Beispiel #25
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);
        }
Beispiel #26
0
        public EventChargesViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            AddChargeCommand = new RelayCommand(AddChargeCommandExecuted);
            AddInvoiceCommand = new RelayCommand(AddInvoiceCommandExecuted, AddInvoiceCommandCanExecute);

            EditChargeCommand = new RelayCommand<EventChargeModel>(EditChargeCommandExecuted);
            CommitChargeCommand = new RelayCommand<EventChargeModel>(CommitChargeCommandExecuted);
            UndoCommitChargeCommand = new RelayCommand<EventChargeModel>(UndoCommitChargeCommandExecuted, UndoCommitChargeCommandCanExecute);
        }
        }                                              // Used in AlternativeContactts

        #endregion

        #region Constructor

        public AddAlternativeContactViewModel(EventModel eventModel)
        {
            _event = eventModel;

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

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);

            AddContact();
        }
Beispiel #28
0
        public AddNoteViewModel(EventModel eventModel, EventNoteModel noteModel)
        {
            _event = eventModel;

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

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessNote(noteModel);
        }
Beispiel #29
0
        public ProductsViewModel(ProductType productType)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _adminDataUnit      = dataUnitLocator.ResolveDataUnit <IAdminDataUnit>();
            _reportsDataUnit    = dataUnitLocator.ResolveDataUnit <IReportsDataUnit>();
            _eventsDataUnit     = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();
            SelectedProductType = productType;

            DeleteProductCommand = new RelayCommand <ProductModel>(DeleteProductCommandExecuted);
            EditProductCommand   = new RelayCommand <ProductModel>(EditProductCommandExecuted);
        }
Beispiel #30
0
        public AddNoteViewModel(EventModel eventModel, EventNoteModel noteModel)
        {
            _event = eventModel;

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

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessNote(noteModel);
        }
Beispiel #31
0
        public AddInvoiceViewModel(EventModel eventModel)
        {
            _event = eventModel;

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

            GetInvoiceNumberCommand = new RelayCommand(GetInvoiceNumberCommandExecuted, GetInvoiceNumberCommandCanExecute);
            UndoGetInvoiceNumberCommand = new RelayCommand(UndoGetInvoiceNumberCommandExecuted, UndoGetInvoiceNumberCommandCanExecute);
            ShowInvoiceReportCommand = new RelayCommand(ShowInvoiceReportCommandExecuted, ShowInvoiceReportCommandCanExecute);

            Invoice = GetInvoice();
        }
Beispiel #32
0
        public EventChargesViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddChargeCommand  = new RelayCommand(AddChargeCommandExecuted);
            AddInvoiceCommand = new RelayCommand(AddInvoiceCommandExecuted, AddInvoiceCommandCanExecute);

            EditChargeCommand       = new RelayCommand <EventChargeModel>(EditChargeCommandExecuted);
            CommitChargeCommand     = new RelayCommand <EventChargeModel>(CommitChargeCommandExecuted);
            UndoCommitChargeCommand = new RelayCommand <EventChargeModel>(UndoCommitChargeCommandExecuted, UndoCommitChargeCommandCanExecute);
        }
Beispiel #33
0
        //public RelayCommand<ReportModel> DeleteDocumentCommand { get; private set; }

        #endregion

        #region Constructor

        public EventReportsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            ShowFunctionSheetCommand = new RelayCommand(ShowFunctionSheetCommandExecuted, () => true);
            ShowDocumentCommand      = new RelayCommand <ReportModel>(ShowDocumentCommandExecuted, report => true);
            ShowQuoteCommand         = new RelayCommand(ShowQuoteCommandExecuted, () => true);
            ShowConfirmationCommand  = new RelayCommand(ShowConfirmationCommandExecuted, () => true);
            AttachDocumentCommand    = new RelayCommand(AttachDocumentCommandExecuted);
            //DeleteDocumentCommand = new RelayCommand<ReportModel>(DeleteDocumentCommandExecuted);
        }
Beispiel #34
0
        public SendEventMailViewModel(EventModel eventModel, CorrespondenceModel mail)
        {
            _event = eventModel;

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

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessMail(mail);
        }
Beispiel #35
0
        public ReminderPopUpViewModel(EventReminderModel eventReminderModel)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            EventReminder = eventReminderModel;

            SnoozeCommand                = new RelayCommand(SnoozeCommandExecute);
            OpenEventCommand             = new RelayCommand(OpenEventCommandExecuted, OpenEventCommandCanExecute);
            CompleteEventReminderCommand = new RelayCommand(CompleteEventReminderCommandExecuted);
            DeleteEventReminderCommand   = new RelayCommand(DeleteEventReminderCommandExecute);
        }
Beispiel #36
0
        public AddInvoiceViewModel(EventModel eventModel)
        {
            _event = eventModel;

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

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            GetInvoiceNumberCommand     = new RelayCommand(GetInvoiceNumberCommandExecuted, GetInvoiceNumberCommandCanExecute);
            UndoGetInvoiceNumberCommand = new RelayCommand(UndoGetInvoiceNumberCommandExecuted, UndoGetInvoiceNumberCommandCanExecute);
            ShowInvoiceReportCommand    = new RelayCommand(ShowInvoiceReportCommandExecuted, ShowInvoiceReportCommandCanExecute);

            Invoice = GetInvoice();
        }
Beispiel #37
0
        public EPOSViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _adminDataUnit   = dataUnitLocator.ResolveDataUnit <IAdminDataUnit>();
            _reportsDataUnit = dataUnitLocator.ResolveDataUnit <IReportsDataUnit>();
            _eventsDataUnit  = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddProductCommand           = new RelayCommand(AddProductCommandExecuted);
            AddTillCommand              = new RelayCommand(AddTillCommandExecuted);
            AddProductGroupCommand      = new RelayCommand(AddProductGroupCommandExecuted);
            AddProductDepartmentCommand = new RelayCommand(AddProductDepartmentCommandExecuted);
            DeleteEPOSCommand           = new RelayCommand(DeleteEPOSCommandExecuted, DeleteEPOSCommandCanExecute);
        }
Beispiel #38
0
        public EventItemsAlreadyBookedViewModel(EventModel model, List <EventCateringModel> alreadyBookedCaterings, List <EventRoomModel> alreadyBookedRooms, List <EventGolfModel> alreadyBookedGolfs, ObservableCollection <EventItemModel> eventItemsAlreadyBooked)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            DeleteItemCommand       = new RelayCommand <EventItemModel>(DeleteItemCommandExecuted);
            EditItemCommand         = new RelayCommand <EventItemModel>(EditItemCommandExecuted);
            Event                   = model;
            AlreadyBookedCaterings  = alreadyBookedCaterings;
            AlreadyBookedRooms      = alreadyBookedRooms;
            AlreadyBookedGolfs      = alreadyBookedGolfs;
            EventItemsAlreadyBooked = eventItemsAlreadyBooked;
        }
        public AddEventReminderViewModel(EventModel eventModel, EventReminderModel eventReminderModel)
        {
            _event = eventModel;
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminders      = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessEventReminder(eventReminderModel);
        }
Beispiel #40
0
        public EventBookingViewModel(EventModel eventModel, bool isDuplicate)
        {
            BusyText = "Loading";
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            ShowFindContactWindowCommand = new RelayCommand(ShowFindContactWindowCommandExecuted);
            ShowAddContactWindowCommand  = new RelayCommand(ShowAddContactWindowCommandExecuted);
            SubmitEventCommand           = new RelayCommand(SubmitEventCommandExecuted, SubmitEventCommandCanExecute);
            CancelEditingCommand         = new RelayCommand(CancelEditingCommandExecuted);
            EditPrimaryContactCommand    = new RelayCommand(EditPrimaryContactCommandExecuted, EditPrimaryContactCommandCanExecute);
            ShowResourcesCommand         = new RelayCommand(ShowResourcesCommandExecuted);
            ProcessEvent(eventModel, isDuplicate);
        }
Beispiel #41
0
        public EventItemsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventsDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            AddCateringCommand = new RelayCommand(AddCateringCommandExecuted);
            AddRoomCommand     = new RelayCommand(AddRoomCommandExecuted);
            AddInvoiceCommand  = new RelayCommand(AddInvoiceCommandExecuted);
            AddGolfCommand     = new RelayCommand(AddGolfCommandExecuted);

            FromTemplateCommand = new RelayCommand(FromTemplateCommandExecuted);

            DeleteItemCommand = new RelayCommand <EventItemModel>(DeleteItemCommandExecuted);
            EditItemCommand   = new RelayCommand <EventItemModel>(EditItemCommandExecuted);
        }
Beispiel #42
0
        public AddEventInvoiceItemViewModel(EventModel eventModel, EventInvoiceModel invoiceModel)
        {
            _event = eventModel;

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

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SubmitCommand              = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            AddItemCommand             = new RelayCommand(AddItemCommandExecuted);
            CancelCommand              = new RelayCommand(CancelCommandExecuted);
            AddProductCommand          = new RelayCommand(AddProductCommandExecuted);
            DeleteBookedProductCommand = new RelayCommand <EventBookedProductModel>(DeleteBookedProductCommandExecuted);

            ProcessEventInvoice(invoiceModel);
        }
Beispiel #43
0
        public EventRemindersViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            CanDeleteEventReminder        = AccessService.Current.UserHasPermissions(Resources.PERMISSION_DELETE_FOLLOWUP_ALLOWED);
            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminder       = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);


            AddEventReminderCommand    = new RelayCommand(AddEventReminderCommandExecuted);
            DeleteEventReminderCommand = new RelayCommand <EventReminderModel>(DeleteEventReminderCommandExecuted);
            EditEventReminderCommand   = new RelayCommand <EventReminderModel>(EditEventReminderCommandExecuted);

            AddDefaultEventReminderCommand = new RelayCommand(AddDefaultEventReminderCommandExecuted, AddDefaultEventReminderCommandCanExecute);
        }
        public EventRemindersViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            CanDeleteEventReminder = AccessService.Current.UserHasPermissions(Resources.PERMISSION_DELETE_FOLLOWUP_ALLOWED);
            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminder = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);


            AddEventReminderCommand = new RelayCommand(AddEventReminderCommandExecuted);
            DeleteEventReminderCommand = new RelayCommand<EventReminderModel>(DeleteEventReminderCommandExecuted);
            EditEventReminderCommand = new RelayCommand<EventReminderModel>(EditEventReminderCommandExecuted);

            AddDefaultEventReminderCommand = new RelayCommand(AddDefaultEventReminderCommandExecuted, AddDefaultEventReminderCommandCanExecute);

        }
Beispiel #45
0
        public AddEventGolfItemViewModel(EventModel eventModel, EventGolfModel golfModel, List <EventGolfModel> alreadyBookedGolfs)
        {
            _event = eventModel;

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

            _eventDataUnit = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            SubmitCommand              = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            AddItemCommand             = new RelayCommand(AddItemCommandExecuted);
            CancelCommand              = new RelayCommand(CancelCommandExecuted);
            ShowResourcesCommand       = new RelayCommand(ShowResourcesCommandExecuted);
            AddProductCommand          = new RelayCommand(AddProductCommandExecuted);
            DeleteBookedProductCommand = new RelayCommand <EventBookedProductModel>(DeleteBookedProductCommandExecuted);
            AlreadyBookedGolfs         = alreadyBookedGolfs;
            ProcessEventGolf(golfModel);
        }
        public AddEventInvoiceItemViewModel(EventModel eventModel, EventInvoiceModel invoiceModel)
        {
            _event = eventModel;

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

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            AddItemCommand = new RelayCommand(AddItemCommandExecuted);
            CancelCommand = new RelayCommand(CancelCommandExecuted);
            AddProductCommand = new RelayCommand(AddProductCommandExecuted);
            DeleteBookedProductCommand = new RelayCommand<EventBookedProductModel>(DeleteBookedProductCommandExecuted);

            ProcessEventInvoice(invoiceModel);
        }
        public AddEventReminderViewModel(IEnumerable<EventModel> events, EventReminderModel eventReminderModel)
        {
            var Today = DateTime.Now;
            Events = events.Where(x => x.Date.Date > Today.Date).OrderBy(x => x.Date).ThenBy(x => x.Name).ToList();

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

            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            OpenEventCommand = new RelayCommand(OpenEventCommandExecute, OpenEventCommandCanExecute);
            if (eventReminderModel != null)
            {
                ProcessEventReminder(eventReminderModel);
                SelectedEvent = Events.FirstOrDefault(x => x.Event == eventReminderModel.EventReminder.Event);
                _originalEvent = SelectedEvent.Clone();
            }
            else
            {
                EventReminder = GetEventReminderWithoutEvent();
                EventReminder.PropertyChanged += EventReminderOnPropertyChanged;
            }

        }
        public AddEventReminderViewModel(EventModel eventModel, EventReminderModel eventReminderModel)
        {
            _event = eventModel;
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            CanEditEveryoneEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_EVERYONE_FOLLOWUP_ALLOWED);
            CanEditOwnEventReminders = AccessService.Current.UserHasPermissions(Resources.PERMISSION_EDIT_OWN_FOLLOWUP_ALLOWED);

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessEventReminder(eventReminderModel);
        }
        public AddEventReminderViewModel(EventReminderModel eventReminderModel)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            if (eventReminderModel != null)
            {
                ProcessEventReminder(eventReminderModel);
            }
            else
            {
                EventReminder = GetEventReminderWithoutEvent();
                EventReminder.PropertyChanged += EventReminderOnPropertyChanged;
            }
        }
Beispiel #50
0
        public AddRoomItemViewModel(EventModel eventModel, EventRoomModel roomModel, List<EventCateringModel> alreadyBookedCaterings, List<EventRoomModel> alreadyBookedRooms)
        {
            _event = eventModel;

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

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            AddItemCommand = new RelayCommand(AddItemCommandExecuted);
            CancelCommand = new RelayCommand(CancelCommandExecuted);
            AddProductCommand = new RelayCommand(AddProductCommandExecuted);
            DeleteBookedProductCommand = new RelayCommand<EventBookedProductModel>(DeleteBookedProductCommandExecuted);

            AlreadyBookedCaterings = alreadyBookedCaterings;
            AlreadyBookedRooms = alreadyBookedRooms;

            ProcessEventRoom(roomModel);
        }
Beispiel #51
0
 public RemindersViewModel()
 {
     var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
     _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
     DeleteReminderCommand = new RelayCommand<EventReminderModel>(DeleteReminderCommandExecuted);
     EditReminderCommand = new RelayCommand<EventReminderModel>(EditReminderCommandExecuted);
 }
        public EventItemsAlreadyBookedViewModel(EventModel model, List<EventCateringModel> alreadyBookedCaterings, List<EventRoomModel> alreadyBookedRooms, List<EventGolfModel> alreadyBookedGolfs, ObservableCollection<EventItemModel> eventItemsAlreadyBooked)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            DeleteItemCommand = new RelayCommand<EventItemModel>(DeleteItemCommandExecuted);
            EditItemCommand = new RelayCommand<EventItemModel>(EditItemCommandExecuted);
            Event = model;
            AlreadyBookedCaterings = alreadyBookedCaterings;
            AlreadyBookedRooms = alreadyBookedRooms;
            AlreadyBookedGolfs = alreadyBookedGolfs;
            EventItemsAlreadyBooked = eventItemsAlreadyBooked;

        }
Beispiel #53
0
 public EventUpdatesViewModel()
 {
     var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
     _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
 }
Beispiel #54
0
 public UpdatesViewModel()
 {
     var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
     _eventsModuleDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
     ShowHistoryCommand = new RelayCommand<EventUpdateModel>(ShowHistoryCommandExecuted);
 }
Beispiel #55
0
        public ReminderPopUpViewModel(EventReminderModel eventReminderModel)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            EventReminder = eventReminderModel;

            SnoozeCommand = new RelayCommand(SnoozeCommandExecute);
            OpenEventCommand = new RelayCommand(OpenEventCommandExecuted, OpenEventCommandCanExecute);
            CompleteEventReminderCommand = new RelayCommand(CompleteEventReminderCommandExecuted);
            DeleteEventReminderCommand = new RelayCommand(DeleteEventReminderCommandExecute);
        }
Beispiel #56
0
        public EventBookingViewModel(EventModel eventModel, bool isDuplicate)
        {
            BusyText = "Loading";
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            ShowFindContactWindowCommand = new RelayCommand(ShowFindContactWindowCommandExecuted);
            ShowAddContactWindowCommand = new RelayCommand(ShowAddContactWindowCommandExecuted);
            SubmitEventCommand = new RelayCommand(SubmitEventCommandExecuted, SubmitEventCommandCanExecute);
            CancelEditingCommand = new RelayCommand(CancelEditingCommandExecuted);
            EditPrimaryContactCommand = new RelayCommand(EditPrimaryContactCommandExecuted, EditPrimaryContactCommandCanExecute);
            ShowResourcesCommand = new RelayCommand(ShowResourcesCommandExecuted);
            ProcessEvent(eventModel, isDuplicate);

        }
Beispiel #57
0
        public EventsViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            AddEventCommand = new RelayCommand(AddEventCommandExecuted, AddEventCommandCanExecute);
            DeleteEventCommand = new RelayCommand<EventModel>(DeleteEventCommandExecuted, DeleteEventCommandCanExecute);
            EditEventCommand = new RelayCommand<EventModel>(EditEventCommandExecuted, EditEventCommandCanExecute);
            DuplicateEventCommand = new RelayCommand(DuplicateEventCommandExecuted, DuplicateEventCommandCanExecute);
            RefreshEventsCommand = new RelayCommand(RefreshEventsCommandExecuted);
            ShowTodayEventsCommand = new RelayCommand(ShowTodayEventsCommandExecuted);
            ShowWeekEventsCommand = new RelayCommand(ShowWeekEventsCommandExecuted);
            ShowMonthEventsCommand = new RelayCommand(ShowMonthEventsCommandExecuted);
            ShowFutureEventsCommand = new RelayCommand(ShowFutureEventsCommandExecuted);
            ShowDefaultEventsCommand = new RelayCommand(ShowDefaultEventsCommandExecuted, ShowDefaultEventsCommandCanExecute);
            ShowResourcesCommand = new RelayCommand(ShowResourcesCommandExecuted);

            AddToDoCommand = new RelayCommand(AddToDoCommandExecute);
            AddEnquiryCommand = new RelayCommand(AddEnquiryCommandExecute);
            AddCalendarNoteCommand = new RelayCommand(AddCalendarNoteCommandExecuted);
            EditCalendarNoteCommand = new RelayCommand<CalendarNoteModel>(EditCalendarNoteCommandExecuted);
            DeleteCalendarNoteCommand = new RelayCommand<CalendarNoteModel>(DeleteCalendarNoteCommandExecuted);
            DeleteEventNoteCommand = new RelayCommand<EventModel>(DeleteEventNoteCommandExecuted);

            AddReminderCommand = new RelayCommand(AddReminderCommandExecuted);
            ShowEventSynopsisReportCommand = new RelayCommand(ShowEventSynopsisReportCommandExecuted);
            ShowCalendarReportCommand = new RelayCommand(ShowCalendarReportCommandExecuted);

            CalendarColorFilterItems = new ObservableCollection<string>() { "Type", "Status" };
            SelectedCalendarColorFilterItem = CalendarColorFilterItems.First(); // Default filter is Type

        }
Beispiel #58
0
        public NewEnquiryViewModel(EnquiryModel enquiryModel)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _crmDataUnit = dataUnitLocator.ResolveDataUnit<ICrmDataUnit>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
            //_crmDataUnit.EnquiriesRepository.RevertAllChanges();
            ShowFindContactWindowCommand = new RelayCommand(ShowFindContactWindowCommandExecuted);
            ShowAddContactWindowCommand = new RelayCommand(ShowAddContactWindowCommandExecuted);
            SubmitEventCommand = new RelayCommand(SubmitEventCommandExecuted, SubmitEventCommandCanExecute);
            CancelEditingCommand = new RelayCommand(CancelEditingCommandExecuted);
            EditPrimaryContactCommand = new RelayCommand(EditPrimaryContactCommandExecuted, EditPrimaryContactCommandCanExecute);
            ShowResourcesCommand = new RelayCommand(ShowResourcesCommandExecuted, ShowResourcesCommandCanExecute);
            BookCommand = new RelayCommand(BookCommandExecute, BookCommandCanExecute);

            ProcessEnquiry(enquiryModel);
        }
Beispiel #59
0
        public ProductsViewModel(ProductType productType)
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _adminDataUnit = dataUnitLocator.ResolveDataUnit<IAdminDataUnit>();
            _reportsDataUnit = dataUnitLocator.ResolveDataUnit<IReportsDataUnit>();
            _eventsDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();
            SelectedProductType = productType;

            DeleteProductCommand = new RelayCommand<ProductModel>(DeleteProductCommandExecuted);
            EditProductCommand = new RelayCommand<ProductModel>(EditProductCommandExecuted);

        }
Beispiel #60
0
        public SendEventMailViewModel(EventModel eventModel, CorrespondenceModel mail)
        {
            _event = eventModel;

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

            SubmitCommand = new RelayCommand(SubmitCommandExecuted, SubmitCommandCanExecute);
            CancelCommand = new RelayCommand(CancelCommandExecuted);

            ProcessMail(mail);
        }