Пример #1
0
        public async Task <IActionResult> Create(int id, CreateBeehiveMarkFlagInputModel inputModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(inputModel));
            }

            await this.beehiveMarkFlagService.CreateBeehiveFlag(id, inputModel.Content, inputModel.FlagType);

            return(this.RedirectToAction("ById", "Beehive", new { id = id }));
        }
Пример #2
0
        public IActionResult Create(int id, MarkFlagType markFlagType)
        {
            var inputModel = new CreateBeehiveMarkFlagInputModel()
            {
                FlagType            = markFlagType,
                BeehiveId           = id,
                BeehiveNumber       = this.beehiveService.GetBeehiveNumberById(id),
                BeehiveApiaryId     = this.apiaryService.GetApiaryIdByBeehiveId(id),
                BeehiveApiaryName   = this.apiaryService.GetApiaryNameByBeehiveId(id),
                BeehiveApiaryNumber = this.apiaryService.GetApiaryNumberByBeehiveId(id),
            };

            return(this.View(inputModel));
        }