Exemplo n.º 1
0
        private async Task <bool> IsFormValid()
        {
            bool returnValue = false;

            try
            {
                if (string.IsNullOrEmpty(entryOldPassword.Text))
                {
                    await DisplayAlertMessage("Old password cannot be empty");
                }
                else if (string.IsNullOrEmpty(entryNewPassword.Text))
                {
                    await DisplayAlertMessage("New password cannot be empty");
                }
                else
                {
                    returnValue = true;
                }
            }
            catch (Exception ex)
            {
                returnValue = false;
                PrintLog.PublishLog(ex);
            }
            return(returnValue);
        }
Exemplo n.º 2
0
        private async void SocialSharingTapped(object sender, EventArgs e)
        {
            //stackLoader.IsVisible = true;

            try
            {
                /*
                 * Image img = new Image()
                 * {
                 *  Source = "http://superwall.us/wallpaper/proposing_love_machine_rose_horse_robo_lady-oCrC.jpg",//"http://www.wintellect.com/devcenter/wp-content/uploads/2013/10/Wintellect_logo.gif",
                 *  Aspect = Aspect.AspectFit
                 * };
                 */
                //DependencyService.Get<IShareService>().Share(" ", "Hi Gopi. How are you?", img.Source);
                //App.Current.MainPage = new SocialMedia());
                //App.Current.MainPage = new SharePage();
                //App.Current.MainPage = new MasterPage("SurveyPage");
                ClosePage();
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
            //stackLoader.IsVisible = false;
        }
Exemplo n.º 3
0
        private async Task <bool> GetPageData()
        {
            //stackLoader.IsVisible = true;
            try
            {
                var responseData = await GetQuestions();

                var questionsData = Newtonsoft.Json.JsonConvert.DeserializeObject <QuizObject>(responseData);
                quizObject     = questionsData;
                totalQuestions = quizObject.questions_set.Count();

                labelQuestion.Text = quizObject.questions_set[0].Question;
                labelChoice1.Text  = quizObject.questions_set[0].Option1;
                labelChoice2.Text  = quizObject.questions_set[0].Option2;
                labelChoice3.Text  = quizObject.questions_set[0].Option3;
                labelChoice4.Text  = quizObject.questions_set[0].Option4;

                questioNumber           = 0;
                attemptedQuestions.Text = ((questioNumber + 1).ToString()) + "/" + totalQuestions;

                //labelQuestion.Text = "Which is the name of the robot that was given the saudi arabic Nationality ?";
                //labelChoice1.Text = "ELESA";
                //labelChoice2.Text = "Sofia";
                //labelChoice3.Text = "Jane";
                //labelChoice4.Text = "ChatBo";
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
            //stackLoader.IsVisible = false;
            return(true);
        }
Exemplo n.º 4
0
        private async Task <bool> IsFormValid()
        {
            bool returnValue = false;

            try
            {
                if (string.IsNullOrEmpty(entryUserMobile.Text))
                {
                    await DisplayAlertMessage("Mobile Number cannot be empty");
                }
                else if (!(Regex.IsMatch(entryUserMobile.Text, "^[1-9][0-9]{9}$")))
                {
                    await DisplayAlertMessage("Mobile Number is not valid, please enter a valid mobile number");
                }
                else if (string.IsNullOrEmpty(entryUserPassword.Text))
                {
                    await DisplayAlertMessage("Password cannot be empty");
                }
                else
                {
                    returnValue = true;
                }
            }
            catch (Exception ex)
            {
                returnValue = false;
                PrintLog.PublishLog(ex);
            }
            return(returnValue);
        }
Exemplo n.º 5
0
 public void GetLayouts(ObservableCollection <SubjectGroup> itemsGroup)
 {
     try
     {
         try
         {
             if (stackListHolder.Children.Count > 0)
             {
                 stackListHolder.Children.Clear();
             }
         }
         catch (Exception ex)
         {
             PrintLog.PublishLog(ex);
         }
         if (quizGroup != null && quizGroup.Count != 0)
         {
             OpenCloseLayout layout = new OpenCloseLayout(itemsGroup)
             {
                 HorizontalOptions = LayoutOptions.FillAndExpand,
                 VerticalOptions   = LayoutOptions.FillAndExpand
             };
             stackListHolder.Children.Add(layout);
         }
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 6
0
 private void entryUserPasswordUnFocused(object sender, FocusEventArgs e)
 {
     try
     {
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 7
0
 private async void HaveOTPTapped(object sender, EventArgs e)
 {
     try
     {
         Navigation.PushModalAsync(new UserVerification(), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 8
0
 private async void QuizTapped(object sender, EventArgs e)
 {
     try
     {
         //await Navigation.PushModalAsync(new UserProfile());
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 9
0
 private async void NavigationTapped(object sender, EventArgs e)
 {
     try
     {
         Navigation.PopModalAsync(false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 10
0
 private async void SearchTapped(object sender, EventArgs e)
 {
     try
     {
         SearchHolder.IsVisible = true;
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 11
0
 private async void LoginButtonClicked(object sender, EventArgs e)
 {
     try
     {
         Navigation.PushModalAsync(new UserLogin(), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 12
0
 public async Task <bool> StartTimer()
 {
     try
     {
         Device.StartTimer(TimeSpan.FromMilliseconds(500), startQuizTime);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     return(true);
 }
Exemplo n.º 13
0
 private async void CloseTapped(object sender, EventArgs e)
 {
     try
     {
         SearchHolder.IsVisible = false;
         //listQuizTopics.ItemsSource = quizGroup;
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 14
0
 private async Task <bool> DisplayAlertMessage(string msg)
 {
     try
     {
         await DisplayAlert("Alert", msg, "Cancel");
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     return(true);
 }
Exemplo n.º 15
0
 private async void RegisterButtonClicked(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         await Navigation.PushModalAsync(new UserRegistration(), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 16
0
 private async void QuizTapped(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         await Navigation.PushModalAsync(new SelectQuizSubject(new string[] { "Push" }), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 17
0
 private async void LogoutTapped(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         await Navigation.PushModalAsync(new UserLogin(), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 18
0
 public async Task <bool> ClosePage()
 {
     try
     {
         var parentDetailView = (MasterDetailPage)this.Parent;
         parentDetailView.IsPresented = false;
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     return(true);
 }
Exemplo n.º 19
0
 private async void MasterNavigationTapped(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         var ParentPage = (MasterDetailPage)this.Parent;
         ParentPage.IsPresented = (ParentPage.IsPresented == false) ? true : false;
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 20
0
 private async void SettingsTapped(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         timeSpan.Stop();
         await Navigation.PushModalAsync(new UserSettings(new string[] { "Push" }), false);
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 21
0
 private async void LotteryTapped(object sender, EventArgs e)
 {
     //stackLoader.IsVisible = true;
     try
     {
         App.Current.MainPage = new MasterPage("LotteryPage");
         ClosePage();
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
     //stackLoader.IsVisible = false;
 }
Exemplo n.º 22
0
 private void MobileNumberEdited(object sender, TextChangedEventArgs e)
 {
     try
     {
         var mobileNumber = e.NewTextValue;
         if (mobileNumber.Length > 10)
         {
             entryUserMobile.Text = entryUserMobile.Text.Remove((entryUserMobile.Text.Length) - 1);
         }
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 23
0
        private async Task <bool> IsFormValid()
        {
            bool returnValue;

            try
            {
                returnValue = true;
            }
            catch (Exception ex)
            {
                returnValue = false;
                PrintLog.PublishLog(ex);
            }
            return(returnValue);
        }
Exemplo n.º 24
0
        public SelectQuizSubject(string[] pageSettings)
        {
            InitializeComponent();
            pageType = pageSettings[0];
            if (pageType == "MasterPage")
            {
                imageMainNavigation.Source = ImageSource.FromFile("MenuHamBurger.png");
            }
            else
            {
                imageMainNavigation.Source = ImageSource.FromFile("LeftArrowWhite.png");
            }

            listQuizTopics.GroupHeaderTemplate = new DataTemplate(typeof(GroupUIView));
            listQuizTopics.ItemTemplate        = new DataTemplate(typeof(TopicUIView));
            GetListViewData();

            var height = (App.screenHeight * 1) / 100;
            var width  = (App.screenWidth * 1) / 100;

            pageTitle.FontSize = width * 6;

            var imageMetrices = width * 38;

            listQuizTopics.ItemSelected += (object sender, SelectedItemChangedEventArgs e) =>
            {
                try
                {
                    var selectedItem = ((ListView)sender).SelectedItem as QuizTopic;
                    if (selectedItem == null)
                    {
                        return;
                    }
                    Navigation.PushModalAsync(new Quiz(selectedItem), false);
                    ((ListView)sender).SelectedItem = null;
                }
                catch (Exception ex)
                {
                    PrintLog.PublishLog(ex);
                }
            };


            //imageSudoku.HeightRequest = imageMetrices;
            //imageSudoku.WidthRequest = imageMetrices;

            //gridDataInput.HeightRequest = height * 25;
        }
Exemplo n.º 25
0
        private async Task <bool> IsFormValid()
        {
            bool returnValue = false;

            try
            {
                if (string.IsNullOrEmpty(entrytUserFirstName.Text))
                {
                    await DisplayAlertMessage("First Name cannot be empty");
                }
                else if (string.IsNullOrEmpty(entryUserLastName.Text))
                {
                    await DisplayAlertMessage("Last Name cannot be empty");
                }
                else if (string.IsNullOrEmpty(entryUserMobile.Text))
                {
                    await DisplayAlertMessage("Mobile Number cannot be empty");
                }
                else if (!(Regex.IsMatch(entryUserMobile.Text, "^[1-9][0-9]{9}$")))
                {
                    await DisplayAlertMessage("Mobile Number is not valid, please enter a valid mobile number");
                }
                else if (string.IsNullOrEmpty(entryUserPassword.Text))
                {
                    await DisplayAlertMessage("Password cannot be empty");
                }
                else if (string.IsNullOrEmpty(entryUserEmail.Text))
                {
                    await DisplayAlertMessage("Email id is not valid, please enter a valid mobile number");
                }
                else if (!(Regex.IsMatch(entryUserEmail.Text, "^([1-9a-zA-Z.*]+)(@)([a-z|A-Z]+)(.)([a-z|A-Z]+)([.]{0,1})?([a-z|A-Z]+)$")))
                {
                    await DisplayAlertMessage("Invalid Email Id");
                }
                else
                {
                    returnValue = true;
                }
            }
            catch (Exception ex)
            {
                returnValue = false;
                PrintLog.PublishLog(ex);
            }
            return(returnValue);
        }
Exemplo n.º 26
0
        private async void UpdateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                var isValid = await IsFormValid();

                if (isValid)
                {
                    Navigation.PopModalAsync(false);
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
        }
Exemplo n.º 27
0
 private async void NavigationTapped(object sender, EventArgs e)
 {
     try
     {
         if (pageType == "MasterPage")
         {
             var ParentPage = (MasterDetailPage)this.Parent;
             ParentPage.IsPresented = (ParentPage.IsPresented == false) ? true : false;
         }
         else
         {
             Navigation.PopModalAsync(false);
         }
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 28
0
 private async void PasswordVisibilityClicked(object sender, EventArgs e)
 {
     try
     {
         if (entryUserPassword.IsPassword)
         {
             entryUserPassword.IsCustomPassword = false;
             entryUserPassword.IsPassword       = false;
         }
         else
         {
             entryUserPassword.IsCustomPassword = true;
             entryUserPassword.IsPassword       = true;
         }
     }
     catch (Exception ex)
     {
         PrintLog.PublishLog(ex);
     }
 }
Exemplo n.º 29
0
        private async void UpdateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                var isValid = await IsFormValid();

                if (isValid)
                {
                    Navigation.PushModalAsync(new UserVerification(), false);
                    //Navigation.PushModalAsync(new HomePage());
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
        }
Exemplo n.º 30
0
        private async void VerifyButtonClicked(object sender, EventArgs e)
        {
            try
            {
                var isValid = await IsFormValid();

                if (isValid)
                {
                    //App.Current.MainPage = new HomePage();
                    App.Current.MainPage = new MasterPage("HomePage");
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                PrintLog.PublishLog(ex);
            }
        }