Пример #1
0
 public RentEditWindowViewModel(RentsTabViewModel rentsTabViewModel, RentEditWindow rentEditWindow, Rent rent)
     : base(rentsTabViewModel, rentEditWindow, rent)
 {
     using (var con = new BaudiDbContext())
     {
         OwnershipsList = con.Ownerships.ToList();
         if (Update)
         {
             Rent = con.Rents.Find(rent.PaymentID);
             SelectedOwnership = Rent.Ownership;
         }
         else
         {
             Rent = new Rent();
             Rent.Date = DateTime.Now;
         }
     }
 }
Пример #2
0
 public RentTableRow(Rent rent) : base(rent)
 {
     OwnershipId = rent.Ownership.OwnershipID.ToString();
     LocalId = rent.Ownership.Local.NotificationTargetID.ToString();
     LocalNumber = rent.Ownership.Local.LocalNumber;
 }
Пример #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="rentsTabViewModel">Rents tab view model</param>
 /// <param name="rent">Rent</param>
 public RentEditWindow(RentsTabViewModel rentsTabViewModel, Rent rent)
 {
     InitializeComponent();
     DataContext = new RentEditWindowViewModel(rentsTabViewModel, this, rent);
 }