public ActionResult AsIsLogin(string usernameText, string passwordText)
        {
            LogInRequest       request  = new LogInRequest(usernameText, passwordText);
            ServiceBusResponse response = null;

            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                response = ConnectionManager.sendLogIn(request);
            }
            else
            {
                response = connection.sendLogIn(request);
            }

            if (response.result == false)
            {
                ViewBag.AsIsResponse = "Login Failed";
                return(View("Index"));
            }
            else
            {
                return(View("~/Views/Home/Index.cshtml"));
            }
        }
Exemplo n.º 2
0
        public ActionResult Login(string usernameData, string passwordData)
        {
            string username = usernameData;
            string password = passwordData;

            LogInRequest       LR = new LogInRequest(username, password);
            ServiceBusResponse response;

            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                response = ConnectionManager.sendLogIn(LR);
            }
            else
            {
                response = connection.sendLogIn(LR);
            }



            Response.Write("<script>alert('" + response.response + "')</script>");

            return(View("../Home/Index"));
        }
        public ActionResult LogIn(string username, string password)
        {
            LogInRequest request = new LogInRequest(username, password);

            ServiceBusResponse   response;
            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                response = ConnectionManager.sendLogIn(request);
            }
            else
            {
                response = connection.sendLogIn(request);
            }
            if (response.result)
            {
                ViewBag.LoginResponse = "Login Successful";
            }
            else
            {
                ViewBag.LoginResponse = "Invalid Username or Password";
            }

            return(View("Index"));
        }
Exemplo n.º 4
0
        //This class is incomplete and should be completed by the students in milestone 2
        //Hint: You will need to make use of the ServiceBusConnection class. See EchoController.cs for an example.

        public ActionResult Login(LogInRequest login)
        {
            //Do stuff with the new Login Info
            LogInRequest         request = login;
            ServiceBusResponse   response;
            ServiceBusConnection connection = ConnectionManager.getConnectionObject(Globals.getUser());

            if (connection == null)
            {
                response = ConnectionManager.sendLogIn(request);
            }
            else
            {
                response = connection.sendLogIn(request);
            }

            ViewBag.AsIsResponse = response.response;

            if (response.ToString().Equals("Login Successful"))
            {
                return(View("~/Home/Index"));
            }
            else
            {
                return(View("Index"));
            }
        }