Exemplo n.º 1
0
        private void RefreshTaxFormsList(bool refreshData = true)
        {
            TaxForms.DetachRowsAndDispose();

            if (refreshData)
            {
                // hack alert... TableCache currently assumes it's looking for *single* model style records via their RowGUID
                // yet we're passing the Sponsor RowGUID to a proc that loads a *LIST* of forms
                // this 'works' because (a) we know we want to refresh the data so we specifically desire a cache *miss* in this case which is guaranteed because we'll never find a SponsorGUID in the TaxForms table
                // and (b) we need that SponsorGUID to target its list of forms
                EntityLookup(GUID, "Sponsor_TaxForm", "Sponsor_TaxForms"); //refresh the list of forms for this sponsor so we see the new ones just created
            }

            TaxForms = Fields.CreateChildView("Sponsor_TaxForm");
            SetTaxFormsRowFilter();

            Class1TaxFormsCountUnreturned = (TaxForms.Cast <DataRowView>().Where(r => r.Field <int>("FormTypeID") == 1 && (r.Field <bool>("IsUnreturnedID") || r.Field <bool>("IsIncompleteId")))).Count();
            TaxFormsCountReturnedNotFiled = (TaxForms.Cast <DataRowView>().Where(r => r.Field <string>("Status") == "Returned")).Count();

            OnPropertyChanged("Fields");         //added this to update Suspension info due to Form Violation
            OnPropertyChanged("SponsorRemarks"); //ditto on the Remarks driven by Form Violation
            OnPropertyChanged("TaxForms");
            OnPropertyChanged("HasUnreturnedClass2");
            OnPropertyChanged("Class1TaxForms_CountUnreturned");
            OnPropertyChanged("Class1TaxForms_CountRemainingToBuy");
            OnPropertyChanged("Class1TaxForms_RemainingToBuyToolTipText");
            OnPropertyChanged("TaxForms_CountReturnedNotFiled");
        }
Exemplo n.º 2
0
        protected override void UnLoadSubClass()
        {
            if (SponsorRemarks != null)
            {
                SponsorRemarks.Table.RowChanged -= SponsorRemarksRowChanged;
            }

            if (ClientTable != null)
            {
                ClientTable.ColumnChanged -= ClientTableColumnChanged;
                ClientTable.RowChanged    -= ClientTableRowChanged;
            }

            if (_potentialClientMatchesBgWorker != null)
            {
                _potentialClientMatchesBgWorker.OnExecute   = null;
                _potentialClientMatchesBgWorker.OnCompleted = null;
            }

            UTAPFields.DetachRow();
            TaxForms.DetachRowsAndDispose();
            HouseMembers.DetachRowsAndDispose();
            SponsorRemarks.DetachRowsAndDispose();
        }