Ejemplo n.º 1
0
 public void GivenILoggedIntoDesignerApplication()
 {
     if (!LoginUtil.Login(ObjectRepository.config.getUserName(), ObjectRepository.config.getPassword()))
     {
         ScenarioContext.Current["ActResult"] = "Failed";
     }
 }
Ejemplo n.º 2
0
        public ActionResult Index(LoginBundle Creds)
        {
            string UserName = string.Empty;
            string Password = string.Empty;
            string Table    = string.Empty;
            string Redirect = string.Empty;

            if (Creds.WhichLogin == 1)
            {
                // Principal creds
                UserName = Creds.PrincipalCreds.Email;
                Password = Creds.PrincipalCreds.Password;
                Table    = "principal";
                Redirect = "Principal";
                ViewBag.PrincipalActive = "active";
                ViewBag.PrincipalError  = "active";
            }
            else if (Creds.WhichLogin == 2)
            {
                // Hod creds
                UserName          = Creds.HodCreds.Email;
                Password          = Creds.HodCreds.Password;
                Table             = "hod";
                Redirect          = "Hod";
                ViewBag.HODActive = "active";
                ViewBag.HODError  = "active";
            }
            else if (Creds.WhichLogin == 3)
            {
                // Faculty creds
                UserName = Creds.FacultyCreds.Email;
                Password = Creds.FacultyCreds.Password;
                Table    = "faculty";
                Redirect = "Faculty";
                ViewBag.TeacherActive = "active";
                ViewBag.TeacherError  = "active";
            }

            LoginUtil util = new LoginUtil();

            if (util.Login(UserName, Password, Table))
            {
                return(RedirectToAction("Index", Redirect));
            }
            else
            {
                return(View());
            }
        }