private void bindPayments(string id, string childName, string imageURL)
        {
            this.mvMain.SetActiveView(this.viewPayments);
            DataListLoadRequest request = RecurringGiftInstallmentHistoryDataList.CreateRequest(this.API.AppFxWebServiceProvider);

            request.DataListID      = new Guid("384fedc7-25b7-4cde-873c-dc26f48178ae"); //"4d326172-d5d5-4966-a91c-0c0d2b02b155");
            request.ContextRecordID = id;
            OCM.BBISWebParts.WebsiteSponsorshipPaymentsDataListRow[] rows = OCM.BBISWebParts.WebsiteSponsorshipPaymentsDataList.GetRows(this.API.AppFxWebServiceProvider, request);
            //RecurringGiftInstallmentHistoryDataListRow[] rows = RecurringGiftInstallmentHistoryDataList.GetRows(this.API.AppFxWebServiceProvider, request);

            lblViewPaymentsFor.Text = "Viewing payments for " + childName;

            imgPayments.ImageUrl = imageURL;

            DataTable dt = new DataTable();

            dt.Columns.Add("DATE");
            dt.Columns.Add("AMOUNT");
            dt.Columns.Add("ACTIVITYTYPE");
            dt.Columns.Add("DATESORT");

            foreach (OCM.BBISWebParts.WebsiteSponsorshipPaymentsDataListRow row in rows)
            //foreach (RecurringGiftInstallmentHistoryDataListRow row in rows)
            {
                if ((row.ACTIVITYTYPE != "Payment") || (row.AMOUNT <= 0))
                {
                    continue;
                }

                DataRow dr = dt.NewRow();

                dr["DATE"]         = row.DATE.Value.ToString("MMMM dd, yyyy");
                dr["AMOUNT"]       = row.AMOUNT.ToString("c");
                dr["ACTIVITYTYPE"] = row.ACTIVITYTYPE;
                //dr["DATESORT"] = row.DATE.Value.ToString ("yyyyMMdd");

                dt.Rows.Add(dr);
            }

            DataView dv = dt.DefaultView;

            //dv.Sort = "DATESORT desc";
            this.gvPayments.DataSource = dv.ToTable();
            this.gvPayments.DataBind();
            //this.gvPayments.Sort("DATE", SortDirection.Descending);
        }
Example #2
0
        private void bindPayments(string id)
        {
            this.mvMain.SetActiveView(this.viewPayments);

            DataListLoadRequest request = RecurringGiftInstallmentHistoryDataList.CreateRequest(this.API.AppFxWebServiceProvider);

            request.DataListID      = new Guid("4d326172-d5d5-4966-a91c-0c0d2b02b155");
            request.ContextRecordID = id;
            RecurringGiftInstallmentHistoryDataListRow[] rows = RecurringGiftInstallmentHistoryDataList.GetRows(this.API.AppFxWebServiceProvider, request);

            DataTable dt = new DataTable();

            dt.Columns.Add("ACTIVITYTYPE");
            dt.Columns.Add("AMOUNT");
            dt.Columns.Add("BALANCE");
            dt.Columns.Add("DATE");

            foreach (RecurringGiftInstallmentHistoryDataListRow row in rows)
            {
                if (row.ACTIVITYTYPE == "Installment")
                {
                    continue;
                }

                DataRow dr = dt.NewRow();

                dr["ACTIVITYTYPE"] = row.ACTIVITYTYPE;
                dr["AMOUNT"]       = row.AMOUNT.ToString("c");
                dr["BALANCE"]      = row.BALANCE;
                dr["DATE"]         = row.DATE.Value.ToShortDateString();

                dt.Rows.Add(dr);
            }

            this.gvPayments.DataSource = dt;
            this.gvPayments.DataBind();
        }