private void PopulateGrid() { string personIdString = Request.QueryString["PersonId"]; string organizationIdString = Request.QueryString["OrganizationId"]; Person person = Person.FromIdentity(Int32.Parse(personIdString)); Organization organization = Organization.FromIdentity(Int32.Parse(organizationIdString)); this.LabelOrganization.Text = organization.Name; this.LabelDebtor.Text = person.Canonical; ExpenseClaims allClaims = ExpenseClaims.FromClaimingPersonAndOrganization(person, organization); // again, this needs a "get open only" ExpenseClaims gridClaims = new ExpenseClaims(); foreach (ExpenseClaim claim in allClaims) { // If ready for payout, add to list. if (claim.Open) { if (claim.Attested && claim.Validated && !claim.Repaid) { gridClaims.Add(claim); } } } // Now, we have grouped all ready but unsettled expenses per person. Let's add only those with a positive debt to the final list. gridClaims.Sort(SortGridItems); this.GridDebts.DataSource = gridClaims; }
private void PopulateClaims(AttestableItems items) { ExpenseClaims allClaims = ExpenseClaims.FromOrganization(Organization.PPSE); ExpenseClaims unattestedClaims = new ExpenseClaims(); // LINQ would be nice here. "Where Attested=0". foreach (ExpenseClaim claim in allClaims) { if (!claim.Attested && claim.Open) { if (attestationRights.ContainsKey(claim.BudgetId)) { unattestedClaims.Add(claim); } } } unattestedClaims.Sort(SortGridClaims); foreach (ExpenseClaim claim in unattestedClaims) { AddAttestableItem(items, claim); } }
private void PopulateGrid() { ExpenseClaims allClaims = ExpenseClaims.FromOrganization(Organization.PPSE); allClaims.Sort(SortGridItems); this.GridExpenseClaims.DataSource = allClaims; }
private void PopulateGrid() { ExpenseClaims allClaims = ExpenseClaims.ForOrganization(Organization.PPSE); ExpenseClaims unvalidatedClaims = new ExpenseClaims(); // LINQ would be nice here. "Where Validated=0". foreach (ExpenseClaim claim in allClaims) { if (!claim.Validated) { unvalidatedClaims.Add(claim); } } unvalidatedClaims.Sort(SortGridItems); this.GridExpenseClaims.DataSource = unvalidatedClaims; }
private void PopulateGrid() { ExpenseClaims allClaims = ExpenseClaims.ForOrganization(Organization.PPSE); ExpenseClaims unvalidatedClaims = new ExpenseClaims(); // LINQ would be nice here. "Where Validated=0". foreach (ExpenseClaim claim in allClaims) { if (!claim.Validated) { unvalidatedClaims.Add(claim); } } unvalidatedClaims.Sort(SortGridItems); this.GridExpenseClaims.DataSource = unvalidatedClaims; }
private void PopulateGrid() { ExpenseClaims allClaims = ExpenseClaims.FromClaimingPerson(_currentUser); ExpenseClaims gridData = new ExpenseClaims(); DateTime oneYearAgo = DateTime.Today.AddYears(-1); foreach (ExpenseClaim claim in allClaims) { // Add those that are less than a year old AND/OR not repaid yet. if (claim.ExpenseDate > oneYearAgo || claim.Open) { gridData.Add(claim); } } gridData.Sort(SortGridItems); this.GridExpenseClaims.DataSource = gridData; this.GridExpenseClaims.Rebind(); }
private void PopulateGrid() { ExpenseClaims allClaims = ExpenseClaims.FromClaimingPerson(_currentUser); ExpenseClaims gridData = new ExpenseClaims(); DateTime oneYearAgo = DateTime.Today.AddYears(-1); foreach (ExpenseClaim claim in allClaims) { // Add those that are less than a year old AND/OR not repaid yet. if (claim.ExpenseDate > oneYearAgo || claim.Open) { gridData.Add(claim); } } gridData.Sort(SortGridItems); this.GridExpenseClaims.DataSource = gridData; this.GridExpenseClaims.Rebind(); }