/// <summary> /// Method Name : UpdateMoveDataAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Use for Update move data /// Revision : /// </summary> public async Task UpdateMoveDataAsync() { Move move; move = new Move(); if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); MoveDataModel dtoMoveData = DTOConsumer.dtoMoveData; dtoMoveData.StatusReason = GetMoveStatusReason(estimateModel); loadingOverlay = UIHelper.ShowLoadingScreen(View); APIResponse <MoveDataModel> aPIResponse = await move.PutMoveData(dtoMoveData, estimateModel.MoveNumber); if (aPIResponse.STATUS) { await DTOConsumer.BindMoveDataAsync(); PerformSegue("MoveConfirmedToDashBoard", this); } else { UIHelper.ShowMessage(aPIResponse.Message); } loadingOverlay.Hide(); } }
/// <summary> /// Method Name : CallGetContactMoveService /// Author : Hiren Patel /// Creation Date : 5 Jan 2018 /// Purpose : To calls get contact move services /// Revision : /// </summary> private async Task CallGetContactMoveService() { string errorMessage = string.Empty; try { if (UtilityPCL.LoginCustomerData != null) { fullName = UtilityPCL.LoginCustomerData.CustomerFullName; } LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); APIResponse <GetContactListForMoveResponse> serviceResponse = await moveServices.GetContactListForMove(); objectLoadingScreen.Hide(); if (serviceResponse.STATUS) { lblEmailId.Text = serviceResponse.DATA.internalemailaddress; lblPhoneNumber.Text = serviceResponse.DATA.address1_telephone1; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } } }
/// <summary> /// Method Name : BindMoveData /// Author : Hiren Patel /// Creation Date : 30 Dec 2017 /// Purpose : To bind Move data with UI element /// Revision : /// </summary> private async Task BindMoveData() { string errorMessage = string.Empty; try { if (this.ParentViewController != null) { parent = this.ParentViewController as JKTabController; loadingOverlay = UIHelper.ShowLoadingScreen(parent.View); } APIResponse <MoveDataModel> response = await moveService.GetMoveData(UtilityPCL.LoginCustomerData.CustomerId); loadingOverlay.Hide(); if (response.STATUS) { if (UtilityPCL.IsMoveActive(response.DATA.IsActive)) { MoveDataModel moveDataModel = response.DATA; SetMoveAddressAndValueDataToUILabel(moveDataModel); if (moveDataModel.MyServices != null) { UIHelper.BindMyServiceData(moveDataModel.MyServices, scrollviewMyServices, View); } CheckStatusReason(moveDataModel); scrollview.Hidden = false; } else { scrollview.Hidden = true; UIHelper.ShowMessage(response.Message); } } else { scrollview.Hidden = true; errorMessage = response.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { ResetDashBoardData(); UIHelper.ShowAlertMessage(this, errorMessage); } loadingOverlay.Hide(); } }
public async override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); if (!String.IsNullOrEmpty(UIHelper.GetCustomerIDFromCache()) && !String.IsNullOrWhiteSpace(UIHelper.GetCustomerIDFromCache())) { LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); await UIHelper.BindingDataAsync(); RedirectToOtherScreen(); objectLoadingScreen.Hide(); } }
/// <summary> /// Method Name : GoToDesboardAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Use for Update Estimed /// Revision : /// </summary> private async Task GoToDesboardAsync() { string retMessage = string.Empty; try { // Valuation RemoveCurrencyFormat(); ValuationDeductibleModel valuationDeductibleModel = UtilityPCL.ValuationDeductibleList().Where(a => a.DeductibleName == estimateModel.ValuationDeductible).SingleOrDefault(); if (valuationDeductibleModel != null) { estimateModel.ValuationDeductible = valuationDeductibleModel.DeductibleCode; } if (estimateModel.IsAddressEdited || estimateModel.IsServiceDate || estimateModel.IsWhatMatterMostEdited || estimateModel.IsValuationEdited) { loadingOverlay = UIHelper.ShowLoadingScreen(View); RemoveCurrencyFormat(); APIResponse <EstimateModel> aPIResponse = await estimate.PutEstimateData(estimateModel, estimateModel.MoveNumber); loadingOverlay.Hide(); if (aPIResponse.STATUS) { await UpdateMoveDataAsync(); } else { UIHelper.ShowMessage(aPIResponse.Message); } } else { await UpdateMoveDataAsync(); } } catch (Exception error) { retMessage = error.Message; } finally { if (!string.IsNullOrEmpty(retMessage)) { UIHelper.ShowMessage(retMessage); } } }
/// <summary> /// Event Name : BtnContinue_TouchUpInside /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : To call create pasword services /// Revision : /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event Arguments</param> private async void BtnContinue_TouchUpInside(object sender, EventArgs e) { string errorMessage = string.Empty; try { LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); ServiceResponse serviceResponse = await loginServices.CreatePassword(txtPassword.Text, txtVerifyPassword.Text); objectLoadingScreen.Hide(); if (serviceResponse != null) { if (string.IsNullOrEmpty(serviceResponse.Message)) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, AppConstant.CREATED_PASSWORD_MESSAGE, AppConstant.ALERT_OK_BUTTON_TEXT); if (serviceResponse.Status) { UIHelper.SetLoggedInCustomerIDInCache(); objectLoadingScreen = UIHelper.ShowLoadingScreen(View); await UIHelper.BindingDataAsync(); RedirectToOtherScreen(); objectLoadingScreen.Hide(); } else { UIHelper.RedirectToViewController(sorunceViewController: this, destinationViewControllerName: JKMEnum.UIViewControllerID.PrivacyPolicyView); } } else { errorMessage = serviceResponse.Message; } } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } } }
/// <summary> /// Method Name : callPaymentService /// Author : Hiren Patel /// Creation Date : 15 Feb 2018 /// Purpose : Calls the payment service. /// Revision : /// </summary> /// <param name="paymentGatewayModel">Payment gateway model.</param> private async Task callPaymentService(PaymentGatewayModel paymentGatewayModel) { APIResponse <PaymentTransactonModel> serviceResponse = new APIResponse <PaymentTransactonModel>() { STATUS = false }; string errorMessage = string.Empty; LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View); try { serviceResponse = await payment.ProcessPaymentTransaction(paymentGatewayModel); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { lblTransactionId.Text = serviceResponse.DATA.TransactionID; lblPaymentStatusAmountPaid.Text = UtilityPCL.CurrencyFormat(Convert.ToString(paymentGatewayModel.TransactionAmout)); await CallPostPaymentTransaction(serviceResponse.DATA, paymentGatewayModel); } } else { errorMessage = serviceResponse.Message; if (serviceResponse.DATA != null) { lblTransactionId.Text = serviceResponse.DATA.TransactionID; } } } catch (Exception error) { errorMessage = error.Message; } finally { loadingOverlay.Hide(); if (!string.IsNullOrEmpty(errorMessage)) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, errorMessage, AppConstant.ALERT_OK_BUTTON_TEXT); } } ShowPaymentStatus(serviceResponse.STATUS); }
/// <summary> /// Method Name : callPaymentService /// Author : Hiren Patel /// Creation Date : 15 Feb 2018 /// Purpose : Calls the payment service. /// Revision : /// </summary> /// <param name="paymentGatewayModel">Payment gateway model.</param> private async Task callPaymentService(PaymentGatewayModel paymentGatewayModel) { APIResponse <PaymentTransactonModel> serviceResponse = new APIResponse <PaymentTransactonModel>() { STATUS = false }; string errorMessage = string.Empty; try { LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View); serviceResponse = await payment.ProcessPaymentTransaction(paymentGatewayModel); loadingOverlay.Hide(); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { estimateModel.TransactionId = serviceResponse.DATA.TransactionID; estimateModel.PaymentStatus = true; await CallPostPaymentTransaction(serviceResponse.DATA, estimateModel); PerformSegue("depositToMoveConfirmed", this); } } else { errorMessage = serviceResponse.Message; if (serviceResponse.DATA != null) { estimateModel.TransactionId = serviceResponse.DATA.TransactionID; estimateModel.PaymentStatus = false; } } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, errorMessage, AppConstant.ALERT_TRY_AGAIN_BUTTON_TEXT); } } }
/// <summary> /// Event Name : CallPrivacyPolicyService /// Author : Hiren Patel /// Creation Date : 13 Dec 2017 /// Purpose : Calls the privacy policy service to agree or disagree privacy policy /// Revision : /// </summary> /// <summary> /// Calls the privacy policy service. /// </summary> /// <param name="IsAgree">If set to <c>true</c> is agree.</param> private async Task CallPrivacyPolicyService(bool IsAgree) { string errorMessage = string.Empty; try { ServiceResponse serviceResponse = await loginServices.PrivacyPolicyService(IsAgree); if (serviceResponse != null) { if (string.IsNullOrEmpty(serviceResponse.Message)) { if (serviceResponse.Status) { UIHelper.SetLoggedInCustomerIDInCache(); LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); await UIHelper.BindingDataAsync(); RedirectToOtherScreen(); objectLoadingScreen.Hide(); } else { UIHelper.CallingScreenContactUs = JKMEnum.UIViewControllerID.PrivacyPolicyView; UIHelper.RedirectToViewController(sorunceViewController: this, destinationViewControllerName: JKMEnum.UIViewControllerID.ContactusView); } } else { errorMessage = serviceResponse.Message; } } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } } }
/// <summary> /// Method Name : GetPaymentData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : Gets the payment data. /// Revision : /// </summary> /// <returns>The payment data.</returns> public async Task GetPaymentData() { paymentModel = new PaymentModel() { CustomerID = UtilityPCL.LoginCustomerData.CustomerId, MoveID = DTOConsumer.dtoMoveData.MoveNumber }; APIResponse <PaymentModel> serviceResponse = new APIResponse <PaymentModel>() { STATUS = false }; string errorMessage = string.Empty; try { LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View); serviceResponse = await payment.GetPaymentAmount(paymentModel); loadingOverlay.Hide(); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { paymentModel = serviceResponse.DATA; } } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowMessage(errorMessage); } } BindPaymentData(); }
/// <summary> /// Method Name : GetAlertsList /// Author : Hiren Patel /// Creation Date : 29 Dec 2017 /// Purpose : Get alert list from service /// Revision : /// </summary> public async Task GetAlertsList() { APIResponse <List <AlertModel> > serviceResponse = new APIResponse <List <AlertModel> >(); alertList = new List <AlertModel>(); serviceResponse.STATUS = false; string errorMessage = string.Empty; try { CustomerModel customerModel = new CustomerModel() { CustomerId = UtilityPCL.LoginCustomerData.CustomerId, LastLoginDate = UtilityPCL.LoginCustomerData.LastLoginDate }; LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); serviceResponse = await alertServices.GetAlertList(customerModel); objectLoadingScreen.Hide(); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { alertList = serviceResponse.DATA; } } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowMessage(errorMessage); } } }
/// <summary> /// Method Name : GetAlertsList /// Author : Hiren Patel /// Creation Date : 29 Dec 2017 /// Purpose : Get document list from service /// Revision : /// </summary> public async Task GetDocumentList() { APIResponse <List <DocumentModel> > serviceResponse = new APIResponse <List <DocumentModel> >() { STATUS = false }; documentModelList = new List <DocumentModel>(); string errorMessage = string.Empty; try { LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View); serviceResponse = await myDocumentServices.GetDocumentList(UtilityPCL.LoginCustomerData.CustomerId); loadingOverlay.Hide(); if (serviceResponse.STATUS) { if (serviceResponse.DATA != null) { documentModelList = serviceResponse.DATA; } } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowMessage(errorMessage); } } }
/// <summary> /// Method Name : CallLoginService /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : To calls login services /// Revision : /// </summary> private async Task CallLoginService() { string errorMessage = string.Empty; try { LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); ServiceResponse serviceResponse = await loginServices.GetCustomerLogin(txtEmailID.Text); objectLoadingScreen.Hide(); if (string.IsNullOrEmpty(serviceResponse.Message)) { if (serviceResponse.Status) { UIHelper.RedirectToViewController(sorunceViewController: this, destinationViewControllerName: JKMEnum.UIViewControllerID.EnterPasswordView); } else { UIHelper.RedirectToViewController(sorunceViewController: this, destinationViewControllerName: JKMEnum.UIViewControllerID.VerificationCodeView); } } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } } }
/// <summary> /// Event Name : CallMyAccountService /// Author : Hiren Patel /// Creation Date : 13 Dec 2017 /// Purpose : Calls my account service to update account data /// Revision : /// </summary> /// <param name="privacyPolicyModel">Privacy policy model.</param> private async Task CallMyAccountService(PrivacyPolicyModel privacyPolicyModel) { string errorMessage = string.Empty; LoadingOverlay objectLoadingScreen = UIHelper.ShowLoadingScreen(View); try { APIResponse <PrivacyPolicyModel> serviceResponse = await myAccountService.PutMyAccountDetails(privacyPolicyModel); if (serviceResponse.STATUS) { await UIHelper.ShowMessageWithOKConfirm(string.Empty, serviceResponse.Message, AppConstant.ALERT_OK_BUTTON_TEXT); btnOkay.Tag = 0; btnOkay.SetTitle(AppConstant.MYACCOUNT_OK_BUTTON_TEXT, UIControlState.Normal); this.TabBarController.SelectedIndex = 0; this.TabBarController.TabBar.Hidden = false; await DTOConsumer.GetCustomerProfileData(); } else { errorMessage = serviceResponse.Message; } } catch (Exception error) { errorMessage = error.Message; } finally { if (!string.IsNullOrEmpty(errorMessage)) { UIHelper.ShowAlertMessage(this, errorMessage); } objectLoadingScreen.Hide(); } }