Пример #1
0
        /// <summary>
        /// This method populates the GridView for reporting the mileage
        /// </summary>
        public void PopulateUnitReport()
        {
            int            yardId      = int.Parse(YardID.Text);
            CrewController crewManager = new CrewController();

            InfoUserControl.TryRun(() =>
            {
                List <UnitReport> report = crewManager.GetUnitReports(yardId);
                if (report.Count == 0)
                {
                    UnitReportHeader.Visible = false;
                    UnitReoprtGV.Visible     = false;
                }
                else
                {
                    UnitReportHeader.Visible = true;
                    UnitReoprtGV.Visible     = true;
                    report.Sort((x, y) => x.Unit.CompareTo(y.Unit));
                    UnitReoprtGV.DataSource = report;
                    UnitReoprtGV.DataBind();
                }
            });
        }