Exemplo n.º 1
0
        private SearchPersonModel NewPerson(int FamilyId, SearchAddModel m)
        {
            var cv = new CodeValueModel();
            var p  = new SearchPersonModel
            {
                FamilyId   = FamilyId,
                index      = m.List.Count,
                Gender     = new CodeInfo(99, cv.GenderCodesWithUnspecified()),
                Marital    = new CodeInfo(99, cv.MaritalStatusCodes99()),
                Campus     = new CodeInfo(m.CampusId, cv.AllCampuses0()),
                EntryPoint = new CodeInfo(m.EntryPointId, cv.EntryPoints()),
                context    = m.type,
            };

#if DEBUG
            p.First     = "David";
            p.Last      = "Carr." + DateTime.Now.Millisecond;
            p.Gender    = new CodeInfo(0, cv.GenderCodesWithUnspecified());
            p.Marital   = new CodeInfo(0, cv.MaritalStatusCodes99());
            p.dob       = "na";
            p.Email     = "na";
            p.Phone     = "na";
            p.Address   = "na";
            p.Zip       = "na";
            p.HomePhone = "na";
#endif
            m.List.Add(p);
            return(p);
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        public SelectList CampusList()
        {
            var cv = new CodeValueModel();

            return(new SelectList(cv.AllCampuses0(), "Id", "Value"));
        }
Exemplo n.º 4
0
 public IEnumerable <SelectListItem> CampusList()
 {
     return(CodeValueModel.ConvertToSelect(cv.AllCampuses0(), "Id"));
 }
Exemplo n.º 5
0
        public static IEnumerable <SelectListItem> Campuses()
        {
            var cv = new CodeValueModel();

            return(CodeValueModel.ConvertToSelect(cv.AllCampuses0(), "Id"));
        }