public IActionResult Edit(RoomViewModel roomViewModel)
        {
            var roomDomain = mapper.Map <Room>(roomViewModel);

            roomApp.Update(roomDomain);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Edit(RoomViewModel roomViewModel)
        {
            if (ModelState.IsValid)
            {
                var roomRet = _roomAppService.Update(roomViewModel);
                if (roomRet.ValidationResult.IsValid)
                {
                    return(RedirectToAction("Index"));
                }

                AddErrorIntoModelState(roomRet.ValidationResult);
            }
            return(View(roomViewModel));
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            Id           = id;
            ErrorMessage = "";
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var result = await _roomAppService.Update(id, Room);

            if (!result.IsSuccess)
            {
                ErrorMessage = result.Message;
                return(Page());
            }
            else
            {
                return(RedirectToPage("/Map/Index"));
            }
        }