public ActionResult EditStudyPerson(StudyPerson smodel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    CRUDStudyPerson cm = new CRUDStudyPerson();
                    if (cm.UpdateStudyPerson(smodel))
                    {
                        ViewBag.Message = "Thank you. Details for study participant " + smodel.PSCID + "(PSCID) have been updated successfully.";
                        ModelState.Clear();
                    }
                }
                //ViewBag.Message = "Study Participant Added Successfully";
                //return RedirectToAction("StudyPersonForm", new {PSCID = smodel.PSCID, StudyID = smodel.StudyID });
                //return View();

                CRUDStudyPerson crud = new CRUDStudyPerson();
                StudyList_Bind();              //Supply look-up list to drop down box for study name
                GetParticipantTypeList_Bind(); //supply participant type look up list
                GenderList_Bind();             //Supply gender type look up list
                //return View("EditStudyPerson");
                var PSCID   = smodel.PSCID;
                var StudyID = smodel.StudyID;
                //ViewBag.StudyID = smodel.StudyID;
                return(View(crud.GetStudyPersonList(PSCID, StudyID).Find(model => (smodel.PSCID == PSCID) && (smodel.StudyID == StudyID))));
            }
            catch (Exception ex)
            {
                return(View("Error", new HandleErrorInfo(ex, "StudyPersonSample", "EditStudyPersonStudyPerson"))); //create error view
            }
        }
        //GET: EditStudyPerson
        public ActionResult EditStudyPerson(string PSCID, string StudyID, string Message)
        {
            CRUDStudyPerson crud = new CRUDStudyPerson();

            ViewBag.PSCID   = PSCID;
            ViewBag.StudyID = StudyID;
            StudyList_Bind();              //Supply look-up list to drop down box for study name
            GetParticipantTypeList_Bind(); //supply participant type look up list
            GenderList_Bind();
            if (Message != "")
            {
                ViewBag.Message = Message;
            }
            //return View(crud.GetStudyPerson(PSCID,StudyID));
            return(View(crud.GetStudyPersonList(PSCID, StudyID).Find(smodel => (smodel.PSCID == PSCID) && (smodel.StudyID == StudyID))));
        }