Ejemplo n.º 1
0
        public async Task <IActionResult> SelectBeehivesToAddInTemporary(int id, SelectBeehivesToAddInTemporaryInputModel inputModel)
        {
            var selectedBeehivesIds = inputModel.Beehives.Where(b => b.IsChecked == true).Select(b => b.Id).ToList();

            await this.temporaryApiaryBeehiveService.AddMultipleBeehiveToApiary(inputModel.TemporaryId, selectedBeehivesIds);

            return(this.RedirectToAction("AllByMovableApiaryId", "Beehive", new { id = inputModel.TemporaryId }));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> SelectBeehivesToAddInTemporary(int selectedId, int temporaryId)
        {
            var currentUser = await this.userManager.GetUserAsync(this.User);

            var inputModel = new SelectBeehivesToAddInTemporaryInputModel
            {
                TemporaryId     = temporaryId,
                TemporaryNumber = this.apiaryService.GetApiaryNumberByApiaryId(temporaryId),
                TemporaryName   = this.apiaryService.GetApiaryNameByApiaryId(temporaryId),
                Beehives        = this.beehiveService.GetBeehivesByApiaryIdWithoutInTemporary <SelectBeehiveToAddInTemporaryModel>(selectedId).ToList(),
            };

            return(this.View(inputModel));
        }