public NotificationEditWindowViewModel(NotificationsTabViewModel notificationTabViewModel,
            NotificationEditWindow notificationEditWindow, Notification notification)
            : base(notificationTabViewModel, notificationEditWindow, notification)
        {
            using (var con = new BaudiDbContext())
            {
                NotificationTargetsList = con.NotificationTargets.ToList();
                OwnersList = con.Owners.ToList();
                DispatchersList = con.Dispatchers.ToList();
                if (Update)
                {
                    Notification = con.Notifications.Find(notification.NotificationID);
                    SelectedNotificationStatus = Notification.Status;
                    SelectedNotificationTarget = Notification.NotificationTarget;
                    SelectedOwner = Notification.Owner;
                    SelectedDispatcher = Notification.Dispatcher;
                }
                else
                {
                    Notification = new Notification();
                    Notification.FilingDate = DateTime.Now;
                    Notification.LastChanged = DateTime.Now;

                }
            }
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="NotificationsTabView" /> class.
 /// </summary>
 /// <param name="vm">
 ///     The vm.
 /// </param>
 public NotificationsTabView(NotificationsTabViewModel vm)
 {
     InitializeComponent();
     DataContext = vm;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public NotificationsTab()
 {
     InitializeComponent();
     DataContext = new NotificationsTabViewModel();
 }
Exemple #4
0
        private void Load()
        {
            TabsViewModels = new List<TabViewModel>();
            BuildingsTabViewModel = new BuildingsTabViewModel();
            CompaniesTabViewModel = new CompaniesTabViewModel();
            CyclicOrdersTabViewModel = new CyclicOrdersTabViewModel();
            EmployeesTabViewModel = new EmployeesTabViewModel();
            ExpensesTabViewModel = new ExpensesTabViewModel();
            LocalsTabViewModel = new LocalsTabViewModel();
            NotificationsTabViewModel = new NotificationsTabViewModel();
            OrdersTabViewModel = new OrdersTabViewModel();
            OrderTypesTabViewModel = new OrderTypesTabViewModel();
            OwnershipsTabViewModel = new OwnershipsTabViewModel();
            PeopleTabViewModel = new PeopleTabViewModel();
            OwningCompaniesTabViewModel = new OwningCompaniesTabViewModel();
            RentsTabViewModel = new RentsTabViewModel();
            ReportsTabViewModel = new ReportsTabViewModel();
            SalariesTabViewModel = new SalariesTabViewModel();
            SpecializationsTabViewModel = new SpecializationsTabViewModel();

            TabsViewModels.Add(BuildingsTabViewModel);
            TabsViewModels.Add(CompaniesTabViewModel);
            TabsViewModels.Add(CyclicOrdersTabViewModel);
            TabsViewModels.Add(EmployeesTabViewModel);
            TabsViewModels.Add(ExpensesTabViewModel);
            TabsViewModels.Add(NotificationsTabViewModel);
            TabsViewModels.Add(LocalsTabViewModel);
            TabsViewModels.Add(OrdersTabViewModel);
            TabsViewModels.Add(OrderTypesTabViewModel);
            TabsViewModels.Add(OwnershipsTabViewModel);
            TabsViewModels.Add(PeopleTabViewModel);
            TabsViewModels.Add(OwningCompaniesTabViewModel);
            TabsViewModels.Add(RentsTabViewModel);
            TabsViewModels.Add(SalariesTabViewModel);
            TabsViewModels.Add(SpecializationsTabViewModel);

            TabsViewModels.ForEach(vm => vm.PropertyChanged += OnMemberViewModelPropertyChanged);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="notificationsTabViewModel">Notification tab view model</param>
 /// <param name="notification">Notification</param>
 public NotificationEditWindow(NotificationsTabViewModel notificationsTabViewModel, Notification notification)
 {
     InitializeComponent();
     DataContext = new NotificationEditWindowViewModel(notificationsTabViewModel, this, notification);
 }
Exemple #6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="NotificationsTabView" /> class.
 /// </summary>
 /// <param name="vm">
 ///     The vm.
 /// </param>
 public NotificationsTabView(NotificationsTabViewModel vm)
 {
     InitializeComponent();
     DataContext = vm;
     this.vm     = vm;
 }