Esempio n. 1
0
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            if (model != null)
            {
                switch (ElemType)
                {
                case "Site":
                    var site = model as Site;
                    builder.Add("Political Region", site.PoliticalRegion);
                    if (site.PosY1.HasValue && site.PosX1.HasValue)
                    {
                        builder.Add("Position", string.Format("{0}  {1}", GeoUtils.DecDegToDMS(site.PosX1.Value, CoordinateType.Longitude), GeoUtils.DecDegToDMS(site.PosY1.Value, CoordinateType.Latitude)));
                    }
                    else
                    {
                        builder.Add("Position", "No position recorded.");
                    }
                    break;

                case "SiteVisit":
                    var visit = model as SiteVisit;
                    builder.Add("Collector(s)", visit.Collector);
                    builder.AddFormat("Start Date", "{0}", DateUtils.BLDateToStr(visit.DateStart, "Not specified"));
                    builder.AddFormat("End Date", "{0}", DateUtils.BLDateToStr(visit.DateEnd, "Not specified"));
                    builder.Add("Site", visit.SiteName);
                    break;

                case "Material":
                    var mat = model as Data.Model.Material;
                    builder.Add("Site", mat.SiteName);
                    builder.Add("Site Visit", mat.SiteVisitName);
                    builder.Add("Accession No.", mat.AccessionNumber);
                    builder.Add("Registration No.", mat.RegistrationNumber);
                    builder.Add("Identification", mat.TaxaDesc);
                    break;

                case "Region":
                    var reg = model as Region;
                    if (string.IsNullOrWhiteSpace(reg.Rank))
                    {
                        builder.Add("Region type", "Not specified");
                    }
                    else
                    {
                        builder.Add("Region type", reg.Rank);
                    }
                    break;

                case "Trap":
                    var trap = model as Trap;
                    builder.Add("Site", trap.SiteName);
                    builder.Add("Trap type", trap.TrapType);
                    builder.Add("Description", trap.Description);
                    break;
                }
            }
        }
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var loan = model as Loan;

            builder.Add("Loan number", loan.LoanNumber);
            builder.Add("Permit number", loan.PermitNumber);
            builder.Add("Date initiated", loan.DateInitiated);
            builder.Add("Date due", loan.DateDue);
            builder.AddFormat("Requested by", LoanService.FormatName(loan.RequestorTitle, loan.RequestorGivenName, loan.RequestorName));
            builder.AddFormat("Received by", LoanService.FormatName(loan.ReceiverTitle, loan.RequestorGivenName, loan.ReceiverName));
            builder.AddFormat("Authorized by", LoanService.FormatName(loan.OriginatorTitle, loan.OriginatorGivenName, loan.OriginatorName));
            builder.AddFormat("Status", (ViewModel as LoanViewModel).Status);
        }