コード例 #1
0
        /// <summary>
        /// Method Name     : GetAlertsList
        /// Author          : Hiren Patel
        /// Creation Date   : 29 Dec 2017
        /// Purpose         : Get alert list from service
        /// Revision        :
        /// </summary>
        public async Task GetEstimateList()
        {
            APIResponse <List <EstimateModel> > serviceResponse = new APIResponse <List <EstimateModel> >();

            estimateModelList      = new List <EstimateModel>();
            serviceResponse.STATUS = false;
            string errorMessage = string.Empty;

            try
            {
                LoadingOverlay loadingOverlay = UIHelper.ShowLoadingScreen(View);
                serviceResponse = await estimateServices.GetEstimateData(UtilityPCL.LoginCustomerData.CustomerId);

                loadingOverlay.Hide();
                if (serviceResponse.STATUS)
                {
                    if (serviceResponse.DATA != null)
                    {
                        estimateModelList = serviceResponse.DATA;
                    }
                }
                else
                {
                    errorMessage = serviceResponse.Message;
                }
            }
            catch (Exception error)
            {
                errorMessage = error.Message;
            }
            finally
            {
                if (!string.IsNullOrEmpty(errorMessage))
                {
                    UIHelper.ShowMessage(errorMessage);
                }
            }
        }
コード例 #2
0
ファイル: DTOConsumer.cs プロジェクト: nikz2493/jkmobile
        /// <summary>
        /// Method Name     : GetEstimateList
        /// Author          : Sanket Prajapati
        /// Creation Date   : 22 jan 2018
        /// Purpose         : Binding Estimted data list
        /// Revision        :
        /// </summary>
        public static async Task GetEstimateList()
        {
            string retMessage = string.Empty;

            dtoEstimateData = null;
            try
            {
                Estimate estimateService = new Estimate();
                APIResponse <List <EstimateModel> > response = await estimateService.GetEstimateData(UtilityPCL.LoginCustomerData.CustomerId);

                if (response is null)
                {
                    retMessage = Resource.msgDashboardNotLoad;
                }
                else
                {
                    EstimateResponse(retMessage, response);
                }
            }
            catch (Exception ex)
            {
                retMessage      = ex.Message;
                dtoEstimateData = null;
            }
            finally
            {
                if (!string.IsNullOrEmpty(retMessage))
                {
                    dtoEstimateData = new List <EstimateModel>();
                    dtoEstimateData.Add(new EstimateModel()
                    {
                        Response_status = false, message = retMessage
                    });
                }
            }
        }