public TreeDetailsViewModel(INavigation navigation, string selectedTreeID) { _navigation = navigation; _tree = new TREE(); _tree.TREEID = selectedTreeID; _treeRepository = new TreeRepository(); UpdateTreeCommand = new Command(async() => await UpdateTree()); DeleteTreeCommand = new Command(async() => await DeleteTree()); CommentsCommand = new Command(async() => await ShowComments()); ResetCommand = new Command(async() => await ResetValues()); StemMapCommand = new Command(async() => await ShowStemMap()); DeformityCommand = new Command(async() => await ShowDeformity()); AgeCommand = new Command(async() => await ShowAge()); ListSpecies = PickerService.SpeciesItems().OrderBy(c => c.ID).ToList(); ListVigour = PickerService.VigourItems().OrderBy(c => c.NAME).ToList(); ListCrownDamage = PickerService.CrownDamageItems().OrderBy(c => c.NAME).ToList(); ListDefoliatingInsect = PickerService.DefoliatingInsectItems().OrderBy(c => c.NAME).ToList(); ListFoliarDisease = PickerService.FoliarDiseaseItems().OrderBy(c => c.NAME).ToList(); ListBarkRetention = PickerService.BarkRetentionItems().OrderBy(c => c.NAME).ToList(); ListWoodCondition = PickerService.WoodConditionItems().OrderBy(c => c.NAME).ToList(); ListMortalityCause = PickerService.MortalityCauseItems().OrderBy(c => c.NAME).ToList(); ListDecayClass = PickerService.DecayClassItems().OrderBy(c => c.NAME).ToList(); ListCrownPosition = PickerService.CrownPositionItems().OrderBy(c => c.NAME).ToList(); ListCrownClass = PickerService.CrownClassItems().OrderBy(c => c.NAME).ToList(); ListStemQuality = PickerService.StemQualityItems().OrderBy(c => c.NAME).ToList(); FetchTreeDetails(); IsChanged = false; OnAppearingCommand = new Command(() => OnAppearing()); OnDisappearingCommand = new Command(() => OnDisappearing()); }
public AddTreeViewModel(INavigation navigation, string fk) { _navigation = navigation; //_treeValidator = new TreeValidator(); _tree = new TREE(); _treeRepository = new TreeRepository(); _fk = fk; AddCommand = new Command(async() => await AddTree(_fk)); ViewAllCommand = new Command(async() => await ShowList()); ListSpecies = PickerService.SpeciesItems().OrderBy(c => c.NAME).ToList(); ListVigour = PickerService.VigourItems().ToList(); ListCrownDamage = PickerService.CrownDamageItems().ToList(); ListDefoliatingInsect = PickerService.DefoliatingInsectItems().ToList(); ListFoliarDisease = PickerService.FoliarDiseaseItems().ToList(); ListBarkRetention = PickerService.BarkRetentionItems().ToList(); ListWoodCondition = PickerService.WoodConditionItems().ToList(); ListMortalityCause = PickerService.MortalityCauseItems().ToList(); ListDecayClass = PickerService.DecayClassItems().ToList(); ListCrownPosition = PickerService.CrownPositionItems().ToList(); CommentsCommand = new Command(async() => await ShowComments()); }
public TreeDetailsViewModel(INavigation navigation, string selectedTreeID) { _navigation = navigation; _tree = new TREE(); _tree.TREEID = selectedTreeID; _treeRepository = new TreeRepository(); UpdateTreeCommand = new Command(async() => await UpdateTree()); DeleteTreeCommand = new Command(async() => await DeleteTree()); CommentsCommand = new Command(async() => await ShowComments()); ListSpecies = PickerService.SpeciesItems().OrderBy(c => c.NAME).ToList(); ListVigour = PickerService.VigourItems().ToList(); ListCrownDamage = PickerService.CrownDamageItems().ToList(); ListDefoliatingInsect = PickerService.DefoliatingInsectItems().ToList(); ListFoliarDisease = PickerService.FoliarDiseaseItems().ToList(); ListBarkRetention = PickerService.BarkRetentionItems().ToList(); ListWoodCondition = PickerService.WoodConditionItems().ToList(); ListMortalityCause = PickerService.MortalityCauseItems().ToList(); ListDecayClass = PickerService.DecayClassItems().ToList(); ListCrownPosition = PickerService.CrownPositionItems().ToList(); FetchTreeDetails(); }
public AddTreeViewModel(INavigation navigation, string fk) { _navigation = navigation; //_treeValidator = new TreeValidator(); _tree = new TREE(); _treeRepository = new TreeRepository(); _fk = fk; _tree.PLOTID = fk; AddCommand = new Command(async() => await AddTree(_fk)); DeleteTreeCommand = new Command(async() => await DeleteTree()); ViewAllCommand = new Command(async() => await ShowList()); ListSpecies = PickerService.SpeciesItems().OrderBy(c => c.ID).ToList(); ListVigour = PickerService.VigourItems().OrderBy(c => c.NAME).ToList(); ListCrownDamage = PickerService.CrownDamageItems().OrderBy(c => c.NAME).ToList(); ListDefoliatingInsect = PickerService.DefoliatingInsectItems().OrderBy(c => c.NAME).ToList(); ListFoliarDisease = PickerService.FoliarDiseaseItems().OrderBy(c => c.NAME).ToList(); ListBarkRetention = PickerService.BarkRetentionItems().OrderBy(c => c.NAME).ToList(); ListWoodCondition = PickerService.WoodConditionItems().OrderBy(c => c.NAME).ToList(); ListMortalityCause = PickerService.MortalityCauseItems().OrderBy(c => c.NAME).ToList(); ListDecayClass = PickerService.DecayClassItems().OrderBy(c => c.NAME).ToList(); ListCrownPosition = PickerService.CrownPositionItems().OrderBy(c => c.NAME).ToList(); ListCrownClass = PickerService.CrownClassItems().OrderBy(c => c.NAME).ToList(); ListStemQuality = PickerService.StemQualityItems().OrderBy(c => c.NAME).ToList(); CommentsCommand = new Command(async() => await ShowComments()); StemMapCommand = new Command(async() => await ShowStemMap()); DeformityCommand = new Command(async() => await ShowDeformity()); AgeCommand = new Command(async() => await ShowAge()); OnAppearingCommand = new Command(() => OnAppearing()); OnDisappearingCommand = new Command(() => OnDisappearing()); // DoDefaults _tree.HEIGHTTODBH = 1.3F; _tree.DBHIN = "Y"; _tree.CROWNIN = "Y"; _tree.BARKRETENTIONCODE = 1; _tree.WOODCONDITIONCODE = 1; if (util.UseDefaultOrigin) { _tree.TREEORIGINCODE = util.DefaultOrigin; } if (util.UseDefaultStatus) { _tree.TREESTATUSCODE = util.DefaultStatus; } if (util.UseDefaultVSNStatus) { _tree.VSNSTATUSCODE = util.DefaultVSNStatus; } if (util.UseDefaultSpecies) { _tree.SPECIESCODE = util.DefaultSpecies; } _tree.HEIGHTTODEADTIP = 999; _tree.DIRECTHEIGHTTOCONTLIVECROWN = 0; _tree.OCULARHEIGHTTOCONTLIVECROWN = 999; if (util.AllowAutoNumber) { _tree.TREENUMBER = _treeRepository.GetNextNumber(fk); } }