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; } } }
public RentTableRow(Rent rent) : base(rent) { OwnershipId = rent.Ownership.OwnershipID.ToString(); LocalId = rent.Ownership.Local.NotificationTargetID.ToString(); LocalNumber = rent.Ownership.Local.LocalNumber; }
/// <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); }