Ejemplo n.º 1
0
        public ActionResult PositionCreate(ContactPosition contactPosition)
        {
            if (ModelState.IsValid)
            {
                contactPosition.DistKey = GlobalVariables.DistKey;
                db.ContactPosition.Add(contactPosition);
                db.SaveChanges();
                return RedirectToAction("ContactsEdit",new { id = contactPosition.ContactID });
            }

            return View(contactPosition);
        }
Ejemplo n.º 2
0
 public ActionResult PositionCreate(int ID)
 {
     ContactPosition newPosition = new ContactPosition();
     newPosition.ContactID = ID;
     newPosition.DistKey = GlobalVariables.DistKey;
     SelectList PositionList = new SelectList(db.Positions.ToList(), "pKey", "PositionName", db.Positions);
     ViewData["PositionList"] = PositionList;
     SelectList GroupList = new SelectList(db.Groups.Where(x => x.DistKey == GlobalVariables.DistKey).ToList(), "pKey", "GroupName", db.Groups);
     ViewData["GroupList"] = GroupList;
     return View("PositionCreate", newPosition);
 }