//update allocated plot public async Task UpdatePlotAllocation(PlotDto input) { var plot = _plotRepository.FirstOrDefault(input.Id); plot.IsAllocated = true; await _plotRepository.UpdateAsync(plot); }
public async Task UpdatePlot(PlotDto input) { var plot = _plotRepository.FirstOrDefault(input.Id); plot.Name = input.Name; plot.CompartmentId = input.CompartmentId; await _plotRepository.UpdateAsync(plot); }
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); }
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> >())); }