public static RecRegInfo GetRecRegInfo(int id) { var q = from r in DbUtil.Db.RecRegs where r.PeopleId == id orderby r.Id descending select new RecRegInfo { PeopleId = id, Comments = r.Comments, coaching = r.Coaching, docphone = r.Docphone, emcontact = r.Emcontact, doctor = r.Doctor, emphone = r.Emphone, fname = r.Fname, insurance = r.Insurance, medical = r.MedicalDescription, tylenol = r.Tylenol, advil = r.Advil, robitussin = r.Robitussin, maalox = r.Maalox, member = r.Member ?? false, mname = r.Mname, otherchurch = r.ActiveInAnotherChurch ?? false, policy = r.Policy, shirtsize = r.ShirtSize, custody = r.Person.CustodyIssue, transport = r.Person.OkTransport, }; var rr = q.FirstOrDefault(); if (rr == null) { rr = new RecRegInfo { PeopleId = id } } ; return(rr); }
public static RecRegInfo GetRecRegInfo(int id) { var q = from r in DbUtil.Db.RecRegs where r.PeopleId == id orderby r.Id descending select new RecRegInfo { PeopleId = id, Comments = r.Comments, coaching = r.Coaching, docphone = r.Docphone, emcontact = r.Emcontact, doctor = r.Doctor, emphone = r.Emphone, fname = r.Fname, insurance = r.Insurance, medical = r.MedicalDescription, tylenol = r.Tylenol, advil = r.Advil, robitussin = r.Robitussin, maalox = r.Maalox, member = r.Member ?? false, mname = r.Mname, otherchurch = r.ActiveInAnotherChurch ?? false, policy = r.Policy, shirtsize = r.ShirtSize, custody = r.Person.CustodyIssue, transport = r.Person.OkTransport, }; var rr = q.FirstOrDefault(); if (rr == null) rr = new RecRegInfo { PeopleId = id }; return rr; }