/****************************************************************************************
         * For now onCreate appends to a text file the user entered fields required by Outlook
         * The fields are in a flyout which closes when "Create" is tapped
         * Will need a way to clear the text file of unnesscary meetings/mistakes
         *************************************************************************************/
        private async void onCreate(object sender, RoutedEventArgs e)
        {
            var meetings = await KnownFolders.PicturesLibrary.GetFileAsync("appdatacreation.txt");

            var entMet = new List <string>
            {
                Cstrt.Text,
                Cend.Text,
                Cloc.Text,
                Cbdy.Text,
                "---ENDBODY---",
                "False",
                Csub.Text
            };
            await Windows.Storage.FileIO.AppendLinesAsync(meetings, entMet);

            var newMeeting = new DataAccess.Entities.Meeting
            {
                StartTime = DateTime.Parse(Cstrt.Text),
                EndTime   = DateTime.Parse(Cend.Text),
                Location  = Cloc.Text,
                Body      = Cbdy.Text,
                AllDay    = false,
                Subject   = Csub.Text
            };
            await _meetingRepo.SaveAsync(newMeeting);

            await FetchMeetings();

            MeetingsAdd.Hide();
        }
예제 #2
0
        /********************************************************************
         * Note field is the meeting unique ID + ".txt"
         * Should display all artifacts from salesbag
         *********************************************************************/
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            launchmeet      = (DataAccess.Entities.Meeting)e.Parameter;
            launchmeet.Note = launchmeet.ID.ToString() + ".txt";
            try
            {
                DataAccess.Entities.SalesBag salesbagChosen = await _salesbagRepo.Get(launchmeet.SalesBag);

                List <DataAccess.Entities.Artifact> sa = await _asalesbagRepo.GetAllSalesBagArtifacts(salesbagChosen);

                ArtView.ItemsSource = sa;
            }
            catch (NullReferenceException) { }
        }
        /****************************************************************************************************
        * Called by Import Meetings Button flyout button: Import
        * User chooses among all imported meetings
        * Selected meetings are saved in "Meeting" database
        ****************************************************************************************************/
        private async void ImportSelected(object sender, RoutedEventArgs e)
        {
            foreach (Meetin selectedMeetin in ComboBox1.SelectedItems)
            {
                var newMeeting = new DataAccess.Entities.Meeting
                {
                    StartTime = DateTime.Parse(selectedMeetin.Strt),
                    EndTime   = DateTime.Parse(selectedMeetin.End),
                    Location  = selectedMeetin.Loc,
                    Body      = selectedMeetin.Bdy,
                    AllDay    = Convert.ToBoolean(selectedMeetin.Ldy),
                    Subject   = selectedMeetin.Sub
                };

                //var meetingRepo = new DataAccess.Repository.MeetingRepository();
                await _meetingRepo.SaveAsync(newMeeting);
            }
            await FetchMeetings();

            SelectedMeetings.Hide();
        }