示例#1
0
        public ActionResult Select(int id, SearchModel m)
        {
            if (m.List.AsEnumerable().Any(li => li.PeopleId == id))
            {
                return(View("List", m));
            }

            var p = DbUtil.Db.LoadPersonById(id);
            var s = new SearchPersonModel
            {
                PeopleId = id,
                FamilyId = m.type == "family" ? m.typeid.Value : p.FamilyId,
                first    = p.FirstName,
                goesby   = p.NickName,
                last     = p.LastName,
                marital  = p.MaritalStatusId,
                email    = p.EmailAddress,
                suffix   = p.SuffixCode,
                title    = p.TitleCode,
                dob      = p.DOB,
                gender   = p.GenderId,
                phone    = p.CellPhone,
                context  = m.type,
            };

            s.LoadFamily();
            m.List.Add(s);
            if (m.OnlyOne)
            {
                return(Complete(m.typeid.ToString(), m));
            }
            return(View("List", m));
        }
示例#2
0
        public ActionResult Select(int id, SearchAddModel m)
        {
            if (m.List.AsEnumerable().Any(li => li.PeopleId == id))
            {
                return(View("List", m));
            }

            var cv = new CodeValueModel();
            var p  = DbUtil.Db.LoadPersonById(id);
            var s  = new SearchPersonModel
            {
                PeopleId   = id,
                FamilyId   = m.type == "family" ? m.typeid.ToInt() : p.FamilyId,
                First      = p.FirstName,
                GoesBy     = p.NickName,
                Last       = p.LastName,
                Marital    = new CodeInfo(p.GenderId, cv.MaritalStatusCodes99()),
                Email      = p.EmailAddress,
                Suffix     = p.SuffixCode,
                Title      = p.TitleCode,
                dob        = p.DOB,
                Gender     = new CodeInfo(p.GenderId, cv.GenderCodesWithUnspecified()),
                Phone      = p.CellPhone,
                context    = m.type,
                EntryPoint = new CodeInfo(p.EntryPointId, cv.EntryPoints()),
                Campus     = new CodeInfo(p.CampusId, cv.AllCampuses0()),
            };

            s.LoadFamily();
            m.List.Add(s);
            if (m.OnlyOne)
            {
                return(Complete(m));
            }
            return(View("List", m));
        }