コード例 #1
0
        private void ConfigureGrids()
        {
            if (AllOrganisationTotals != null)
            {
                Facade.IJobSubContractor facJobSubContractor = new Facade.Job();
                DataSet ds = facJobSubContractor.GetAllHubChargesForJobSubContractIDsAndPalletNetwork(IdentityID, DateFrom, DateTo);

                if (ds.Tables.Count > 0)
                {
                    var hubCharges = from row in ds.Tables[0].Rows.Cast <DataRow>()
                                     group row by row["SubContractorName"] into g
                                     select new
                    {
                        OrganisationName = g.Key,
                        Orders           = g.Count(),
                        Items            = g
                    };

                    lvHubCharges.DataSource = hubCharges;
                }
                else
                {
                    lvHubCharges.DataSource = null;
                }

                lvHubCharges.DataBind();

                if (AllOrganisationTotals.Count > 0)
                {
                    AllOrganisationTotals.Sort(delegate(OrganisationTotals x, OrganisationTotals y) { return(x.OrganisationName.CompareTo(y.OrganisationName)); });
                    SetCurrencyTotals();

                    repOrganisationTotal.DataSource = AllOrganisationTotals;
                    repOrganisationTotal.DataBind();

                    repCurrencyTotals.DataSource = AllCurrencyTotals;
                    repCurrencyTotals.DataBind();

                    pnlOrganisationTotals.Visible = true;
                }
                else
                {
                    pnlOrganisationTotals.Visible = false;
                }
            }
        }