Exemple #1
0
        public async Task <IActionResult> Edit(EditBeehivePostModel input)
        {
            if (this.ModelState.IsValid == false)
            {
                return(this.View(input));
            }

            await this.beehiveService.EditAsync
                (input.Id, input.Number, input.SystemType, input.BeehiveType);

            return(this.RedirectToAction(nameof(ViewAll)));
        }
Exemple #2
0
        public IActionResult Edit(int id)
        {
            var beehive = this.beehiveService.FindById(id);

            var editBeehive = new EditBeehivePostModel
            {
                Id          = id,
                Number      = beehive.Number,
                SystemType  = beehive.SystemType,
                BeehiveType = beehive.BeehiveType
            };

            return(this.View(editBeehive));
        }