async void bindResendData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "phone=" + MobileNumber + ""; var result = await CommonLib.ResendVerificationCode(CommonLib.ws_MainUrl + "ResendOtp?" + postData); if (result != null && result.Status != 0) { LoadPopup.CloseAllPopup(); // VoteAlertPopup.textmsg = Convert.ToString(result.Otp); // await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }
private async void YesButton_Clicked(object sender, EventArgs e) { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await App.Current.MainPage.Navigation.PushPopupAsync(new LoadPopup()); var response = await CommonLib.PartyVote(CommonLib.ws_MainUrlMain + "CandidatureApi/Vote?" + "userId=" + LoginDetails.userId + "&CandidatureCode=" + partyCode + ""); if (response.Status == 1) { isSave = true; CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.youVoted; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } else { isSave = false; LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = response.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { isSave = false; } }
//get help text async void bindhelpData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.HelpResult(CommonLib.ws_MainUrlMain + "ContactApi/HelpText"); if (result != null && result.Status != 0) { LoadPopup.CloseAllPopup(); helpText.Text = result.Note.HelpText; } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }
public async Task LeaderWinnerPikerSelect() { try { await Navigation.PushPopupAsync(new LoadPopup()); string postData = "type=" + LeaderwinnerType; var result = await CommonLib.LeaderWinnerChart(CommonLib.ws_MainUrlMain + "LeaderApi/LeaderWinner?" + postData); if (result != null && result.Status != 0) { _rateWinnerModel.Clear(); foreach (var item in result.chartData) { string name = item.Name.Replace("'", ""); // _rateWinnerModel.Add(new LeaderWinner { LeaderColor = item.LeaderColor, Name = name, PCode = item.PCode, per = item.per, PSName = item.PSName }); } var LeaderWinnerchartConfigScript1 = GetLeaderWinnerChartScript(); var htmlLeaderWinner = GetHtmlWithLeaderWinnerChartConfig(LeaderWinnerchartConfigScript1); LeaderWinner.Html = htmlLeaderWinner; LoadPopup.CloseAllPopup1(); } else { VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); LoadPopup.CloseAllPopup1(); } } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); LoadPopup.CloseAllPopup1(); } }
private async void UserType_Clicked(object sender, EventArgs e) { if (Device.RuntimePlatform == Device.iOS) { await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.IOSPaymentData(CommonLib.ws_MainUrl + "IOSPayment"); if (result.Status == 1) { LoadPopup.CloseAllPopup(); string textLbl = Resx.AppResources.pricePackage + ": " + result.keyPrice + " € " + Resx.AppResources.fora + " " + result.keyTime + " " + Resx.AppResources.monthLicence; var ans = await DisplayAlert("", textLbl, Resx.AppResources.yes, Resx.AppResources.cancel); if (ans == true) { var paymentresult = await DependencyService.Get <DependencyInterface.IPremiumMembership>().MakePayment(result.keyName); if (paymentresult.IsPaid == true) { PremimumUser(); } } } else { LoadPopup.CloseAllPopup(); } } else { PaymentAlertPopup popup = new PaymentAlertPopup(); popup.Disappearing += Popup_Disappearing; await App.Current.MainPage.Navigation.PushPopupAsync(popup); } }
//Get all category public async void LoadCategory() { try { await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.GetCategory(CommonLib.ws_MainUrlMain + "CategoryApi/GetAllCategory"); if (result != null && result.Status != 0) { InitializeComponent(); Title = Resx.AppResources.category; myList.ItemsSource = result.CategoryData; LoadPopup.CloseAllPopup1(); } else { VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); LoadPopup.CloseAllPopup1(); } } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); LoadPopup.CloseAllPopup1(); } iosCheck(); }
public async Task LeaderChartData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "rateType=" + rateType + "&RegionCode=" + RegionCode + "&ProvinceCode=" + ProvinceCode; var result = await CommonLib.leaderChart(CommonLib.ws_MainUrlMain + "LeaderApi/LeaderVoteFilterPersent?" + postData); if (result != null && result.Status != 0) { leaderchartName = result.chartData.ChartName; leaderColor = result.chartData.LeaderColor; leadername = result.chartData.LeaderName; leadervote = result.chartData.Votes; // InitializeComponent(); Title = "Leader Charts"; if (ChartNameId == 3) { leaderGraph.HeightRequest = (height / 2); } LeaderMultiLineGraph.HeightRequest = (height / 2) + 120; LeaderGroupGraph.HeightRequest = (height / 2); LeaderWinnerGraph.HeightRequest = (height / 2); pickerProductCategory.Items.Add("Last 7 Days"); pickerProductCategory.Items.Add("Last 15 Days"); pickerProductCategory.Items.Add("Last 30 Days"); pickerProductCategory.Items.Add("Last 60 Days"); pickerProductCategory.Items.Add("Last 1 year"); pickerProductCategory.Items.Add("All"); pickerLeaderLineGraph.Items.Add("Last 1 year"); pickerLeaderLineGraph.Items.Add("Last 6 month"); pickerLeaderLineGraph.Items.Add("Last 2 month"); if (ChartNameId == 3) { if (result.chartData.LeaderColor.Count == 0) { leaderLabel.IsVisible = true; leaderGraph.IsVisible = false; } else { leaderLabel.IsVisible = false; leaderGraph.IsVisible = true; } } dropdown = true; if (rateType == "7days") { pickerProductCategory.SelectedIndex = 0; } else if (rateType == "15days") { pickerProductCategory.SelectedIndex = 1; } else if (rateType == "30days") { pickerProductCategory.SelectedIndex = 2; } else if (rateType == "60days") { pickerProductCategory.SelectedIndex = 3; } else if (rateType == "1year") { pickerProductCategory.SelectedIndex = 4; } var resultPostal = await CommonLib.postalData(CommonLib.ws_MainUrlMain + "PostalApi/Region"); if (resultPostal != null && resultPostal.Status != 0) { PostalDetail _p = new PostalDetail(); _p.RegionName = "Total country"; _p.RegionCodeINE = ""; resultPostal.data.Insert(0, _p); foreach (var item in resultPostal.data) { pickerRegion.ItemsSource = resultPostal.data; } } if (ChartNameId == 7) { await LeaderEvaluationChart(); var LeaderMultiLinechartConfigScript1 = GetLeaderMultiLineChartScript(); var htmlLeaderMultiLine = GetHtmlWithLeaderMultiLineChartConfig(LeaderMultiLinechartConfigScript1); LeaderMultiLine.Html = htmlLeaderMultiLine; } if (ChartNameId == 8) { await LeaderGroupChart(); var LeaderGroupchartConfigScript1 = GetLeaderGroupChartScript(); var htmlLeaderGroup = GetHtmlWithLeaderGroupChartConfig(LeaderGroupchartConfigScript1); LeaderGroup.Html = htmlLeaderGroup; } if (ChartNameId == 9) { await LeaderWinnerChart(); var LeaderWinnerchartConfigScript1 = GetLeaderWinnerChartScript(); var htmlLeaderWinner = GetHtmlWithLeaderWinnerChartConfig(LeaderWinnerchartConfigScript1); LeaderWinner.Html = htmlLeaderWinner; } if (ChartNameId == 3) { leaderGraph.IsVisible = true; var chartConfigScript = GetChartScript1(); var html = GetHtmlWithChartConfig1(chartConfigScript); e.Html = html; } // LoadPopup.CloseAllPopup(); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } }
private async void NextClickedButton(EventArgs e) { //Validation Part string msg = string.Empty; mobileNumber = txtCreateNwAccnMobile.Text; birthOfYear = txtCreateNwAccnDOB.Text; postalCode = txtCreateNwAccnPostalCode.Text; wholeMobileNumber = txtCreateNwAccnMobile.Text; //for ios if (Device.OS == TargetPlatform.iOS && !string.IsNullOrEmpty(postalCode)) { if (string.IsNullOrEmpty(postalCode)) { msg = Resx.AppResources.validPostalCode + Environment.NewLine; } else { if (postalCode.Length < 5 || postalCode.Length > 5) { msg = Resx.AppResources.postalcodefivedigit + Environment.NewLine; } else { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "postalCode=" + postalCode; var result = await CommonLib.GetProvince(CommonLib.ws_MainUrl + "GetProvinceName?" + postData); if (result.Status == 1) { LoadPopup.CloseAllPopup(); ProvinceName = result.ProvinceName; } else { LoadPopup.CloseAllPopup(); msg = Resx.AppResources.validPostalCode + Environment.NewLine; } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } } } } //for ios if (Device.OS == TargetPlatform.Android) { if (string.IsNullOrEmpty(postalCode)) { msg = Resx.AppResources.validPostalCode + Environment.NewLine; } else { if (postalCode.Length < 5 || postalCode.Length > 5) { msg = Resx.AppResources.postalcodefivedigit + Environment.NewLine; } else { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "postalCode=" + postalCode; var result = await CommonLib.GetProvince(CommonLib.ws_MainUrl + "GetProvinceName?" + postData); if (result.Status == 1) { LoadPopup.CloseAllPopup(); ProvinceName = result.ProvinceName; } else { LoadPopup.CloseAllPopup(); msg = Resx.AppResources.validPostalCode + Environment.NewLine; } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } } } } //for ios if (Device.OS == TargetPlatform.Android) { if (string.IsNullOrEmpty(genderType)) { msg = Resx.AppResources.pleaseselectgender + Environment.NewLine; } } //for ios if (Device.OS == TargetPlatform.Android) { if (string.IsNullOrEmpty(birthOfYear)) { msg = Resx.AppResources.selectBirthYear + Environment.NewLine; } } if (string.IsNullOrEmpty(mobileNumber)) { msg = Resx.AppResources.enterMobile + Environment.NewLine; } else { if (mobileNumber.Length < 9 || mobileNumber.Length > 9) { msg = Resx.AppResources.yourMobileNumberMustbe + Environment.NewLine; } } if (!string.IsNullOrEmpty(msg)) { VoteAlertPopup.textmsg = msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } //Fetching Part mobileNumber = txtCreateNwAccnMobile.Text; birthOfYear = txtCreateNwAccnDOB.Text; postalCode = txtCreateNwAccnPostalCode.Text; await Navigation.PushAsync(new PreviewOfRegistrationPage(mobileNumber, birthOfYear, postalCode, wholeMobileNumber, genderType, prefixCode, ProvinceName), true); }
public async void PackageDetails() { try { await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.GetPackage(CommonLib.ws_MainUrlMain + "PackageApi/GetPackage"); if (result != null && result.Status != 0) { price = result.details.PackagePrice; try { string msg = string.Empty; if (string.IsNullOrEmpty(txtcardNumber.Text)) { msg += Resx.AppResources.entercard + Environment.NewLine; } else { if (txtcardNumber.Text.Length != 16) { msg += Resx.AppResources.entervalidcard + Environment.NewLine; } } if (string.IsNullOrEmpty(txtCVVNumber.Text)) { msg += Resx.AppResources.entercvv + Environment.NewLine; } else { if (txtCVVNumber.Text.Length != 3) { msg += Resx.AppResources.entervalidcvv + Environment.NewLine; } } if (string.IsNullOrEmpty(txtMonth.Text)) { msg += Resx.AppResources.entermonth + Environment.NewLine; } else { if (Convert.ToInt32(txtMonth.Text) > 12) { msg += Resx.AppResources.entervalidmonth + Environment.NewLine; } } if (string.IsNullOrEmpty(txtYear.Text)) { msg += Resx.AppResources.enteryear + Environment.NewLine; } else { int curYear = Convert.ToInt32(DateTime.Now.Year.ToString().Substring(1)); if (Convert.ToInt32(txtYear.Text) < curYear) { msg += Resx.AppResources.entervalidyear + Environment.NewLine; } } if (!string.IsNullOrEmpty(msg)) { LoadPopup.CloseAllPopup3(); await App.Current.MainPage.DisplayAlert("", msg, "OK"); return; } StripeCardInfo cardInfo = new StripeCardInfo(); cardInfo.CardNumber = txtcardNumber.Text; cardInfo.CCV = txtCVVNumber.Text; cardInfo.Month = Convert.ToInt32(txtMonth.Text); cardInfo.Year = Convert.ToInt32(txtYear.Text); double Amount = Convert.ToDouble(price); var paymentresult = await DependencyService.Get <ICustomStripeService>().MakePayment(cardInfo, Amount); if (!paymentresult.IsPaid) { LoadPopup.CloseAllPopup3(); MyProfilePage.checkPremimun = false; await App.Current.MainPage.DisplayAlert("", paymentresult.FailureMessage, "OK"); return; } else { await App.Current.MainPage.DisplayAlert("", Resx.AppResources.PaymentSuccessful, "OK"); MyProfilePage.checkPremimun = true; PremimumUser(); } } catch (Exception) { } LoadPopup.CloseAllPopup1(); } else { LoadPopup.CloseAllPopup1(); } } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); LoadPopup.CloseAllPopup1(); } }
private async void bindData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } // Fetching all input digit FirstNumber = txtFirstNumber.Text; SecondNumber = txtSecondNumber.Text; ThirdNumber = txtThirdNumber.Text; FourthNumber = txtFourthNumber.Text; string otp = FirstNumber + SecondNumber + ThirdNumber + FourthNumber; await Navigation.PushPopupAsync(new LoadPopup()); string postData = "phone=" + MobileNumber + "&otp=" + otp + ""; var result = await CommonLib.VerificationCode(CommonLib.ws_MainUrl + "VerifyOtp?" + postData); if (result != null && result.Status != 0) { LoadPopup.CloseAllPopup(); // Save data in sqlite for login check Model.loggedInUser objUser = new Model.loggedInUser(); objUser.userId = Convert.ToString(result.User.id); objUser.mobile = result.User.phone; objUser.sessionId = result.SessionId; objUser.userType = result.User.typeOfUser; objUser.lifeLine = result.User.Lifeline; App.Database.SaveLoggedUser(objUser); // Get the data in login detail model,For further purpose LoginDetails.userId = Convert.ToString(result.User.id); LoginDetails.mobile = result.User.phone; LoginDetails.sessionId = result.SessionId; LoginDetails.userType = result.User.typeOfUser; LoginDetails.lifeLine = result.User.Lifeline; UpdateDeviceId(); await Application.Current.MainPage.Navigation.PushAsync(new Views.BottomPageView()); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }
private async void YesButton_Clicked(object sender, EventArgs e) { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.leaderRate(CommonLib.ws_MainUrlMain + "LeaderApi/GiveRate?" + "userId=" + LoginDetails.userId + "&leaderCode=" + leaderID + "&rate=" + starValue + ""); if (result != null && result.Status != 0) { if (LoginDetails.sessionId == result.SessionId) { LoadPopup.CloseAllPopup(); RateLeaderPopUpPage.isSaved = true; await Navigation.PopAllPopupAsync(); VoteAlertPopup.textmsg = Resx.AppResources.youRatedSucessfull; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } else { RateLeaderPopUpPage.isSaved = false; CloseAllPopup(); LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.yourSession; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); App.Current.MainPage = new Views.LogInPage(); } } else { RateLeaderPopUpPage.isSaved = false; LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { RateLeaderPopUpPage.isSaved = false; LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } }
public async Task PikerSelect() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "rateType=" + rateType + "&RegionCode=" + RegionCode + "&ProvinceCode=" + ProvinceCode; var result = await CommonLib.leaderChart(CommonLib.ws_MainUrlMain + "LeaderApi/LeaderVoteFilterPersent?" + postData); if (result != null && result.Status != 0) { leaderchartName = result.chartData.ChartName; leaderColor = result.chartData.LeaderColor; leadername = result.chartData.LeaderName; leadervote = result.chartData.Votes; if (ChartNameId == 3) { if (result.chartData.LeaderColor.Count == 0) { leaderLabel.IsVisible = true; leaderGraph.IsVisible = false; } else { leaderLabel.IsVisible = false; leaderGraph.IsVisible = true; } } if (ChartNameId == 7) { await LeaderEvaluationChart(); var LeaderMultiLinechartConfigScript1 = GetLeaderMultiLineChartScript(); var htmlLeaderMultiLine = GetHtmlWithLeaderMultiLineChartConfig(LeaderMultiLinechartConfigScript1); LeaderMultiLine.Html = htmlLeaderMultiLine; } if (ChartNameId == 3) { var chartConfigScript = GetChartScript1(); var html = GetHtmlWithChartConfig1(chartConfigScript); e.Html = html; } // LoadPopup.CloseAllPopup(); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } }
// Binding data for popUp rating async void bindRatingLeader() { var ans = await DisplayAlert("", Resx.AppResources.wouldYouLikeRate + " " + leaderName, Resx.AppResources.yes, Resx.AppResources.no); if (ans == true) { try { if (!CommonLib.checkconnection()) { await DisplayAlert("", Resx.AppResources.checkInternet, Resx.AppResources.ok); return; } await Navigation.PushPopupAsync(new LoadPopup()); string starValue = ratingVal.Text; var result = await CommonLib.leaderRate(CommonLib.ws_MainUrlMain + "LeaderApi/GiveRate?" + "userId=" + LoginDetails.userId + "&leaderCode=" + leaderID + "&rate=" + starValue + ""); if (result != null && result.Status != 0) { if (LoginDetails.sessionId == result.SessionId) { LoadPopup.CloseAllPopup(); isSaved = true; CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.youRatedSucessfull; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } else { isSaved = false; CloseAllPopup(); LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.yourSession; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); App.Current.MainPage = new Views.LogInPage(); } } else { isSaved = false; LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { isSaved = false; LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } } }
//get postal code data async void bindChangePostalCodeData() { try { if (!CommonLib.checkconnection()) { //await DisplayAlert("", "Check your internet connection.", "Okay"); VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); // fetching detail from uder input string newPostalCode = newPostalCodeEntry.Text; var result = await CommonLib.ChangePostalCode(CommonLib.ws_MainUrl + "UpdatePostalCode?" + "Id=" + LoginDetails.userId + "&newCode=" + newPostalCode + ""); if (result != null && result.Status != 0) { if (LoginDetails.sessionId == result.SessionId) { VoteAlertPopup.textmsg = Resx.AppResources.Postalcodeupdated; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.yourSession; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); App.Current.MainPage = new Views.LogInPage(); } } else { LoadPopup.CloseAllPopup(); //await App.Current.MainPage.DisplayAlert("", result.msg, "ok"); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }
public async Task ChartData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); // InitializeComponent(); Title = "Candidature Charts"; partyGraph.HeightRequest = (height / 2); CandidaturedoughnutGraph.HeightRequest = (height / 2); CandidatureMultiLineGraph.HeightRequest = (height / 2) + 120; CandidatureGroupGraph.HeightRequest = (height / 2); CandidatureWinnerGraph.HeightRequest = (height / 2); // pickerProductCategory.Items.Add("Last 7 Days"); pickerProductCategory.Items.Add("Last 15 Days"); pickerProductCategory.Items.Add("Last 30 Days"); pickerProductCategory.Items.Add("Last 60 Days"); pickerProductCategory.Items.Add("Last 1 year"); pickerProductCategory.Items.Add("All"); pickerLineGraph.Items.Add("Last 1 year"); pickerLineGraph.Items.Add("Last 6 month"); pickerLineGraph.Items.Add("Last 2 month"); dropdown = true; if (rateType == "7days") { pickerProductCategory.SelectedIndex = 0; } else if (rateType == "15days") { pickerProductCategory.SelectedIndex = 1; } else if (rateType == "30days") { pickerProductCategory.SelectedIndex = 2; } else if (rateType == "60days") { pickerProductCategory.SelectedIndex = 3; } else if (rateType == "1year") { pickerProductCategory.SelectedIndex = 4; } var resultPostal = await CommonLib.postalData(CommonLib.ws_MainUrlMain + "PostalApi/Region"); if (resultPostal != null && resultPostal.Status != 0) { PostalDetail _p = new PostalDetail(); _p.RegionName = "Total country"; _p.RegionCodeINE = ""; resultPostal.data.Insert(0, _p); foreach (var item in resultPostal.data) { pickerRegion.ItemsSource = resultPostal.data; } } if (ChartNameId == 1) { await CandidatureChartData(); var chartConfigScript1 = GetChartScript(); var html1 = GetHtmlWithChartConfig(chartConfigScript1); d.Html = html1; } if (ChartNameId == 2) { await CandidatureDoughnutChartData(); var DoughnutchartConfigScript1 = GetDoughnutChartScript(); var htmlDoughnut = GetHtmlWithDoughnutChartConfig(DoughnutchartConfigScript1); Candidaturedoughnut.Html = htmlDoughnut; } if (ChartNameId == 4) { await CandidatureEvaluationChart(); var MultiLinechartConfigScript1 = GetMultiLineChartScript(); var htmlMultiLine = GetHtmlWithMultiLineChartConfig(MultiLinechartConfigScript1); CandidatureMultiLine.Html = htmlMultiLine; } if (ChartNameId == 5) { await CandidatureGroupChart(); var GroupchartConfigScript1 = GetGroupChartScript(); var htmlGroup = GetHtmlWithGroupChartConfig(GroupchartConfigScript1); CandidatureGroup.Html = htmlGroup; } if (ChartNameId == 6) { await CandidatureWinnerChart(); var WinnerchartConfigScript1 = GetWinnerChartScript(); var htmlWinner = GetHtmlWithWinnerChartConfig(WinnerchartConfigScript1); CandidatureWinner.Html = htmlWinner; } LoadPopup.CloseAllPopup(); } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } }
private async void submitButton_Clicked(object sender, EventArgs e) { //Validation Part string msg = string.Empty; string birthOfYear = txtCreateNwAccnDOB.Text; string postalCode = txtCreateNwAccnPostalCode.Text; if (string.IsNullOrEmpty(postalCode)) { msg = Resx.AppResources.validPostalCode + Environment.NewLine; } else { if (postalCode.Length < 5 || postalCode.Length > 5) { msg = Resx.AppResources.postalcodefivedigit + Environment.NewLine; } else { try { if (!CommonLib.checkconnection()) { await App.Current.MainPage.DisplayAlert("", Resx.AppResources.checkInternet, "OK"); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "postalCode=" + postalCode; var result = await CommonLib.GetProvince(CommonLib.ws_MainUrl + "GetProvinceName?" + postData); if (result.Status == 1) { LoadPopup.CloseAllPopup3(); } else { LoadPopup.CloseAllPopup3(); msg = Resx.AppResources.validPostalCode + Environment.NewLine; } } catch (Exception ex) { LoadPopup.CloseAllPopup3(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } } } if (string.IsNullOrEmpty(birthOfYear)) { msg = Resx.AppResources.selectBirthYear + Environment.NewLine; } if (string.IsNullOrEmpty(genderType)) { msg = Resx.AppResources.pleaseselectgender + Environment.NewLine; } if (!string.IsNullOrEmpty(msg)) { await App.Current.MainPage.DisplayAlert("", msg, "OK"); return; } try { await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.ChangePostalCode(CommonLib.ws_MainUrl + "UpdateDobAndPostal?" + "Id=" + LoginDetails.userId + "&Code=" + postalCode + "&Dob=" + birthOfYear + "&gender=" + genderType); if (result.Status != 0) { await App.Current.MainPage.DisplayAlert("", Resx.AppResources.Sucess, "OK"); LoadPopup.CloseAllPopup(); } else { } } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } }
async void bindContactUsData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); // fetching mobile from user input string txtMessage = txtDesc.Text; string postData = "userId=" + LoginDetails.userId + "&query=" + txtMessage + ""; var result = await CommonLib.ContactUs(CommonLib.ws_MainUrlMain + "ContactApi/ContactUs?" + postData); if (result != null && result.Status != 0) { if (LoginDetails.sessionId == result.SessionId) { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.Sucess; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); switch (Device.RuntimePlatform) { case Device.iOS: await Navigation.PopAsync(); break; case Device.Android: await Navigation.PopAsync(); break; } } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = Resx.AppResources.yourSession; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); await Application.Current.MainPage.Navigation.PushAsync(new Views.LogInPage()); } } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }
public async Task LeaderChartData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = "Check your internet connection."; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); string postData = "rateType=60days&RegionCode=&ProvinceCode="; var result = await CommonLib.leaderChart(CommonLib.ws_MainUrlMain + "LeaderApi/LeaderVoteFilterPersent?" + postData); if (result != null && result.Status != 0) { leaderchartName = result.chartData.ChartName; leaderColor = result.chartData.LeaderColor; leadername = result.chartData.LeaderName; leadervote = result.chartData.Votes; await CandidatureChartData(); InitializeComponent(); Title = "Grylloo"; CandituresButton.WidthRequest = (width / 2) - 10; leadersButton.WidthRequest = (width / 2) - 10; CandituresButton.BackgroundColor = Color.FromHex("#fcbf49"); leadersButton.BackgroundColor = Color.White; leaderGraph.IsVisible = false; partyGraph.IsVisible = true; var chartHeight = (height / 6) - 10; partyGraph.HeightRequest = chartHeight; var chartConfigScript1 = GetChartScript(); var html1 = GetHtmlWithChartConfig(chartConfigScript1); d.Html = html1; var chartConfigScript = GetChartScript1(); var html = GetHtmlWithChartConfig1(chartConfigScript); e.Html = html; // LoadPopup.CloseAllPopup(); } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } //iosCheck(); }
//Below for Binding legalNote text async void bindLegalNoteData() { try { if (!CommonLib.checkconnection()) { VoteAlertPopup.textmsg = Resx.AppResources.checkInternet; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); return; } await Navigation.PushPopupAsync(new LoadPopup()); var result = await CommonLib.LegalNote(CommonLib.ws_MainUrlMain + "ContactApi/LegalNote"); if (result != null && result.Status != 0) { LoadPopup.CloseAllPopup(); legalNoteText.Text = result.Note.LegalText; string ww = "<html><head></head><body><div>"; ww += result.Note.LegalText; ww += "</div></body></html>"; var jj = new HtmlWebViewSource(); jj.Html = ww; legalNoteTextWeb.Source = jj; if (Device.OS == TargetPlatform.Android) { legalNoteText.IsVisible = true; } else { legalNoteTextWeb.IsVisible = true; } } else { LoadPopup.CloseAllPopup(); VoteAlertPopup.textmsg = result.msg; await App.Current.MainPage.Navigation.PushPopupAsync(new VoteAlertPopup()); } } catch (Exception ex) { LoadPopup.CloseAllPopup(); await App.Current.MainPage.DisplayAlert("", ex.Message, "OK"); } finally { } }