Example #1
0
        public ActionResult Setup(Person CU)
        {
            Person dbPerson = reposetory.GetPersonComplete(CurrentProfile.PersonID);
            if (CU == null | dbPerson.PersonID != CurrentProfile.PersonID) return HttpNotFound();
 
            dbPerson.ListLines = CU.ListLines < 10 ? 10 : CU.ListLines;
            if (dbPerson.CurrentAssociation != CU.CurrentAssociation) dbPerson.CurrentAssociation = CU.CurrentAssociation; 

            reposetory.SavePerson(dbPerson);
            CurrentProfile.Clear();
            ModelState.Clear();
            ViewBag.FormSucces = true;

            var Associations = dbPerson.Memberships.Select(d => new SelectListItem { Value = d.AssociationID.ToString(), Text = d.Association.Name }).ToList();
            if (Associations == null)
            {
                Associations = new List<SelectListItem>();
                Associations.Insert(0, new SelectListItem { Value = Guid.Empty.ToString(), Text = General.DropDownEmpty });
            }
            if (Associations != null)
            {
                ViewBag.Associations = Associations;
            }
            return View(CU);
        }
Example #2
0
        public ActionResult Setup()
        {
            Person CU = reposetory.GetPersonComplete(CurrentProfile.PersonID);
            if (CU == null) return HttpNotFound();

            var Associations = CU.Memberships.Select(d => new SelectListItem { Value = d.AssociationID.ToString(), Text = d.Association.Name }).ToList();
            if (Associations == null)
            {
                Associations = new List<SelectListItem>();
                Associations.Insert(0, new SelectListItem { Value = Guid.Empty.ToString(), Text = General.DropDownEmpty });
            }
            if (Associations != null) 
            {
                ViewBag.Associations = Associations;
            }

            return View(CU);
        }