Example #1
0
        public async void Init(string idRecord)
        {
            _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
            _progressLoaderService.ShowProgressBar();
            _idRecord          = Guid.Parse(idRecord);
            _dataLoaderService = Mvx.Resolve <IDataLoaderService>();
            _profileService    = Mvx.Resolve <IProfileService>();
            try
            {
                Record      = _dataLoaderService.GetRecord(Guid.Parse(idRecord));
                CurrentUser = await _profileService.GetUser();

                MasterUser = await _profileService.GetUserById(IdMaster);

                ClientUser = await _profileService.GetUserById(IdClient);

                //if (CurrentUser != null & CurrentUser.id == IdMaster)
                //{
                //    MasterUser = await Mvx.Resolve<IProfileService>().GetUser();
                //    Client = await Mvx.Resolve<IProfileService>().GetFriend(IdClient);
                //}
                //else if (CurrentUser.id == IdClient)
                //{
                //    ClientUser = await Mvx.Resolve<IProfileService>().GetUser();
                //    Master = await Mvx.Resolve<IProfileService>().GetFriend(IdMaster);
                //}
            }
            catch (Exception ex)
            {
                _progressLoaderService.HideProgressBar();
            }
            _progressLoaderService.HideProgressBar();
        }
        public ExamSearchPageViewModel(IDataLoaderService dataLoaderService, IAlertMessageService alertMessageService, [Dependency("ExamRequest")] IApiRequestService examRequestService)
        {
            _dataLoaderService = dataLoaderService;
            _examRequestService = examRequestService;
            _alertMessageService = alertMessageService;

            classid = (_dataLoaderService.ReadAppJSONData<StuInfo>(DataKey.StuInfo) as StuInfo).clazz._id;

            Task.Factory.StartNew(GetExamList);
        }
 public ShipAttributesViewModel(IDataLoaderService loader, IEventAggregator eventaggregator, ShipAttributesModel data) {
     this._data = data;
     this._loader = loader;
     this._eventAggregator = eventaggregator;
     this._eventAggregator.GetEvent<OutfittingChangedEvent>().Subscribe(SaveOutfitting);
     this._shipout = new ShipOutfittingModel();
     this._combinedInternals = new List<InternalModel>();
     this.ResetClickCommand = new DelegateCommand(this.OnResetClick);
     this.SaveHangarClickCommand = new DelegateCommand(this.OnSaveHangarClick);
     this.SaveFileClickCommand = new DelegateCommand(this.OnSaveFileClick);
     // Load all Ships and set the first as "seleted
     this.Data.Ships = _loader.loadShips();
     this.SelectedShip = this.Data.Ships[0];
 }
        public ScoreSearchPageViewModel(IDataLoaderService dataLoaderService, [Dependency("ScoreRequest")] IApiRequestService scoreRequestService)
        {
            _dataLoaderService = dataLoaderService;
            _scoreRequestService = scoreRequestService;

            stuid = _dataLoaderService.ReadAppData("stuid") as string;
            ComboList = new Collection<string>();
            int i;
            for ( i = int.Parse(stuid.Substring(0, 4));i< DateTime.Today.Year;i++)
            {
                ComboList.Add(i.ToString() + ".1");
                ComboList.Add(i.ToString() + ".2");
            }

        }
Example #5
0
        public MainPageViewModel(INavigationService navigationService, IDataLoaderService dataLoaderService,
                                 [Dependency("EcardRequest")] IApiRequestService ecardRequestService, IAlertMessageService alertMessageService)
        {
            _navigationService = navigationService;
            _dataLoaderService = dataLoaderService;
            _ecardRequestService = ecardRequestService;
            _alertMessageService = alertMessageService;

            Task.Factory.StartNew(GetEcardInfoAsync);

            NaviListCommands = new ObservableCollection<NaviButtonViewModel>()
            {
                new NaviButtonViewModel() {Text = "成绩查询", PageToken = PageTokens.ScoreSearchPage, Command = NaviBtnNavigateCommand },
                new NaviButtonViewModel() {Text = "考试安排", PageToken = PageTokens.ExamSearchPage, Command = NaviBtnNavigateCommand }
            };

        }
Example #6
0
        public LoginPageViewModel(INavigationService navigationService,
            [Dependency("LoginRequest")] IApiRequestService loginRequestService,
            [Dependency("StuInfoRequest")] IApiRequestService stuInfoRequestService,
            IDataLoaderService dataLoaderService,
            IAlertMessageService alertMessageService)
        {
            _navigationService = navigationService;
            _dataLoaderService = dataLoaderService;
            _loginRequestService = loginRequestService;
            _stuInfoRequestService = stuInfoRequestService;
            _alertMessageService = alertMessageService;


            Busy = false;

            if (IsAuto)
            {
                Email = _dataLoaderService.ReadAppData(DataKey.Email) as string;
                Pwd = _dataLoaderService.ReadAppData(DataKey.Pwd) as string;
                ForwardBtnCommand.Execute(null);
            }
        }
 public ShipOutfittingViewModel(IDataLoaderService loader, IEventAggregator eventaggregator, ShipOutfittingModel data) {
     this._loader = loader;
     this.Data = data;
     this._updateItem = new Pair<int, ItemType>();
     this._selectedShip = new ShipModel();
     this._eventAggregator = eventaggregator;
     _eventAggregator.GetEvent<SelectedIDEvent>().Subscribe(LoadNewItem);
     _eventAggregator.GetEvent<SelectedShipEvent>().Subscribe(ShipSelectionChanged);
     _eventAggregator.GetEvent<OutfittingRestrictionsEvent>().Subscribe(RestrictionsChanged);
     // Initialize the filthy rest
     this.HardpointClickCommand = new DelegateCommand(this.OnHardpointClick);
     this.BulkheadClickCommand = new DelegateCommand(this.OnBulkheadClick);
     this.PowerPlantClickCommand = new DelegateCommand(this.OnPowerPlantClick);
     this.ThrusterClickCommand = new DelegateCommand(this.OnThrusterClick);
     this.FSDClickCommand = new DelegateCommand(this.OnFSDClick);
     this.LifeSupportClickCommand = new DelegateCommand(this.OnLifeSupportClick);
     this.PowerDistribClickCommand = new DelegateCommand(this.OnPowerDistribClick);
     this.SensorClickCommand = new DelegateCommand(this.OnSensorClick);
     this.FuelTankClickCommand = new DelegateCommand(this.OnFuelTankClick);
     this.UtilityClickCommand = new DelegateCommand(this.OnUtilityClick);
     this.Internal1ClickCommand = new DelegateCommand(this.OnInternal1Click);
     this.Internal2ClickCommand = new DelegateCommand(this.OnInternal2Click);
 }
Example #8
0
 public SettingPageViewModel(INavigationService navigationService, IDataLoaderService dataLoaderService)
 {
     _navigationService = navigationService;
     _dataLoaderService = dataLoaderService;
 }
        //private readonly IProgressLoaderService _progressLoaderService;

        public HomeClientViewModel()
        {
            _profileService        = Mvx.Resolve <IProfileService>();
            _loaderService         = Mvx.Resolve <IDataLoaderService>();
            _progressLoaderService = Mvx.Resolve <IProgressLoaderService>();
        }
Example #10
0
 public DataLoadController(IDataLoaderService dataLoaderService)
 {
     // handle dataLoaderService null ref
     _dataLoaderService = dataLoaderService;
 }
Example #11
0
 public LoadModel(IDataLoaderService loaderService)
 {
     this.loaderService = loaderService;
 }
Example #12
0
 public SubmissionsController(ISearchService searchService, IDataLoaderService loaderService, IMapper mapper)
 {
     this.searchService = searchService;
     this.loaderService = loaderService;
     this.mapper        = mapper;
 }
 public TypeUserViewModel()
 {
     _dataLoader = Mvx.Resolve <IDataLoaderService>();
 }