Esempio n. 1
0
        private async void SaveClicked(object sender, EventArgs e)
        {
            var subItems     = ((ListView)SubItemsListView).ItemsSource;
            var registration = new RegistrationModel {
                MenuItemId = _parentMenuItem.Id
            };

            foreach (var item in subItems)
            {
                SubItemEntityModel subItemEntity = (SubItemEntityModel)item;
                var fieldItemViewModel           = new MainPageDetailViewModel(subItemEntity);

                var registrationValue = new RegistrationValueModel();
                registrationValue.SubItemId   = subItemEntity.Id;
                registrationValue.Value       = subItemEntity.FieldValue;
                registrationValue.SubItemName = subItemEntity.Name;

                registration.RegistrationValues.Add(registrationValue);
            }
            //await new RegistrationDataStore().AddItemAsync(registration);

            var queue = new QueueEntity
            {
                Url  = "test",
                Body = "test",
                Date = DateTime.Now
            };
        }
Esempio n. 2
0
        private RegistrationModel SaveRegistrationsOffline()
        {
            var subItemsOffline     = ((ListView)SubItemsListView).ItemsSource;
            var registrationOffline = new RegistrationModel {
                MenuItemId = _parentMenuItem.Id, RegistrationValues = new List <RegistrationValueModel>()
            };

            foreach (var item in subItemsOffline)
            {
                SubItemEntityModel subItemEntity = (SubItemEntityModel)item;
                var mainPageDetailViewModel      = new MainPageDetailViewModelOffline(subItemEntity);


                var registrationValue = new RegistrationValueModel();
                registrationValue.SubItemId   = subItemEntity.Id;
                registrationValue.Value       = subItemEntity.FieldValue;
                registrationValue.SubItemName = subItemEntity.Name;
                registrationOffline.RegistrationValues.Add(registrationValue);
            }
            App.LocalDatabase.SaveRegistrationItem(registrationOffline);
            return(registrationOffline);
        }