public async void UpdateProfile() { string aa = LoginDetails.userId; if (aa != null) { try { string postData = "Id=" + LoginDetails.userId; var result = await CommonLib.UpdateAccountDetails(CommonLib.ws_MainUrlMain + "UserApi/UserAccount?" + postData); if (result.Status == 1) { Model.loggedInUser objUser = new Model.loggedInUser(); objUser.userId = Convert.ToString(result.profile.Id); objUser.mobile = result.profile.Phone; objUser.sessionId = LoginDetails.sessionId; objUser.userType = result.profile.TypeOfUser; objUser.lifeLine = result.profile.Lifeline; App.Database.UpdateLoggedUser(objUser); Model.LoginDetails.userType = result.profile.TypeOfUser; Model.LoginDetails.lifeLine = result.profile.Lifeline; } } catch (Exception ex) { } } }
public void PremimumUser1() { if (checkPremimun == true) { IosUserType(); ButtonLayout.IsVisible = false; PremimumLbl.Text = Resx.AppResources.alreadypremimum; expDateLbl.Text = exp; Model.LoginDetails.userType = 2; Model.loggedInUser objUser = new Model.loggedInUser(); objUser.userId = Model.LoginDetails.userId; objUser.mobile = Model.LoginDetails.mobile; objUser.sessionId = Model.LoginDetails.sessionId; objUser.userType = 2; objUser.lifeLine = Model.LoginDetails.lifeLine; App.Database.UpdateLoggedUser(objUser); } }
// private void Popup_Disappearing(object sender, EventArgs e) { if (checkPremimun == true) { ButtonLayout.IsVisible = false; PremimumLbl.Text = Resx.AppResources.alreadypremimum; expDateLbl.Text = exp; // Model.LoginDetails.userType = 2; Model.loggedInUser objUser = new Model.loggedInUser(); objUser.userId = Model.LoginDetails.userId; objUser.mobile = Model.LoginDetails.mobile; objUser.sessionId = Model.LoginDetails.sessionId; objUser.userType = 2; objUser.lifeLine = Model.LoginDetails.lifeLine; App.Database.UpdateLoggedUser(objUser); IosUserType(); } }
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 { } }