Esempio n. 1
0
        public LoginPageViewModel(EasyMobileServiceClient client) : base(client)
        {
            IMobileServiceTable <Student> studentTable = client.MobileService.GetTable <Student>();


            NavigationCommand = new Command(async() =>
            {
                List <Student> items = await studentTable
                                       .Where(x => x.userId == user && x.password == pass)
                                       .ToListAsync();



                //var s = await studentTable.GetItemsAsync();

                if (items.Count > 0)
                {
                    Settings.Default.currentUser = items.FirstOrDefault();
                    await Navigation.PushModalAsync(new Views.MainPage(client));
                }
            });



            Title = "Login";
        }
Esempio n. 2
0
        public HomePageViewModel(EasyMobileServiceClient client) : base(client)
        {
            user        = Settings.Default.currentUser;
            this.client = client;


            init().ConfigureAwait(false);
        }
Esempio n. 3
0
        public LoginPage(EasyMobileServiceClient client)
        {
            InitializeComponent();
            var vm = new ViewModels.LoginPageViewModel(client);

            vm.Navigation       = this.Navigation;
            this.BindingContext = vm;
        }
Esempio n. 4
0
        public HomePageViewModel(EasyMobileServiceClient client) : base(client)
        {
            user        = Settings.Default.currentUser;
            this.client = client;

            Students = Settings.Default.Students;
            Groups   = Settings.Default.Groups;
            Requests = Settings.Default.Requests;
        }
Esempio n. 5
0
        static App()
        {
            //Create our App Service Easy Client
            Client = new EasyMobileServiceClient();
            Client.Initialize(Keys.AzureServiceUrl);

            //Register our objects
            Client.RegisterTable <Headline>();
            Client.FinalizeSchema();
        }
Esempio n. 6
0
        public AzureDataService(string azureMobileAppURL)
        {
            // Create Client
            var mobileService = EasyMobileServiceClient.Create();

            mobileService.Initialize(azureMobileAppURL);

            // Register the data model to create the table with
            mobileService.RegisterTable <Cache>();
            mobileService.FinalizeSchema();
            cacheTable = mobileService.Table <Cache>();
        }
Esempio n. 7
0
        public App()
        {
            AzureClient = EasyMobileServiceClient.Create();
            AzureClient.Initialize("https://montemagnospeakers.azurewebsites.net");
            AzureClient.RegisterTable <Model.Speaker>();
            AzureClient.FinalizeSchema();

            // The root page of your application
            var content = new SpeakersPage();

            MainPage = new NavigationPage(content);
        }
Esempio n. 8
0
        public CoffeesViewModel()
        {
            // 1. Create a new EasyMobileServiceClient.
            var client = EasyMobileServiceClient.Create();

            // 2. Initialize the library with the URL of the Azure Mobile App you created in Step #1.

            client.Initialize("https://motzcoffee.azurewebsites.net");

            // 3. Register a model with the EasyMobileServiceClient to create a table.
            client.RegisterTable <Coffee>();

            // 4. Finalize the schema for our database. All table registrations must be done before this step.
            client.FinalizeSchema();

            table = client.Table <Coffee>();
        }
Esempio n. 9
0
        public SearchPageViewModel(EasyMobileServiceClient client) : base(client)
        {
            user        = Settings.Default.currentUser;
            this.client = client;

            LatestGroups = new ObservableCollection <Group> {
                new Group {
                    Name = "Xamarin", image = "https://lh4.googleusercontent.com/--6HuPTRFJ7w/AAAAAAAAAAI/AAAAAAAAAJ4/SUatxvJy0uQ/photo.jpg"
                },
                new Group {
                    Name = "C#", image = "https://cdn.codementor.io/assets/tutors/c-sharp-tutors-online.png"
                },
                new Group {
                    Name = "Java", image = "https://pbs.twimg.com/profile_images/426420605945004032/K85ZWV2F_400x400.png"
                },
                new Group {
                    Name = "Sports", image = "http://proprofs.com/quiz-school/topic_images/p18lq7ediepl816p6s04171vo23.jpg"
                }
            };
        }
Esempio n. 10
0
        public App()
        {
            InitializeComponent();

            // 1. Create a new EasyMobileServiceClient.
            AzureClient = EasyMobileServiceClient.Create();

            // 2. Initialize the library with the URL of the Azure Mobile App you created in Step #1.
            // Example: https://appservicehelpers.azurewebsites.net
            AzureClient.Initialize("https://ucl-1.azurewebsites.net");

            // 3. Register a model with the EasyMobileServiceClient to create a table.
            AzureClient.RegisterTable <Model.Lecture>();

            // 4. Finalize the schema for our database. All table registrations must be done before this step.
            AzureClient.FinalizeSchema();

            var content = new LecturesPage();

            MainPage = new NavigationPage(content);
        }
Esempio n. 11
0
        protected override void Load(ContainerBuilder builder)
        {
            // Register bot connector
            //builder.RegisterType<BotConnectorDirectLineAPIV30>()
            //    .As<IBotConnectorDirectLineAPIV30>()
            //    .WithParameter(
            //        "credentials",
            //        new TokenCredentials(""));

            // Register mobile service client
            var mobileServiceClient = (EasyMobileServiceClient)EasyMobileServiceClient.Create();

            mobileServiceClient.Initialize(Constants.ApplicationURL);
            RegisterSchemaTables(mobileServiceClient);
            mobileServiceClient.FinalizeSchema();
            builder.RegisterInstance(mobileServiceClient).As <IEasyMobileServiceClient>();
            builder.RegisterInstance(mobileServiceClient.MobileService).As <IMobileServiceClient>();

            // Register core services
            builder.RegisterType <TodoItemManager>().As <ITodoItemManager>();//.SingleInstance();

            // Register view models
            builder.RegisterType <TodoListViewModel>().AsSelf();
        }
Esempio n. 12
0
 private void RegisterSchemaTables(EasyMobileServiceClient mobileServiceClient)
 {
     mobileServiceClient.RegisterTable <TodoItem, TodoItemDataTable>();
 }
Esempio n. 13
0
 public MainPageViewModel(EasyMobileServiceClient client)
 {
     homePageVM    = new HomePageViewModel(client);
     profilePageVM = new ProfilePageViewModel(client);
 }
Esempio n. 14
0
 public ProfilePageViewModel(EasyMobileServiceClient client) : base(client)
 {
     user        = Settings.Default.currentUser;
     this.client = client;
 }
Esempio n. 15
0
 public MainPage(EasyMobileServiceClient client)
 {
     InitializeComponent();
     this.BindingContext = new ViewModels.MainPageViewModel(client);
 }
Esempio n. 16
0
        public App()
        {
            Settings.Default.Groups = new ObservableCollection <Group> {
                new Group {
                    Name = "Xamarin", image = "https://lh4.googleusercontent.com/--6HuPTRFJ7w/AAAAAAAAAAI/AAAAAAAAAJ4/SUatxvJy0uQ/photo.jpg"
                },
                new Group {
                    Name = "C#", image = "https://cdn.codementor.io/assets/tutors/c-sharp-tutors-online.png"
                },
                new Group {
                    Name = "Java", image = "https://pbs.twimg.com/profile_images/426420605945004032/K85ZWV2F_400x400.png"
                },
                new Group {
                    Name = "Sports", image = "http://proprofs.com/quiz-school/topic_images/p18lq7ediepl816p6s04171vo23.jpg"
                }
            };

            Settings.Default.Students = new ObservableCollection <Student> {
                new Student {
                    userId = "miladroy", firstName = "Milad", lastName = "roigari", studyLevel = 4, image = "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/5/005/00b/134/26103bf.jpg"
                },
                new Student {
                    userId = "Ramya", firstName = "Ramya", lastName = "", studyLevel = 4, image = ""
                },
                new Student {
                    userId = "Visa", firstName = "Visa", lastName = "", studyLevel = 4, image = ""
                }
            };

            Settings.Default.Interests = new ObservableCollection <Interest> {
                new Interest {
                    Name = "Programming"
                },
                new Interest {
                    Name = "Psychology"
                },
                new Interest {
                    Name = "Management"
                },
                new Interest {
                    Name = "Business"
                }
            };


            Settings.Default.Requests = new ObservableCollection <Request> {
                new Request {
                    student1 = "Ramya", student2 = "Milad", type = ""
                },
                new Request {
                    student1 = "Ramya", student2 = "Milad", type = ""
                },
                new Request {
                    student1 = "Visa", student2 = "Milad", type = ""
                },
                new Request {
                    student1 = "Visa", student2 = "Milad", type = ""
                }
            };


            InitializeComponent();


            client = new EasyMobileServiceClient();
            client.Initialize("http://studybuddy.azurewebsites.net");
            client.RegisterTable <Student>();
            client.RegisterTable <Course>();
            client.RegisterTable <Interest>();
            client.RegisterTable <Group>();
            client.RegisterTable <Request>();
            client.RegisterTable <GroupStudents>();
            client.RegisterTable <InterestStudents>();
            client.FinalizeSchema();


            MainPage = new MainPage(client);            //LoginPage(client);
        }