Beispiel #1
0
        public ActionResult LoginValidation(User u)
        {
            using (var context = new ExamTeamManagementSystemEntities())
            {
                var data = context.TechnicalIssues.SqlQuery("[dbo].[SelectAllTechIssues]").ToList();
                Debug.WriteLine("Count Tech Issue" + data.Count());
            }

            Debug.WriteLine("Username" + u.UserName);
            Debug.WriteLine("Password" + u.Password);
            Debug.WriteLine("Selected Role" + u.URoleList);
            var collist = from s in _db.Users
                          where s.UserName == u.UserName && s.Password == u.Password && s.UserRole == u.URoleList.ToString()
                          select s;

            Debug.WriteLine("ReturnedRows" + collist.Count());

            if (collist.Count() > 0)
            {
                Session["Username"] = u.UserName;
                if (u.URoleList.ToString() == "ExamTeam")
                {
                    return(RedirectToAction("ExamTeamHomePage"));
                }
                else if (u.URoleList.ToString() == "ITUnitTeam")
                {
                    return(RedirectToAction("ITHomePage", "ITUnitTeam"));
                }
                else if (u.URoleList.ToString() == "LogisticsSupportTeam")
                {
                    Debug.WriteLine("I am in LogisticsTeam");
                    return(RedirectToAction("LogisticsHomePage", "LogisticsSupportTeam"));
                }
                return(RedirectToAction("ExamTeamHomePage"));
            }
            else
            {
                return(RedirectToAction("LoginFailurePage"));
            }
        }
Beispiel #2
0
 public ExamTeamController()
 {
     _db = new ExamTeamManagementSystemEntities();
 }
Beispiel #3
0
 public LogisticsSupportTeamController()
 {
     _db = new ExamTeamManagementSystemEntities();
 }