Exemplo n.º 1
0
        private void Service_GetAllDocumentTypesCompleted(object sender, WS.GetAllDocumentTypesCompletedEventArgs e)
        {
            idsDocumentTypes    = new List <int>();
            titlesDocumentTypes = new List <string>();
            codesDocumentTypes  = new List <string>();
            position            = -1;

            foreach (var item in e.Result)
            {
                idsDocumentTypes.Add(item.Id);
                titlesDocumentTypes.Add(item.Title);
                codesDocumentTypes.Add(item.Code);
            }

            listViewDocumentTypes.Adapter    = new ArrayAdapter(context: this, resource: Android.Resource.Layout.SimpleListItemSingleChoice, objects: titlesDocumentTypes);
            listViewDocumentTypes.ChoiceMode = ChoiceMode.Single;
        }
Exemplo n.º 2
0
        private void Service_GetAllDocumentTypesCompleted(object sender, WS.GetAllDocumentTypesCompletedEventArgs e)
        {
            idsDocumentTypes    = new List <int>();
            titlesDocumentTypes = new List <string>();
            codesDocumentTypes  = new List <string>();
            position            = -1;

            if (e == null)
            {
                textViewMessage.Text = ResourceMessages.ArgumentsNull;
                return;
            }

            if (e.Error != null)
            {
                textViewMessage.Text = e.Error.Message;
                return;
            }

            if (e.Cancelled)
            {
                textViewMessage.Text = ResourceMessages.RequestCancelled;
                return;
            }

            if (e.Result == null)
            {
                textViewMessage.Text = ResourceMessages.ItemDoesntExist;
                return;
            }

            foreach (var item in e.Result)
            {
                idsDocumentTypes.Add(item.Id);
                titlesDocumentTypes.Add(item.Title);
                codesDocumentTypes.Add(item.Code);
            }

            listViewDocumentTypes.Adapter    = new ArrayAdapter(context: this, resource: Layout.SimpleListItemSingleChoice, objects: titlesDocumentTypes);
            listViewDocumentTypes.ChoiceMode = ChoiceMode.Single;
        }