Ejemplo n.º 1
0
        public ActionResult DASSTest(DASSResultModel lmd)
        {
            bool TheError = false;

            Connection.Connection con = new Connection.Connection();
            if (test1.Models.UserTest.IsValidUser != false)
            {
                lmd.TestDate     = DateTime.Now.Date.ToString("d");
                lmd.EndTime      = DateTime.Now.ToString("HH:mm");
                lmd.DASS.Test_Id = 1;
                lmd      = Calculate_Result(lmd);
                TheError = con.SaveTestResult(lmd, test1.Models.UserTest.ValidUser);
            }
            if (TheError == true)
            {
                ViewBag.Message = "";
                return(RedirectToAction("MyResult", "Home", lmd));
            }
            else
            {
                ViewBag.Message = "خطا در ثبت اطلاعات";
                return(View(lmd));
            }
        }