예제 #1
0
        public IActionResult Add()
        {
            LibrarianBindingModel model = new LibrarianBindingModel();

            model.LibraryId = this.userService.GetUserLibraryId(this.User.Identity.Name);
            model.Library   = this.libraryService.GetLibraryDetails(model.LibraryId).Name;
            return(this.View(model));
        }
예제 #2
0
        public IActionResult Add(LibrarianBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return(this.View(model));
            }

            var  dto    = this.mapper.Map <LibrarianDTO>(model);
            bool result = this.libraryService.AddLibrarian(dto);

            return(this.Redirect("/"));
        }