示例#1
0
        //update allocated plot
        public async Task UpdatePlotAllocation(PlotDto input)
        {
            var plot = _plotRepository.FirstOrDefault(input.Id);

            plot.IsAllocated = true;
            await _plotRepository.UpdateAsync(plot);
        }
示例#2
0
        public async Task UpdatePlot(PlotDto input)
        {
            var plot = _plotRepository.FirstOrDefault(input.Id);

            plot.Name          = input.Name;
            plot.CompartmentId = input.CompartmentId;

            await _plotRepository.UpdateAsync(plot);
        }
示例#3
0
        public async Task DeletePlotAsync(PlotDto input)
        {
            var plot = _plotRepository.FirstOrDefault(input.Id);

            if (plot == null)
            {
                throw new UserFriendlyException("Plot Year not Found!");
            }
            await _plotRepository.DeleteAsync(plot);
        }
示例#4
0
        public List <TallySheetDto> GetTallySheets(PlotDto plot)
        {
            var tallySheets = _tallySheetRepository
                              .GetAll()
                              .Where(x => x.PlotId == plot.Id)
                              .OrderBy(p => p.DBH)
                              .ToList();

            return(new List <TallySheetDto>(tallySheets.MapTo <List <TallySheetDto> >()));
        }