Ejemplo n.º 1
0
        public IActionResult CreateMultiple()
        {
            var userId = this.userManager.GetUserId(this.User);

            var model = new AddBeehivesInRangePostModel()
            {
                AllApairies = this.apiaryService.GetAll(userId),
            };

            return(this.View(model));
        }
Ejemplo n.º 2
0
        public IActionResult CreateMultiple(AddBeehivesInRangePostModel input)
        {
            var userId   = this.userManager.GetUserId(this.User);
            var apiaryId = input.SelectedApiary;

            if (ModelState.IsValid == false)
            {
                input.AllApairies = this.apiaryService.GetAll(userId);
                return(this.View(input));
            }

            this.beehiveService.CreateMultiple(
                apiaryId, input.FirstNumber, input.LastNumber,
                input.SystemType, input.BeehiveType);

            return(this.RedirectToAction("Index", "Home"));
        }