Esempio n. 1
0
 public static InvoiceHomePayment Create(Home home)
 {
     InvoiceHomePayment ihp = new InvoiceHomePayment();
     ihp.Home = home;
     ihp.Address = home.PhysicalAddress;
     ihp.Recalculate(home);
     return ihp;
 }
Esempio n. 2
0
 public void Recalculate(Home home)
 {
     Home localHome = home ?? this.Home;
     
     if (localHome != null)
     {
         this.TotalInvoiced = localHome.DueInvoices.Sum(d => d.DueAmount);
         this.TotalPayments = localHome.DueInvoices.Sum(d => d.DuePayments.Sum(x => x.PaymentAmount.GetValueOrDefault(0)));
     }
 }
 public ManageHomeInvoicesandPayments(Home home)
 {
     InitializeComponent();
     this.DataContext = new ManageHomeInvoicesAndPaymentsViewModel(home);
 }
 public ManageHomeInvoicesAndPaymentsViewModel(Home home)
 {
     SelectedHome = home;
     HomeInvoices = new ObservableCollection<Models.HomeInvoice>();
     HydrateHomeInvoices();
 }
        public AddPaymentViewModel(Home home, DuePayment selectedDuePayment)
        {
            DueInvoices = new ObservableCollection<Models.DueInvoiceOwed>();
            using (var context = Persistence.Persistence.CreateContext())
            {
                var list = (from di in context.DueInvoices
                            where di.HomeId == home.HomeId
                            select di).ToList();
                list.ForEach(d => DueInvoices.Add(Models.DueInvoiceOwed.Create(d)));
                OnPropertyChanged("DueInvoices");
            }
            if (selectedDuePayment != null)
            {
                _duePayment = selectedDuePayment;
                this.CheckImageUNC = selectedDuePayment.CheckImageUNC;
                this.PaymentAmount = selectedDuePayment.PaymentAmount ?? 0;
                this.CashPayment = selectedDuePayment.CashPayment;
                this.Forfeited = selectedDuePayment.ForfeitDueToForeclosure;
                var sdi = DueInvoices.Where(d => d.DueInvoicesId == selectedDuePayment.DueInvoicesId).FirstOrDefault();
                if (sdi != null)
                    SelectedDueInvoice = sdi;

            }
        }
Esempio n. 6
0
 public AddPayment(Home home, DuePayment selectedDuePayment)
 {
     InitializeComponent();
     this.DataContext = new AddPaymentViewModel(home, selectedDuePayment);
 }
Esempio n. 7
0
 /// <summary>
 /// Create a new Home object.
 /// </summary>
 /// <param name="homeId">Initial value of the HomeId property.</param>
 /// <param name="state">Initial value of the State property.</param>
 /// <param name="county">Initial value of the County property.</param>
 /// <param name="city">Initial value of the City property.</param>
 /// <param name="zip">Initial value of the Zip property.</param>
 /// <param name="section">Initial value of the Section property.</param>
 /// <param name="township">Initial value of the Township property.</param>
 /// <param name="townshipDir">Initial value of the TownshipDir property.</param>
 /// <param name="range">Initial value of the Range property.</param>
 /// <param name="rangeDir">Initial value of the RangeDir property.</param>
 /// <param name="block">Initial value of the Block property.</param>
 /// <param name="lot">Initial value of the Lot property.</param>
 /// <param name="physicalAddress">Initial value of the PhysicalAddress property.</param>
 public static Home CreateHome(global::System.Int32 homeId, global::System.String state, global::System.String county, global::System.String city, global::System.String zip, global::System.String section, global::System.Int32 township, global::System.String townshipDir, global::System.Int32 range, global::System.String rangeDir, global::System.Int32 block, global::System.Int32 lot, global::System.String physicalAddress)
 {
     Home home = new Home();
     home.HomeId = homeId;
     home.State = state;
     home.County = county;
     home.City = city;
     home.Zip = zip;
     home.Section = section;
     home.Township = township;
     home.TownshipDir = townshipDir;
     home.Range = range;
     home.RangeDir = rangeDir;
     home.Block = block;
     home.Lot = lot;
     home.PhysicalAddress = physicalAddress;
     return home;
 }
Esempio n. 8
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Homes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToHomes(Home home)
 {
     base.AddObject("Homes", home);
 }