public ApplyLeave()
 {
     InitializeComponent();
     this.Loaded += LeaveRequest_Loaded;
     leaveRequestRepository = new LeaveRequestRepository();
     progressMask.Show();
 }
Example #2
0
        private void ShowHomePage()
        {
            LoginRepository loginRepository = new LoginRepository();
            LeaveRequestRepository leaveRequestRepository = new LeaveRequestRepository();

            UserCredential userCredential = new UserCredential();
            userCredential.Username = username.Text;
            userCredential.Password = password.Text;

            ApplicationData.User = loginRepository.Validate(new UserCredential { Username = @"decurtis\lalit.bhatia", Password = "******" });
            ApplicationData.UserDashboard = loginRepository.GetDashboard(ApplicationData.User.UserId.ToString());
            ApplicationData.LeaveParameters = leaveRequestRepository.RetrieveLeave();

            if (ApplicationData.User != null)
            {
            this.Navigation.PushAsync(new MainTabbedPage());
            }
            else
            {
                // var answer = await DisplayAlert("Error", "Invalid username or password.", "OK", null);
                DisplayAlert("Error", "Invalid username or password.", "OK", null);
                //AlertMessage("Error", "Invalid username or password.");
            }
        }