public FlightCrewVoyageRecord(object viewObject, string modelname)
        {
            try
            {
                InitializeComponent();
                _flightcrew = (FlightCrewVoyageRecordModel)viewObject;
                _flightcrew.ScheduledDeparture = DateTime.Now;
                this.BindingContext            = _flightcrew;

                BindFlightNumbers();
                BindAricraftRegs();

                ReportRaisedByEntry.DataSource = App.peoplePickerDataSource;
                if (!string.IsNullOrEmpty(_flightcrew.ReportRaisedBy))
                {
                    var selectedItem = App.peoplePickerDataSource.Find(x => { return(Convert.ToString(x.Id) == _flightcrew.ReportRaisedBy); });
                    if (selectedItem != null)
                    {
                        ReportRaisedByEntry.Text         = selectedItem.Name;
                        ReportRaisedByEntry.SelectedItem = selectedItem;
                    }
                }

                _attachementView = new AttachmentView();
                stkAttachment.Children.Add(_attachementView);
            }
            catch (Exception ex)
            {
            }
        }
 private async void Button_Clicked_1(object sender, EventArgs e)
 {
     var fcvoyage = new Models.FlightCrewVoyageRecordModel();
     //fcvoyage.SectorNumber = null;
     //fcvoyage.AircraftRegistration = null;
     //fcvoyage.ManualorAuto = null;
     //fcvoyage.ReportCategories = null;
     //fcvoyage.ReplyRequired = null;
     //fcvoyage.Rank = null;
     await Navigation.PushAsync(new FlightCrewVoyageRecord(fcvoyage, "fcVoyage"));
 }
        private void savedrafts_btn_Clicked(object sender, EventArgs e)
        {
            _flightcrew.ReportType  = string.IsNullOrEmpty(_flightcrew.ReportType) ? "Flight Crew" + _flightcrew.Id.ToString() : _flightcrew.ReportType;
            _flightcrew.DateOfEvent = DateTime.Now;
            if (!ValidatePeoplePickers())
            {
                return;
            }
            _flightcrew.Created     = DateTime.Now;
            _flightcrew.Attachments = _attachementView.GetAttachmentInfoAsString();

            _flightcrew = App.DAUtil.SaveOrUpdate(_flightcrew);
            DependencyService.Get <IMessage>().ShortAlert("Item drafted");
        }