public ActionResult Reference()
        {
            ViewBag.total = 0;
            string linkid;
            using (var context = new AssessmentEntities())
            {
                try
                {
                    linkid = Request.QueryString["linkid"].ToString();
                    var VerifyLink = context.ASSESSMENT_LINK.Where(link => link.RANDOM_STRING == linkid).ToList();

                    if (VerifyLink.Count == 1)
                    {
                        var linkDetails = VerifyLink.First();

                        var result = context.spRUBRICGETSEARCHRESULTS(linkDetails.DEPARTMENT_CD, linkDetails.OUTCOMES).ToList();
                        var rubRowID = result.Select(rubrowID => rubrowID.RUBRIC_ROWID.ToString()).ToList();
                        Session["RubRowIDS"] = rubRowID;
                        foreach (var item in rubRowID)
                        {
                            Session[item] = "0-0-0-0";
                        }
                        result.First().Instructor_EmailID = linkDetails.INSTRUCTOR_EMAILID;
                        return View(result);
                    }
                    else
                    {
                        ViewBag.ErrorMsg = "Invalid URL. Please check the Link again";
                        return View("Error");
                    }
                }
                catch (Exception ex)
                {
                    ViewBag.ErrorMsg = "Unable to fetch data. Please contact the Assessment officer";
                    return View("Error");
                }
            }
        }
 public ActionResult Search(FormCollection f)
 {
     using (var context = new AssessmentEntities())
     {
         try
         {
             string Outcomes = f["Outcomes"].ToString();
             string deptSelected = f["DEPARTMENT"].ToString();
             var result = context.spRUBRICGETSEARCHRESULTS(deptSelected, Outcomes).ToList();
             //saving variables for emailing
             Session["Outcome"] = Outcomes;
             Session["DEPARTMENT"] = deptSelected;
             return PartialView("_Search", result);
         }
         catch (Exception ex)
         {
             Response.Write(ex.Message);
             ViewBag.ErrorMsg = "Bad selection. No such rubric exist.";
             return View("Error");
         }
     }
 }
 public PartialViewResult getRubricDetails(spRUBRICSGETRECORD_RUBID_Result rubricRecord, AssessmentEntities context)
 {
     var results = context.spRUBRICGETSEARCHRESULTS(rubricRecord.DEPARTMENT_CD, rubricRecord.OUTCOMES).SingleOrDefault();
     return PartialView("_Search", results);
 }