public ActionResult step5(IncarceratedStep5 step5, string Command)
 {
     if (Session["formNo"] != null)
     {
         objIncarc = new InCarceratedManger();
         int mu1 = (int)WebSecurity.CurrentUserId;
         try
         {
             mu1 = Session["UserId"] == null ? WebSecurity.CurrentUserId : (int)Session["UserId"];
         }
         catch (Exception)
         {
         }
         step5.FormId = (int)Session["formNo"];
         step5        = objIncarc.insertStep5(step5, mu1, Command, out returnMessage, out isSuccess);
         if (isSuccess)
         {
             if (Command == "save")
             {
                 return(RedirectToAction("step6"));
             }
             else if (Command == "submit")
             {
                 sendSubmitEmail();
                 Session["formNo"] = null;
                 return(RedirectToAction("PDFView", "PDFReport", new { id = step5.FormId })); //PDFView(int id)
                 //return RedirectToAction("index", "FormSelect");
             }
             else
             {
                 return(RedirectToAction("step5"));
             }
         }
         else
         {
             return(View(step5));
         }
     }
     else
     {
         return(RedirectToAction("Index", "FormSelect"));
     }
 }
 //step 7
 public ActionResult step7()
 {
     objIncarc = new InCarceratedManger();
     if (Session["formNo"] == null)
     {
         return(View());
     }
     else
     {
         int formId = (int)Session["formNo"];
         IncarceratedStep7 step7 = objIncarc.getIncarceratedStep7(formId);
         if (step7 != null)
         {
             return(View(step7));
         }
         else
         {
             return(View());
         }
     }
 }
        public ActionResult showstep(int id)
        {
            objAccountMgr = new AccountManager();
            objIncarc     = new InCarceratedManger();
            int CurrentUserId = WebSecurity.CurrentUserId;

            try
            {
                CurrentUserId = Session["UserId"] == null ? WebSecurity.CurrentUserId : (int)Session["UserId"];
            }
            catch (Exception)
            {
            }
            if (objAccountMgr.checkFormOwner(id, CurrentUserId))
            {
                Session["formNo"] = id;
                return(RedirectToAction("step1"));
            }
            else
            {
                return(View());
            }
        }