public PersonJsonWrapper(PersonFromDbWrapper person, string lookupField) { 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.Mail = person.Mail == null ? ' ' : person.Mail.FirstOrDefault(); this.JsonFromClient = toJsonObject(person, lookupField); }
private object toJsonObject(PersonFromDbWrapper person, string lookupField) { // TODO(Josh): Some of these fields ar eonly here for // backwards-compatibility. return(new { mispar_ishi = person.MisparIshi, name = this.getDisplayName(), mail = person.Mail, mobile = person.Mobile, long_work_title = person.LongWorkTitle, job_title = person.JobTitle, work_phone = person.WorkPhone, picture = this.getPictureString(), darga = person.Darga, birthday = this.getBirthdayDisplayString(), is_birthday_today = this.isBirthdayToday(), top_row = this.createTopRowJson(lookupField), bottom_row = this.createBottomRowJson(lookupField), tags = this.getTags(), is_me = this.IsMe, what_i_do = person.WhatIDo }); }