示例#1
0
        public PersonJsonConstructor(PersonFromDbWrapper person)
        {
            this.person = person;

            this.IsMe = this.getIsMe();
            this.Name = person.GivenName;
            // Sort by the first character of the mail so we have all the
            // S emails before the M emails.
            this.MailFirstCharacter = person.Mail == null ?
                                      ' ' : person.Mail.FirstOrDefault();

            this.JsonFromClient = toJsonObject(person);
        }
示例#2
0
 private object toJsonObject(PersonFromDbWrapper person)
 {
     return(new
     {
         mispar_ishi = person.MisparIshi,
         name = this.getDisplayName(),
         mail = person.Mail,
         picture = this.getPictureString(),
         // We show two rows for the person; the top is always
         // shown. The bottom is typically hidden behind an expander.
         top_row = this.createTopRowJson(),
         bottom_section = this.createBottomSectionJson(),
         tags = this.getTags(),
         is_me = this.IsMe,
         is_birthday_today = this.isBirthdayToday(),
     });
 }