public EventCreateViewModel(IMyNavigationService navigationService)
        {
            var database = new NoteDatabase();

            SaveNoteCommand = new Command(() => {
                Event.Attendees = "";
                foreach (Person p in people)
                {
                    Event.Attendees += p.NoteId + ",";
                }
                Event.Attendees = Event.Attendees.Trim(',');
                var cal         = new MyCalendar();

                if (!(Event.CalId <= 0))
                {
                    cal.removeSystemCal(Event.CalId);
                }
                //Debug.WriteLine(Event.TimeStamp);
                long newid  = cal.addToSystemCal(Event.TimeStamp, Event.titleText, Event.NoteDetail, Event.LocationText);
                Event.CalId = newid;
                //Debug.WriteLine(Event.TimeStamp);
                Event.TimeStamp = Event.TimeStamp.AddHours(10);                //stop the database messing up dates
                database.InsertOrUpdateNote(Event);
                //Debug.WriteLine(database.GetNote(id).TimeStamp);
                navigationService.GoBack();
            });
        }
Пример #2
0
        static public async void ImportCalendar()
        {
            MyCalendar cal = new MyCalendar();
            var        t   = Task.Factory.StartNew(() => cal.UpdateCal());
            await      t;

            Debug.WriteLine("done Calendar import");
        }
Пример #3
0
        //dsfds*************************************************************************************


        //Async methods
        static public async void ImportContacts()
        {
            MyCalendar cal = new MyCalendar();
            var        t   = Task.Factory.StartNew(() => cal.contactRequest());
            await      t;

            Debug.WriteLine("done Contacts import");
        }
        public EventCreateViewModel(IMyNavigationService navigationService)
        {
            var database = new NoteDatabase();
            SaveNoteCommand = new Command (() => {
                Event.Attendees = "";
                foreach(Person p in people){
                    Event.Attendees += p.NoteId + ",";
                }
                Event.Attendees = Event.Attendees.Trim(',');
                var cal = new MyCalendar ();

                if(! (Event.CalId <= 0)){
                    cal.removeSystemCal(Event.CalId);
                }
                //Debug.WriteLine(Event.TimeStamp);
                long newid = cal.addToSystemCal(Event.TimeStamp, Event.titleText, Event.NoteDetail, Event.LocationText);
                Event.CalId = newid;
                //Debug.WriteLine(Event.TimeStamp);
                Event.TimeStamp = Event.TimeStamp.AddHours(10);//stop the database messing up dates
                database.InsertOrUpdateNote(Event);
                //Debug.WriteLine(database.GetNote(id).TimeStamp);
                navigationService.GoBack();
            });
        }
Пример #5
0
        public static void SaveToken(string token)
        {
            _Token = token;
            var database = new NoteDatabase ();
            database.InsertOrUpdateToken(new Tconnect.Data.Token("Yammer",token));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("Calendar","1"));
            MyCalendar.ImportCalendar ();
            MyCalendar.ImportContacts ();

            MyCalendar cal = new MyCalendar ();
            Debug.WriteLine ("ruight herjelkfjsd tohooooooooooooo");
            String[] s = cal.getUserDeets (token);

            database.InsertOrUpdateToken(new Tconnect.Data.Token("fname",s[0]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("lname",s[1]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("email",s[2]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("phone",s[3]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("org",s[4]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("uid",s[5]));
            database.InsertOrUpdateToken(new Tconnect.Data.Token("profilepicture",s[6]));

            // { fname, lname, email, phone, org, uid, profilepicture };
            Debug.WriteLine ("oi we got here m8");
            //Person p = new Person (s [0], s [1], s [2], s [3], s [4], s [5], s [6]);
            //p.NoteId = 0;
            //database.InsertOrUpdatePerson (p);
            //Debug.WriteLine ("afftaahh:: " + database.GetPerson(0).Name);
        }
Пример #6
0
		//dsfds*************************************************************************************


		//Async methods
		static public async void ImportContacts(){
			MyCalendar cal = new MyCalendar ();
			var t = Task.Factory.StartNew(()=> cal.contactRequest ());
			await t;
			Debug.WriteLine("done Contacts import");
		}
Пример #7
0
		static public async void ImportCalendar(){
			MyCalendar cal = new MyCalendar ();
			var t = Task.Factory.StartNew(()=> cal.UpdateCal());
			await t;
			Debug.WriteLine("done Calendar import");
		}