Example #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;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Edit action
 /// </summary>
 public override void Edit()
 {
     var rentEditWindow = new RentEditWindow(this, SelectedRent);
     rentEditWindow.Show();
 }
Example #3
0
 /// <summary>
 /// Add action
 /// </summary>
 public override void Add()
 {
     var rentEditWindow = new RentEditWindow(this, null);
     rentEditWindow.Show();
 }