コード例 #1
0
        private async void ProcessSaveComplaintCommand()
        {
            // validate we have all fields filled in
            if (string.IsNullOrEmpty(CurrentComplaint.ComplaintText) ||
                string.IsNullOrEmpty(CurrentComplaint.Subject) ||
                string.IsNullOrEmpty(CurrentComplaint.DOB) ||
                string.IsNullOrEmpty(CurrentComplaint.NIN))
            {
                await _dialog.DisplayAlertAsync("Missing Info", "Please Fill all field Data and set valid date of birth before submit", "OK");

                return;
            }

            CurrentComplaint.CreatedOn = UtilHelper.GetStringFormatFromDate(DateTime.Now);
            CurrentComplaint.Category  = _currentCategory.Value;
            CurrentComplaint.Status    = "Created";

            ApiServiceIndividual api = new ApiServiceIndividual();
            await api.AddNewComplaint(CurrentComplaint);

            // push back with update
            NavigationParameters navP = new NavigationParameters();

            navP.Add("UPDATE", "UPDATE");
            await _nav.GoBackAsync(navP);
        }
コード例 #2
0
        void LoadContentViews()
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                // load data first
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                MatchedJobsSource            = await apiServ.GetMatchedJobsAsync();

                MatchedJobsContent = new MatchedJobsContent();
                SetMatchedJobs();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                AppliedJobsSource            = await apiServ.GetAppliedJobsAsync();
                AppliedJobsContent           = new AppliedJobsContent();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                WatchListJobsSource          = await apiServ.GetWatchedJobsAsync();
                WatchListContent             = new WatchListContent();

                // bind data here
            });
        }
コード例 #3
0
        public async void OnNavigatedTo(NavigationParameters parameters)
        {
            // check for UpdateEvent with event id to update in calendar
            var data = parameters.Where(x => x.Key == "UpdateEvent").FirstOrDefault();

            if (data.Value != null)
            {
                var eventid = data.Value.ToString();

                var currentevent = EventsCollection.Where(x => x.Notes == eventid).FirstOrDefault();
                if (currentevent == null)
                {
                    return;
                }

                ApiServiceIndividual api = new ApiServiceIndividual();
                var singleEvent          = await api.GetEventSingleAsync(eventid);

                if (singleEvent == null)
                {
                    return;
                }

                currentevent.Subject = singleEvent.TitleInfo;
            }
        }
コード例 #4
0
        void LoadContentViews()
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                // load data first
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                AnnouncementsSource          = await apiServ.GetAnnouncementsAsync();

                // setup banners here
                // need to pull from db
                SwipeSource = new List <SfRotatorItem>()
                {
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 1 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 2 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 3 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    },
                    new SfRotatorItem()
                    {
                        ItemContent = new Label {
                            Text = "tab image 4 will be here", TextColor = Color.Black
                        }, BackgroundColor = Color.Transparent
                    }
                };



                AnnouncementContent = new HomePageContent();
                SetAnnouncements();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                AppliedJobsSource            = await apiServ.GetAppliedJobsAsync();
                AppliedJobsContent           = new AppliedJobsContent();
            });

            Task.Run(async() =>
            {
                ApiServiceIndividual apiServ = new ApiServiceIndividual();
                MyProgramsSource             = await apiServ.GetMyProgramsAsync(); // add employer id if logged on
                MyProgramsContent            = new MyProgramsContent();

                // bind data here
            });
        }
コード例 #5
0
        async void LoadEventData()
        {
            ApiServiceIndividual api = new ApiServiceIndividual();
            var eventsCollection     = await api.GetEventsAsync();

            foreach (var item in eventsCollection)
            {
                AddToSchedule(item);
            }
        }
コード例 #6
0
        private async void GetDropdownValues()
        {
            // pull from db then pre-populate
            ApiServiceIndividual api = new ApiServiceIndividual();

            _MainList = await api.GetDefaultValuesAsync("Complaints");

            // set root list here
            Cat1List = UtilHelper.ConvertToObservable <AppValues>(_MainList.Where(x => x.ParentKey == "0").ToList());
        }
コード例 #7
0
        private async void AcceptRejectEvent(bool val)
        {
            ApiServiceIndividual api = new ApiServiceIndividual();
            await api.SetEventStatus(EventData.EventId, val);

            // go back to last page.. with details :)
            NavigationParameters navP = new NavigationParameters();

            navP.Add("UpdateEvent", EventData.EventId);
            await _nav.GoBackAsync(navP);
        }
コード例 #8
0
        async void ProcessRemoveJobWatched(EmployerJobDetail vals)
        {
            if (vals != null)
            {
                ApiServiceIndividual api = new ApiServiceIndividual();
                await api.DeleteWatchListJobasync(vals.JobPostId);

                WatchListJobsSource.Remove(vals);

                await _dialog.DisplayAlertAsync("WatchList", "Removed from watchlist", "Ok");
            }
        }
コード例 #9
0
        public void OnNavigatedTo(NavigationParameters parameters)
        {
            IsAddWatchlistVisible    = false;
            IsApplyJobVisible        = false;
            IsRemoveWatchlistVisible = false;

            // setup job here :)
            var data = parameters.Where(x => x.Key == "DETAILS").FirstOrDefault();

            if (data.Value != null)
            {
                // set object up here
                JobDetails = data.Value as EmployerJobDetail;

                RaisePropertyChanged("JobLanguages");
                RaisePropertyChanged("JobTraining");
                RaisePropertyChanged("JobLicenses");


                // pull the mode here so we can add a 'add to watch list or not' and also an 'apply for job'
                var mode = parameters.Where(x => x.Key == "MODE").FirstOrDefault();
                if (mode.Value != null && !string.IsNullOrEmpty(mode.Value.ToString()))
                {
                    // show buttons or not here // default is no show
                    var modeVal = mode.Value.ToString();
                    // modes -> VIEWONLY, VIEWMATCHED, VIEWWATCHED
                    // validate mode here


                    // viewonly -> do nothing
                    // viewmatched -> allow to add to watch list or apply for job
                    // viewwatched -> allow to remove from watch list

                    switch (modeVal)
                    {
                    case "VIEWONLY":
                        break;

                    default:

                        // show remove from watched button
                        ApiServiceIndividual api = new ApiServiceIndividual();

                        var jb = api.GetJobInfo(JobDetails.JobPostId);

                        IsAddWatchlistVisible    = !jb.IsWatched;
                        IsApplyJobVisible        = !jb.IsAppliedForJob;
                        IsRemoveWatchlistVisible = jb.IsWatched;
                        break;
                    }
                }
            }
        }
コード例 #10
0
        private async void ProcessAddWatchlistCommand()
        {
            // add a new watch list item
            ApiServiceIndividual api = new ApiServiceIndividual();
            await api.AddWatchListJobasync(JobDetails.JobPostId);

            await _dialog.DisplayAlertAsync("Watch Info", "Added to watch List", "OK");

            NavigationParameters navP = new NavigationParameters();

            navP.Add("JOBWATCHADD", JobDetails.JobPostId);
            await _nav.GoBackAsync(navP);
        }
コード例 #11
0
        private async void ProcessRemoveWatchlistCommand()
        {
            // remove based on job id
            ApiServiceIndividual api = new ApiServiceIndividual();
            await api.DeleteWatchListJobasync(JobDetails.JobPostId);

            await _dialog.DisplayAlertAsync("Watch Info", "Removed From watch List", "OK");

            // just return here and update watch list??
            NavigationParameters navP = new NavigationParameters();

            navP.Add("JOBWATCHREMOVE", JobDetails.JobPostId);
            await _nav.GoBackAsync(navP);
        }
コード例 #12
0
        private async void ShowAppointment(ScheduleAppointment appointment)
        {
            ApiServiceIndividual api = new ApiServiceIndividual();
            var ev = await api.GetEventSingleAsync(appointment.Notes);

            // now process the event as parameter
            if (ev == null)
            {
                return;
            }

            NavigationParameters navP = new NavigationParameters();

            navP.Add("DETAILS", ev);
            await _nav.NavigateAsync(nameof(EventsDetailPage), navP);
        }
コード例 #13
0
        private void SetupMenu()
        {
            LstView = new MenuListView();
            LstView.SeparatorVisibility = SeparatorVisibility.None;
            var layout = this.FindByName <ContentView>("menuContent");

            layout.Content = LstView;

            MenuNavigateCommand = new DelegateCommand <MasterPageItem>(NavigateMenu);

            // add buttons
            var english = this.FindByName <Button>("ChangeEnglish");

            english.Clicked += async(sender, args) =>
            {
                if (!GlobalSetting.CultureCode.Equals("en"))
                {
                    ApiServiceIndividual api = new ApiServiceIndividual();
                    await api.SetCurrentCultureAsync("en");

                    GlobalSetting.SetupCulture();

                    await((AWMVVMBase)this.ParentView.BindingContext).ShowMessage("Language Change", "Language Changed to English", "OK");
                    ((AWMVVMBase)this.ParentView.BindingContext).NavigateAsync($"{nameof(StartPage)}");
                }
            };

            var arabic = this.FindByName <Button>("ChangeArabic");

            arabic.Clicked += async(sender, args) =>
            {
                if (!GlobalSetting.CultureCode.Equals("ar"))
                {
                    ApiServiceIndividual api = new ApiServiceIndividual();
                    await api.SetCurrentCultureAsync("ar");

                    GlobalSetting.SetupCulture();

                    await((AWMVVMBase)this.ParentView.BindingContext).ShowMessage("تغير اللغة", "تم تغيير اللغة إلى الإنجليزية", "حسنا");
                    ((AWMVVMBase)this.ParentView.BindingContext).NavigateAsync($"{nameof(StartPage)}");
                }
            };
        }
コード例 #14
0
        async void LoadData()
        {
            ApiServiceIndividual api = new ApiServiceIndividual();

            BadgeSource = await api.GetBadgesAsync();

            TranslateExtension trans = new TranslateExtension();

            // set init data here
            foreach (var item in BadgeSource)
            {
                if (item.Locked == 0) // locked item
                {
                    item.BadgeIcon   = "startemptyy.png";
                    item.BadgeStatus = trans.GetProviderValueString("LabelBadgeLockedStatus");
                }
                else
                {
                    item.BadgeIcon   = "starfilledy.png";
                    item.BadgeStatus = trans.GetProviderValueString("LabelBadgeUNLockedStatus");
                }
            }
        }
コード例 #15
0
        public async void OnNavigatedTo(NavigationParameters parameters)
        {
            // check param mode to refresh the lists we have in jobs
            // JOBWATCHREMOVE / JOBWATCHADD / JOBAPPLY
            var data = parameters.Where(x => x.Key == "JOBWATCHREMOVE").FirstOrDefault();

            if (data.Value != null)
            {
                var postid = data.Value.ToString();
                var item   = WatchListJobsSource.Where(x => x.JobPostId == postid).FirstOrDefault();
                if (item != null)
                {
                    WatchListJobsSource.Remove(item);
                }
            }

            // add watch
            data = parameters.Where(x => x.Key == "JOBWATCHADD").FirstOrDefault();
            if (data.Value != null)
            {
                var postid = data.Value.ToString();
                ApiServiceIndividual api = new ApiServiceIndividual();
                var item = await api.GetWatchedJobsSingleAsync(postid);

                if (item != null)
                {
                    WatchListJobsSource.Add(item);
                }
            }

            // apply job list
            data = parameters.Where(x => x.Key == "JOBAPPLY").FirstOrDefault();
            if (data.Value != null)
            {
                // trigger apply job here...
            }
        }
コード例 #16
0
        private async Task LoadDatasource()
        {
            ApiServiceIndividual api = new ApiServiceIndividual();

            NotificationsSource = await api.GetNotificationsAsync();
        }
コード例 #17
0
        private async void LoadSourceData()
        {
            ApiServiceIndividual api = new ApiServiceIndividual();

            ComplaintsSource = await api.GetComplaintsAsync();
        }
コード例 #18
0
        async Task SyncDbAsync()
        {
            ApiServiceIndividual svr = new ApiServiceIndividual();

            svr.SyncAPiToDB();
        }
コード例 #19
0
        private async void LoadSource()
        {
            ApiServiceIndividual apiServ = new ApiServiceIndividual();

            ProgramsSource = await apiServ.GetAllProgramsAsync(_statusText);
        }