Esempio n. 1
0
        public IActionResult OnPost()
        {
            var username = HttpContext.Request.Form["username"];
            var password = HttpContext.Request.Form["password"];

            User user = LoginModule.Login(username, password);

            if (user == null)
            {
                // HTTP 302
                // Location /Message?MessageCode=1
                return(RedirectToPage("/Message", new { MessageCode = "1" }));
            }

            // See Auth.SessionExtensions
            HttpContext.Session.SetUser(user);

            Message = user.Username + " logged";

            IsUserLogged = true;

            if (Type != null && Type.Equals("json"))
            {
                return(Content("{username=\"" + user.Username + "\"}", "application/json", System.Text.Encoding.UTF8));
            }

            return(Page());
        }
Esempio n. 2
0
    void onConfirmClick()
    {
        string username = Username.text;
        string password = Password.text;

        loginModule.Login(username, password);
        //TODO: do some action
    }
Esempio n. 3
0
 void OnClickLogin()
 {
     if (isUseNameValid && isPasswordValid)
     {
         LoginModule loginModule = ModuleManager.Instance.EnsureModule <LoginModule>();
         loginModule.Login((uint)new System.Random().Next(100000, 999999), input_userName.text, input_password.text);
     }
 }
        public void Run_amenities_booking_cancellation_test(string url, string username, string password, string amenity, string time, string approvalDecision, string reply)
        {
            Browsers.Goto(url);

            // 1.Log in as a resident(i.e.use test user account)
            // 2. Enter bazinga Test Building community
            LoginModule login = new LoginModule();

            login.Login(username, password);

            Pages.home.WaitForWindowLoad();
            // 3. On the side navigation bar, click on Amenities
            Pages.home.ClickAmenities();
            System.Threading.Thread.Sleep(5000);
            // 4. Click on the Toddler Bootcamp amenity
            Pages.home.SelectAmenity(amenity);

            RequestABooking requestBooking = new RequestABooking();

            //5. From the datepicker, select a day when the amenity is open and bookable
            requestBooking.RequestaBooking();
            // 6.Click on Request a Booking
            // 7.Select a 1.5 hour time slot
            // 8.Click on Next
            // 9.Enter a custom message
            // 10.Click on Submit Request
            requestBooking.SetBooking("6 pm", time);
            // 11.Verify the accuracy of the info in the amenity booking card
            // 13.Verify the newly submitted booking request is shown as an orange block in the timeline bar
            //requestBooking.VerifyBooking("6:00pm - 10:45pm");
            // 12. Take note of the ticket number (e.g. A00780)
            string ticketNubmer = requestBooking.GetBookingTicket();

            Console.WriteLine("Ticket number " + ticketNubmer);

            HelpDeskModule helpdesk = new HelpDeskModule();

            //14.On the side navigation bar, click on Help Desk
            //15.Search for the new amenity booking request by ticket number
            //16.Click on the newly created ticket
            //17.On the ticket detail page, post a reply(e.g.I want to cancel my booking) in the thread with an image attachment
            //18.Verify the reply was correctly posted with an image attachment in the message thread
            //19.On top of the page, click on Cancel this booking
            helpdesk.CancelBooking(ticketNubmer, reply);
            //20.Verify the amenity booking request has been moved to a status of Denied and the ticket has been archived
            helpdesk.VerifyBookingStatus(approvalDecision);
            Pages.home.SignOut();
        }
Esempio n. 5
0
    /// <summary>
    /// 游戏模块开始运行入口
    /// </summary>
    public void GameStart()
    {
        LoginModule loginModule = moduleMgr.GetModule <LoginModule>();

        loginModule.Login();
    }