// GET: HBS public ActionResult Home(int id) { //get current username string loginName = User.Identity.Name; Session["LoginName"] = loginName; //instanciate model repositry //instanciate model repositry PCMCaseModel caseModel = new PCMCaseModel(); //instanciate viewmodel PCMPersonViewModel personVM = new PCMPersonViewModel(); //get person id by assessment id personVM.IntakeAssPar = id; bool IntakeAssessmentIdExisit = db.PCM_HB_Supervision.Any(x => x.Intake_Assessment_Id == id); int ClientRefid = caseModel.GetClientRefIdssId(id); //Get Module Reference number .................... string ClientRef = caseModel.GetClientRef(ClientRefid); Session["ClientRef"] = ClientRef; Session["IntakeassId"] = id; ViewBag.ModuleRef = ClientRef; int?Placementid = preModel.GetPlacementId(id); ViewBag.MessagePlacement = Placementid; Session["Placement"] = Placementid; if (IntakeAssessmentIdExisit) { Session["Idc1"] = id; Session["IntakeassId"] = id; return(View(personVM)); } else { Session["Idc1"] = id; Session["IntakeassId"] = id; //Response.Write("does not Exist"); return(View(personVM)); } }
public ActionResult Home(int id) { //get current username string loginName = User.Identity.Name; Session["LoginName"] = loginName; //instanciate model repositry PCMCaseModel caseModel = new PCMCaseModel(); //instanciate viewmodel PCMPersonViewModel personVM = new PCMPersonViewModel(); //get person id by assessment id personVM.IntakeAssPar = id; int ClientRefid = caseModel.GetClientRefIdssId(id); //Get Module Reference number .................... string ClientRef = caseModel.GetClientRef(ClientRefid); Session["ClientRef"] = ClientRef; Session["IntakeassId"] = id; ViewBag.ModuleRef = ClientRef; //int assID = Convert.ToInt32(Session["IntakeassId"]); int?Placementid = preModel.GetPlacementId(id); ViewBag.MessagePlacement = Placementid; Session["Placement"] = Placementid; return(View(personVM)); }