Пример #1
0
        public RentInputControl(RentalBuildingSingleYear month)
        {
            InitializeComponent();

            yearMonth              = month;
            this.IsVisibleChanged += new DependencyPropertyChangedEventHandler(RentInputControl_IsVisibleChanged);
        }
Пример #2
0
        private void OnMenuItem_Delete(object sender, RoutedEventArgs e)
        {
            if (this.treeView1.SelectedItem is RentalBuildingSingleYear)
            {
                RentalBuildingSingleYear toDelete = this.treeView1.SelectedItem as RentalBuildingSingleYear;
                if (toDelete != null)
                {
                    if (MessageBoxEx.Show("Delete " + toDelete.Period, "Rental", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        toDelete.Building.Years.Remove(toDelete.Year);
                        this.treeView1.Items.Refresh();
                    }
                }
            }
            else
            {
                if (this.treeView1.SelectedItem is RentBuilding)
                {
                    RentBuilding toDelete = this.treeView1.SelectedItem as RentBuilding;

                    if (MessageBoxEx.Show("Delete " + toDelete.Name, "Rental", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        myMoney.Buildings.RemoveBuilding(toDelete);
                    }
                }
            }
        }
Пример #3
0
        public void SetViewToRentalBuildingSingleYear(RentalBuildingSingleYear value)
        {
            this.Building                 = value.Building;
            this.BuildingName             = value.Building.Name;
            this.Period                   = value.Year.ToString();
            this.TotalIncomes             = value.TotalIncome;
            this.TotalExpensesTaxes       = value.Departments[1].Total;
            this.TotalExpensesRepairs     = value.Departments[2].Total;
            this.TotalExpensesMaintenance = value.Departments[3].Total;
            this.TotalExpensesManagement  = value.Departments[4].Total;
            this.TotalExpensesInterest    = value.Departments[5].Total;

            UpdateAllDataBindings();
        }