Exemplo n.º 1
0
        /// <summary>
        /// Method Name     : SetAdapterAsync
        /// Author          : Sanket Prajapati
        /// Creation Date   : 9 jan 2018
        /// Purpose         : Bind Data alert data
        /// Revision        :
        /// </summary>
        private async void SetAdapterAsync()
        {
            myDocument = new MyDocument();
            string errorMessage = string.Empty;

            try
            {
                progressDialog = UIHelper.SetProgressDailoge(Activity);
                APIResponse <List <DocumentModel> > serviceResponse;
                serviceResponse = await myDocument.GetDocumentList(UtilityPCL.LoginCustomerData.CustomerId);

                if (serviceResponse.STATUS)
                {
                    SetMyDocumentDataBinding(serviceResponse);
                }
                else
                {
                    errorMessage = serviceResponse.Message;
                }
            }
            catch (Exception error)
            {
                errorMessage = error.Message;
            }
            finally
            {
                progressDialog.Dismiss();
                if (!string.IsNullOrEmpty(errorMessage))
                {
                    AlertMessage(errorMessage);
                }
            }
        }
Exemplo n.º 2
0
        /// <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);
                }
            }
        }