private async void LoadItemsInListView(string searchString = "")
        {
            bool fromSearch = !string.IsNullOrEmpty(searchString);

            ShowPB(true);

            if (fromSearch)
            {
                var newList = await HostelManager.GetHostelList(searchString);

                //listHostel.DataContext = null;
                listHostel.DataContext    = newList;
                listHostel.FooterTemplate = null;

                btnReset.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else
            {
                var newList = await HostelManager.GetNextHostelItems();

                //listHostel.DataContext = null;
                listHostel.DataContext    = newList;
                listHostel.FooterTemplate = footerTemplate;
            }
            ShowPB(false);
        }
Example #2
0
        private async void tbSubmit_Click(object sender, RoutedEventArgs e)
        {
            // Submit button clicked
            if (await ValidateData())
            {
#if DEBUG
                System.Diagnostics.Debug.WriteLine("Passed the validation on the data");
#endif

                var response = await HostelManager.RegisterUser(empId, fullName, location, lgName, emailId);

                if (response)
                {
                    Helper.ShowMessage("Successfully Registered", "Information");

                    // Update with new user information
                    UpdateUserInformation();

                    //Navigate
                    Frame.Navigate(typeof(MainPage));
                }
                else
                {
                    Helper.ShowMessage("Cannot register. Please try after sometime", "Error");
                }
            }
        }
 private void btnReset_Click(object sender, RoutedEventArgs e)
 {
     // Reset search button clicked
     HostelManager.ResetGetListHostel();
     btnReset.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
     tbSearch.Text       = string.Empty;
     LoadItemsInListView();
 }
        async void detailsControl_SubmitClicked(HostelItem hostelItem, FeedbackItem feedback)
        {
            screenRect.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

            bool success = await HostelManager.RegisterFeedback(hostelItem, feedback);

            if (success)
            {
#if DEBUG
                System.Diagnostics.Debug.WriteLine("Submitted successfully");
#endif
                Helper.ShowMessage("Thank you for your valuable feedback", "Information");
            }
            else
            {
                Helper.ShowMessage("Feedback cannot be uploaded, please try again later.", "Error");
            }
        }
 public HostelManagerBL()
 {
     hostelManager = new HostelManager();
 }
 private async void InitListView()
 {
     listHostel.DataContext = await HostelManager.GetNextHostelItems();
 }