public ActionResult step2(NonIncarceratedStep2 step2, string Command)
 {
     if (Session["formNo"] != null)
     {
         objNonIncarc  = new NonInCarceratedManger();
         objAccountMgr = new AccountManager();
         int mu1 = (int)WebSecurity.CurrentUserId;
         try
         {
             mu1 = Session["UserId"] == null ? WebSecurity.CurrentUserId : (int)Session["UserId"];
         }
         catch (Exception)
         {
         }
         string useraname = WebSecurity.CurrentUserName;
         step2.FormId = (int)Session["formNo"];
         step2        = objNonIncarc.insertStep2(step2, mu1, Command, out returnMessage, out isSuccess);
         if (isSuccess)
         {
             if (Command == "save")
             {
                 return(RedirectToAction("step3"));
             }
             else if (Command == "submit")
             {
                 sendSubmitEmail();
                 Session["formNo"] = null;
                 return(RedirectToAction("PDFView", "PDFReport", new { id = step2.FormId })); //PDFView(int id)
                 //return RedirectToAction("index", "FormSelect");
             }
             else
             {
                 return(RedirectToAction("step1"));
             }
         }
         else
         {
             return(View(step2));
         }
     }
     else
     {
         return(RedirectToAction("Index", "FormSelect"));
     }
 }
        public ActionResult step1(NonIncarceratedStep1 step1, string Command)
        {
            if (Session["formNo"] == null)
            {
                objNonIncarc = new NonInCarceratedManger();

                int mu1 = WebSecurity.CurrentUserId;
                try
                {
                    mu1 = Session["UserId"] == null ? WebSecurity.CurrentUserId : (int)Session["UserId"];
                }
                catch (Exception)
                {
                }
                step1 = objNonIncarc.insertStep1(step1, mu1, Command, out returnMessage, out isSuccess);
                if (isSuccess)
                {
                    Session["formNo"] = step1.FormId;
                    if (Command == "save")
                    {
                        return(RedirectToAction("step2"));
                    }
                    else
                    {
                        sendSubmitEmail();
                        Session["formNo"] = null;
                        return(RedirectToAction("PDFView", "PDFReport", new { id = step1.FormId })); //PDFView(int id)
                        //return RedirectToAction("index", "FormSelect");
                    }
                }
                else
                {
                    return(View(step1));
                }
            }
            else
            {
                Session["formNo"] = null;
                return(RedirectToAction("Index", "FormSelect"));
            }
        }
 //step 7
 public ActionResult step7()
 {
     objNonIncarc = new NonInCarceratedManger();
     if (Session["formNo"] == null)
     {
         return(View());
     }
     else
     {
         int formId = (int)Session["formNo"];
         NonIncarceratedStep7 step7 = objNonIncarc.getNonIncarceratedStep7(formId);
         if (step7 != null)
         {
             return(View(step7));
         }
         else
         {
             return(View());
         }
     }
 }
        public ActionResult showstep(int id)
        {
            objAccountMgr = new AccountManager();
            objNonIncarc  = new NonInCarceratedManger();
            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());
            }
        }