Esempio n. 1
0
        public EcositeDetailsViewModel(INavigation navigation, string selectedID)
        {
            _navigation        = navigation;
            _ecosite           = new ECOSITE();
            _ecosite.PLOTID    = selectedID;
            _ecositeRepository = new EcositeRepository();
            _fk                = selectedID;
            UpdateCommand      = new Command(async() => await Update());
            DeleteCommand      = new Command(async() => await Delete());
            CommentsCommand    = new Command(async() => await ShowComments());
            EcositeCommand     = new Command(async() => await ShowEcosite());
            PhotoCommand       = new Command(async() => await ShowPhoto());
            ListDrainage       = PickerService.DrainageItems().ToList();
            ListPorePattern    = PickerService.PorePatternItems().ToList();
            ListMoistureRegime = PickerService.MoistureRegimeItems().ToList();
            ListHumusForm      = PickerService.HumusFormItems().ToList();
            ListDepthClass     = PickerService.DepthClassItems().ToList();
            ListDeposition     = PickerService.DepositionItems().ToList();

            // Get the ecosite if it exists
            if (_ecositeRepository.IsEcositeExists(_fk))
            {
                FetchDetails(_fk);
            }
        }
 public EcositeDetailsViewModel(INavigation navigation, string selectedID)
 {
     _navigation        = navigation;
     _ecosite           = new ECOSITE();
     _ecosite.PLOTID    = selectedID;
     _ecositeRepository = new EcositeRepository();
     _fk                   = selectedID;
     UpdateCommand         = new Command(async() => await Update());
     DeleteCommand         = new Command(async() => await Delete());
     CommentsCommand       = new Command(async() => await ShowComments());
     EcositeCommand        = new Command(async() => await ShowEcosite());
     PhotoCommand          = new Command(async() => await ShowPhoto());
     SoilCommand           = new Command(async() => await ShowSoil());
     TextureCommand        = new Command(async() => await ShowTexture());
     ListDrainage          = PickerService.DrainageItems().ToList();
     ListPorePattern       = PickerService.PorePatternItems().ToList();
     ListMoistureRegime    = PickerService.MoistureRegimeItems().ToList();
     ListHumusForm         = PickerService.HumusFormItems().ToList();
     ListDepthClass        = PickerService.DepthClassItems().ToList();
     ListDeposition        = PickerService.DepositionItems().ToList();
     ListPerson            = PickerService.FillPersonPicker(_ecositeRepository.GetPersonList()).OrderBy(c => c.NAME).ToList();
     ImageCommand          = new Command(async() => await ShowImage());
     OnAppearingCommand    = new Command(() => OnAppearing());
     OnDisappearingCommand = new Command(() => OnDisappearing());
     // Get the ecosite if it exists
     if (_ecositeRepository.IsEcositeExists(_fk))
     {
         FetchDetails(_fk);
     }
     else
     {
         _ecosite.SUBSTRATEDATE                    = System.DateTime.Now;
         _ecosite.DEPTHTOCARBONATES                = 999;
         _ecosite.DEPTHTOBEDROCK                   = 999;
         _ecosite.DEPTHTODISTINCTMOTTLES           = 999;
         _ecosite.DEPTHTOGLEY                      = 999;
         _ecosite.DEPTHTOIMPASSABLECOARSEFRAGMENTS = 999;
         _ecosite.DEPTHTOPROMINENTMOTTLES          = 999;
         _ecosite.DEPTHTOROOTRESTRICTION           = 999;
         _ecosite.DEPTHTOSEEPAGE                   = 999;
         _ecosite.DEPTHTOWATERTABLE                = 999;
         _ecosite.STRATIFIED      = "N";
         _ecosite.PROBLEMATICSITE = "N";
         _ecosite.PRI_ECO_PCT     = 100;
     }
     Refresh();
 }