public ClimbIndoorDetailDto(cf.Entities.ClimbIndoor c) : base(c.Location) { ID = c.ID.ToString("N"); Avatar = c.Avatar; Tags = c.ClimbTags.GetCategoriesString(); ClimbType = c.ClimbTypeID; Description = c.Description; if (c.SetDate.HasValue) { Set = c.SetDate.Value.ToEpochTimeString(); } if (c.DiscontinuedDate.HasValue) { Discontinued = c.DiscontinuedDate.Value.ToEpochTimeString(); } Grade = c.GradeLocal; Lnum = c.LineNumber; Mark = string.Format("{0} {1}", c.MarkingColor, c.MarkingType == 2 ? "tape" : "holds"); Name = c.Name; Alt = DtoHelper.GetPGAltName(c); Rating = c.Rating; RatingCount = c.RatingCount; if (c.SectionID.HasValue) { SectionID = c.SectionID.Value.ToString("N"); SectionName = c.LocationSection.Name; } if (c.SetterID.HasValue && !c.SetterAnonymous) { SetterID = c.Setter.ID.ToString("N"); SetterInitials = c.Setter.Initials; SetterAvatar = "";// c.Setter.Profile.Avatar; } }
public static string GetPGAltName(ClimbIndoor ci) { var alt = ci.MarkingColor; if (!string.IsNullOrEmpty(ci.LineNumber)) { alt += " " + ci.LineNumber; } return alt; }