コード例 #1
0
        private async void GetCrmNotesList()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.ShowNotes(_selectedCurrentEntitysItem.EXTRA_TEXT,
                                                                     _selectedAccountCodeItem.SECOND_EXTRA_TEXT, txt_from_date.Text, txt_to_date.Text);

                    InitailizeNotesListAdapter(responseList);

                    CustomProgressDialog.HideProgressDialog();
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                               Resources.GetString(Resource.String.alert_message_no_network_connection),
                                                               Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
                }
            }
            catch (Exception ex)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                           Resources.GetString(Resource.String.alert_message_error),
                                                           Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
            }
        }
コード例 #2
0
        async void GetNotes()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    var res = await WebServiceMethods.ShowNotes(EntityCode.CompCode, AccountCode.AccountCode, IBFromDateTxt.Text, IBToDateTxt.Text);

                    InvokeOnMainThread(() =>
                    {
                        if (res != null)
                        {
                            notes = res;
                            if (notes.Count == 0)
                            {
                                IBEmptyLbl.Hidden = false;
                            }
                            else
                            {
                                IBEmptyLbl.Hidden = true;
                            }
                        }
                        else
                        {
                            IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                                  IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                        }
                        IBNotesTbl.ReloadData();
                    });
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"), e.Message);
                }
                IosUtils.IosUtility.hideProgressHud();
            }
        }