예제 #1
0
 public OwnershipEditWindowViewModel(OwnershipsTabViewModel ownershipTabViewModel,
     OwnershipEditWindow ownershipEditWindow, Ownership ownership)
     : base(ownershipTabViewModel, ownershipEditWindow, ownership)
 {
     using (var con = new BaudiDbContext())
     {
         LocalsList = con.Locals.ToList();
         OwnersList = con.Owners.ToList();
         if (Update)
         {
             Ownership = con.Ownerships.Find(ownership.OwnershipID);
             SelectedLocal = Ownership.Local;
             SelectedOwner = Ownership.Owner;
         }
         else
         {
             Ownership = new Ownership();
             Ownership.PurchaseDate = DateTime.Now;
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownershipsTabViewModel">Ownerships tab view model</param>
 /// <param name="ownership">Ownership</param>
 public OwnershipEditWindow(OwnershipsTabViewModel ownershipsTabViewModel, Ownership ownership)
 {
     InitializeComponent();
     DataContext = new OwnershipEditWindowViewModel(ownershipsTabViewModel, this, ownership);
 }