public RevegetationPartIIVM(RevegetationPartIIBO BO) { this.PostMineRevegetationTypesDiscussion = BO.PostmineRevegetationTypesDiscussion; this.LandUseComments = BO.LandUseComments; DisplayGrid = new List<DisplayGridRow>(); foreach (VegetationCommunityTypeDO VT in BO.VegetationCommunityTypes) { DisplayGridRow NewRow = new DisplayGridRow(); NewRow.VegetationCommunityType = VT.VegetationCommunityType; NewRow.VegetationCommunityTypeAcres = VT.Acres; DisplayGrid.Add(NewRow); } int GridRowCount = DisplayGrid.Count(); int CurrentGridRow = 0; foreach (PremineLandUseDO PMLU in BO.PremineLandUse) { if (CurrentGridRow < GridRowCount) { DisplayGrid[CurrentGridRow].PreMineLandUseType = PMLU.PremineLandUse; DisplayGrid[CurrentGridRow].PreMineLandUseAcres = PMLU.Acres; CurrentGridRow = CurrentGridRow + 1; } else { DisplayGridRow NewRow = new DisplayGridRow(); NewRow.VegetationCommunityType = null; NewRow.VegetationCommunityTypeAcres = 0; NewRow.PostMineLandUseType = null; NewRow.PostMineLandUseAcres = 0; NewRow.PreMineLandUseType = PMLU.PremineLandUse; NewRow.PreMineLandUseAcres = PMLU.Acres; DisplayGrid.Add(NewRow); } } GridRowCount = DisplayGrid.Count(); CurrentGridRow = 0; foreach (PostmineLandUseDO PostLU in BO.PostMineLandUse) { if (CurrentGridRow < GridRowCount) { DisplayGrid[CurrentGridRow].PostMineLandUseType = PostLU.PostmineLandUse; DisplayGrid[CurrentGridRow].PostMineLandUseAcres = PostLU.Acres; CurrentGridRow = CurrentGridRow + 1; } else { DisplayGridRow NewRow = new DisplayGridRow(); NewRow.VegetationCommunityType = null; NewRow.VegetationCommunityTypeAcres = 0; NewRow.PostMineLandUseType = PostLU.PostmineLandUse; ; NewRow.PostMineLandUseAcres = PostLU.Acres; NewRow.PreMineLandUseType = null; NewRow.PreMineLandUseAcres = 0; DisplayGrid.Add(NewRow); } } }
public RevegetationPartIIBO WriteDataToTables(int PermitKey, ModelStateDictionary ModelState) { RevegetationPartIIBO data = new RevegetationPartIIBO(); data.PostmineRevegetationTypesDiscussion = this.PostMineRevegetationTypesDiscussion; data.LandUseComments = this.LandUseComments; data.PermitKey = PermitKey; return data; }