Esempio n. 1
0
 public SalaryEditWindowViewModel(SalariesTabViewModel salaryTabViewModel, SalaryEditWindow salaryEditWindow,
     Salary salary)
     : base(salaryTabViewModel, salaryEditWindow, salary)
 {
     using (var con = new BaudiDbContext())
     {
         MenagersList = con.Menagers.ToList();
         EmployeesList = con.Employees.ToList();
         if (Update)
         {
             Salary = con.Salaries.Find(salary.PaymentID);
             SelectedMenager = Salary.Menager;
             SelectedEmployee = Salary.Employee;
         }
         else
         {
             Salary = new Salary();
             Salary.Date = DateTime.Now;
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="salariesTabViewModel">Salaries tab view model</param>
 /// <param name="salary">Salary</param>
 public SalaryEditWindow(SalariesTabViewModel salariesTabViewModel, Salary salary)
 {
     InitializeComponent();
     DataContext = new SalaryEditWindowViewModel(salariesTabViewModel, this, salary);
 }
Esempio n. 3
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);
        }