Beispiel #1
0
        private void _GetWebData()
        {
            QNHDemo.WP.ijMobile.JMobileSoapClient client = new QNHDemo.WP.ijMobile.JMobileSoapClient("IJMobileSoap", "https://ijmobile.bjzlimburg.nl/ONTW/ijmobile.asmx");

            client.GeefCaseLoadCompleted += client_GeefCaseLoadCompleted;

            client.GeefCaseLoadAsync(token);
        }
Beispiel #2
0
        public static List<QNHDemo.Data.Entities.Jeugdige> GetCaseLoad(string token)
        {
            var result = new List<QNHDemo.Data.Entities.Jeugdige>();
            QNHDemo.WP.ijMobile.JMobileSoapClient client = new QNHDemo.WP.ijMobile.JMobileSoapClient("IJMobileSoap", "https://ijmobile.bjzlimburg.nl/ONTW/ijmobile.asmx");

            Exception error = null;
            QNHDemo.WP.ijMobile.CaseloadResult webResult = null;

            client.GeefCaseLoadCompleted += (sender, e) =>
            {
                error = e.Error;
                webResult = e.Result;
            };

            client.GeefCaseLoadAsync(token);

            //wait till the result has been fetched
            //do
            //{
            //    Thread.Sleep(500);
            //} while (webResult == null);

            //convert to app list
            foreach (var item in webResult.Jeugdigen)
            {
                result.Add(new Data.Entities.Jeugdige
                {
                    Id = item.Id,
                    Name = item.Naam
                });
            }

            //save the xml
            System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings.Add("jeugdige", QNHDemo.Data.DAL.Dal.SerializeObject<List<QNHDemo.Data.Entities.Jeugdige>>(result));

            return result;
        }
        /// <summary>
        /// login method
        /// </summary>
        /// <param name="username">the username</param>
        /// <param name="password">the password</param>
        /// <created>Timo</created>
        private void _Login(string username, string password)
        {
            QNHDemo.WP.ijMobile.JMobileSoapClient client = new QNHDemo.WP.ijMobile.JMobileSoapClient("IJMobileSoap", "https://ijmobile.bjzlimburg.nl/ONTW/ijmobile.asmx");

            client.LoginCompleted += client_LoginCompleted;

            client.LoginAsync(username, password, null);

            lblError.Text = "Trying to log in...";
        }