コード例 #1
0
        async void GetEntityCodeList()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                try
                {
                    var res = await WebServiceMethods.GetEntityCode(Convert.ToInt32(IosUtils.Settings.UserId), IosUtils.Settings.UserCompCode);

                    if (res != null)
                    {
                        InvokeOnMainThread(() =>
                        {
                            entitylst = res;
                            if (isEdit)
                            {
                                EntityCode           = entitylst.Where(x => x.CompCode.Equals(entityCode)).FirstOrDefault();
                                entityModel          = new EntityPickerModel(entitylst, IBEntityTxt, EntityCode);
                                IBEntityTxt.Text     = EntityCode.CompName;
                                IBEntityPicker.Model = entityModel;
                            }
                            else
                            {
                                entityModel          = new EntityPickerModel(entitylst, IBEntityTxt, entitylst[0]);
                                EntityCode           = entitylst[0];
                                IBEntityTxt.Text     = entitylst[0].CompName;
                                IBEntityPicker.Model = entityModel;
                            }
                        });
                        GetAccountCodeList();
                    }
                    else
                    {
                        IosUtils.IosUtility.hideProgressHud();
                        IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                              IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSUnknownError", "LSErrorTitle"));
                    }
                }
                catch (Exception e)
                {
                    IosUtils.IosUtility.hideProgressHud();
                    IosUtils.IosUtility.showAlertWithInfo(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSErrorTitle", "LSErrorTitle"),
                                                          e.Message);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Init values for Current Entity spinner
        /// </summary>
        private async void InitEntitySpinnerValues()
        {
            try
            {
                List <EntityCodesResponse> responseList = null;
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity,
                                                        mActivity.Resources.GetString(Resource.String.loading));

                    responseList = await WebServiceMethods.GetEntityCode(Convert.ToInt32(objLoginResponse.UserId), objLoginResponse.UserCompCode);

                    CustomProgressDialog.HideProgressDialog();
                }


                _entitySpinnerItemModelList = new List <SpinnerItemModel>();

                for (int i = 0; i < responseList.Count; i++)
                {
                    SpinnerItemModel item = new SpinnerItemModel
                    {
                        Id         = (i + 1) + "",
                        TEXT       = responseList[i].CompName,
                        EXTRA_TEXT = responseList[i].CompCode,
                        STATE      = false
                    };
                    if (entityCode != null && entityCode.Equals(responseList[i].CompCode + ""))
                    {
                        _selectedCurrentEntitysItemPosition = i;
                    }

                    _entitySpinnerItemModelList.Add(item);
                }
                SetEntitySpinnerAdapter();
            }
            catch (Exception e)
            {
                CustomProgressDialog.HideProgressDialog();
            }
        }