コード例 #1
0
 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;
     }
 }
コード例 #2
0
        //public ClimbListItemDto(Guid id, string name, string name2, string avatar, string grade, double? rating, int ratingCount)
        //{
        //    ID = id.ToString("N");
        //    Name = name;
        //    Name2 = name;
        //    Grade = grade;
        //    Avatar = avatar;
        //    Rating = rating;
        //    RatingCount = ratingCount;
        //}

        public ClimbListItemDto(Climb c)
        {
            ID   = c.ID.ToString("N");
            Name = c.Name;
            if (c.Type == Entities.Enum.CfType.ClimbIndoor)
            {
                Alt = DtoHelper.GetPGAltName(c as ClimbIndoor);
            }
            Grade       = c.GradeLocal;
            Avatar      = c.Avatar;
            Rating      = c.Rating;
            RatingCount = c.RatingCount;
        }