Example #1
0
        private async void PostValue()
        {
            var val = valueField.text;

            if (string.IsNullOrEmpty(val))
            {
                UiController.Instance.ShowInfo("Field can not be empty");
                return;
            }

            var result = await NetworkProvider.PostResource(new Resource {
                Type   = type,
                UserId = UiController.Instance.currentUser,
                Value  = int.Parse(val)
            });

            if (result.IsError)
            {
                UiController.Instance.ShowInfo(result.ErrorMessage);
                return;
            }

            SetValue(result.Value.Value);
        }