コード例 #1
0
 public CommonDataService()
 {
     examinerService         = DependencyService.Get <IExaminerService>();
     programNoteService      = DependencyService.Get <IProgramNoteService>();
     _orgRecordFormService   = DependencyService.Get <IOrgRecordFormService>();
     _contentcategoryservice = DependencyService.Get <IContentCategoryService>();
 }
 public ExaminerController(IExaminerService examiner)
 {
     _examiner = examiner;
 }
コード例 #3
0
        public DashboardpageViewModel()
        {
            _locationService                  = DependencyService.Get <ILocationService>();
            _tokenService                     = DependencyService.Get <ITokenService>();
            _studentService                   = DependencyService.Get <IStudentsService>();
            _productResearchCodesService      = DependencyService.Get <IProductResearchCodesService>();
            _productResearchCodeValuesService = DependencyService.Get <IProductResearchCodeValuesService>();
            _productService                   = DependencyService.Get <IProductService>();
            _assessmentService                = DependencyService.Get <IAssessmentsService>();
            _contentCategoryLevelsService     = DependencyService.Get <IContentCategoryLevelsService>();
            _contentCategoryService           = DependencyService.Get <IContentCategoryService>();
            _contentCategoryItemsService      = DependencyService.Get <IContentCategoryItemsService>();
            _programNoteService               = DependencyService.Get <IProgramNoteService>();
            _examinerService                  = DependencyService.Get <IExaminerService>();
            _contentItemService               = DependencyService.Get <IContentItemsService>();
            _contentItemAttributeService      = DependencyService.Get <IContentItemAttributesService>();
            _contentRubricsService            = DependencyService.Get <IContentRubricsService>();
            _contentRubicPointsService        = DependencyService.Get <IContentRubricPointsService>();
            _contentItemTalliesService        = DependencyService.Get <IContentItemTallyService>();
            _contentItemTalliesScoresService  = DependencyService.Get <IContentItemTalliesScoresService>();
            _contentGroupService              = DependencyService.Get <IContentGroupService>();
            _contentGroupItemsService         = DependencyService.Get <IContentGroupItemsService>();
            _orgRecordFormService             = DependencyService.Get <IOrgRecordFormService>();
            _userPermissionService            = DependencyService.Get <IUserPermissionService>();

            var userID = Convert.ToInt32(Application.Current.Properties["UserID"]);
            var user   = userService.GetUserByID(userID);

            if (user != null)
            {
                DeviceID = user.DeviceId;
            }
            CheckInternet();
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet)
            {
                IsInternetAvailable = false;
                string userFirstName = "", userLastName = "";
                if (Application.Current.Properties.ContainsKey("FirstName") && Application.Current.Properties["FirstName"] != null)
                {
                    userFirstName = Application.Current.Properties["FirstName"].ToString();
                }
                if (Application.Current.Properties.ContainsKey("LastName") && Application.Current.Properties["LastName"] != null)
                {
                    userLastName = Application.Current.Properties["LastName"].ToString();
                }

                UserFullName = "" + userFirstName + "  " + "" + userLastName + "";
            }
            else
            {
                IsInternetAvailable = true;
                _tokenService       = DependencyService.Get <ITokenService>();
                var tokenModel = _tokenService.GetTokenResposne();
                if (tokenModel != null)
                {
                    UserFullName = "" + tokenModel.FirstName + "  " + "" + tokenModel.LastName + "";
                }
            }

            FailedString  = "Failed: 0";
            PendingString = "Pending: 0";

            NewAssessmentCommand      = new Command(NewAssessment);
            ResumeAssessmentCommand   = new Command(ResumeAssessment);
            BrowseUpdateRecordCommand = new Command(BrowseUpdate);
            AddNewRecordCommand       = new Command(AddNew);
            ReportToFamilyCommand     = new Command(Report);
            OpenFullReportCommand     = new Command(OpenFullReport);
            ShowInfoCommand           = new Command(openInfo);

            HomeCommand = new Command(async() =>
            {
                var popUpNavigationInstance = PopupNavigation.Instance;
                await popUpNavigationInstance.PushAsync(new LogoutpopupView());
                //await App.Current.MainPage.Navigation.PushModalAsync(new LogoutpopupView());
                //if (!Application.Current.Properties.ContainsKey("RememberMe") || Application.Current.Properties["RememberMe"].ToString() == "False")
                //{
                //Application.Current.Properties.Clear();
                //}
                //App.LogoutAction?.Invoke(false);
            });
        }