public void SetFamilies(IEnumerable <Family> families)
 {
     _families.Clear();
     foreach (var family in families)
     {
         _families.Add(family);
     }
     SelectedFamily = families.FirstOrDefault();
 }
Пример #2
0
        public void SetBills(IEnumerable <Bill> bills)
        {
            var bin = new RecycleBin <Bill>(_bills);

            _bills.Clear();
            foreach (var bill in bills)
            {
                var recycled = bin.Extract(bill);
                recycled.Payee     = bill.Payee;
                recycled.Amount    = bill.Amount;
                recycled.Frequency = bill.Frequency;
                recycled.NextDue   = bill.NextDue;

                _bills.Add(recycled);
            }
        }
Пример #3
0
        public void Set(Survey survey)
        {
            _ratingQuestions.Clear();
            _essayQuestions.Clear();

            if (survey != null)
            {
                foreach (string question in survey.RatingQuestions.Select(q => q.Text))
                {
                    _ratingQuestions.Add(question);
                }
                foreach (string question in survey.EssayQuestions.Select(q => q.Text))
                {
                    _essayQuestions.Add(question);
                }
            }
        }
        public void Load()
        {
            _bills.Clear();
            Perform(async delegate
            {
                // Using a ParseRelation:

                var bills =
                    from family in new ParseQuery <Family>()
                    where family["Members"] == _user
                    join bill in new ParseQuery <Bill>()
                    on family equals bill.Family
                    select bill;

                // Or, using a join table:
                //
                //var members =
                //    from member in new ParseQuery<Member>()
                //    where member.User == _user
                //    select member;
                //var bills =
                //    from member in members
                //    join bill in new ParseQuery<Bill>()
                //        on member.Family equals bill.Family
                //    select bill;

                var query =
                    from bill in bills
                    where bill.NextDue < new DateTime(2013, 9, 26)
                    orderby bill.NextDue, bill.Payee
                select bill;

                var results = await query
                              .Include("Family")
                              .FindAsync();
                foreach (var bill in results)
                {
                    _bills.Add(bill);
                }
            });
        }
 public void Clear()
 {
     _members.Clear();
 }
Пример #6
0
 public void ClearSelectedCompanies()
 {
     _selectedCompanies.Clear();
 }