Пример #1
0
        public async Task <ActionResult> Add()
        {
            AllListVM        model     = new AllListVM();
            CategoryManager  cm        = new CategoryManager();
            PublisherManager pm        = new PublisherManager();
            string           ApiUrlCat = "http://localhost:6815/api/category/SelectAll";
            string           ApiUrlPub = "http://localhost:6815/api/publisher/SelectAll";

            model.Categories = await cm.SelectAll(ApiUrlCat);

            model.Publishers = await pm.SelectAll(ApiUrlPub);


            return(PartialView("~/Views/Book/partial/insert.cshtml", model));
        }
Пример #2
0
        public async Task <ActionResult> GetOneBook(int?id)
        {
            ComplexVm        complex   = new ComplexVm();
            AllListVM        model     = new AllListVM();
            CategoryManager  cm        = new CategoryManager();
            PublisherManager pm        = new PublisherManager();
            string           ApiUrlCat = "http://localhost:6815/api/category/SelectAll";
            string           ApiUrlPub = "http://localhost:6815/api/publisher/SelectAll";

            model.Categories = await cm.SelectAll(ApiUrlCat);

            model.Publishers = await pm.SelectAll(ApiUrlPub);

            complex.AllList = model;

            BookManager bm         = new BookManager();
            string      ApiUrlBook = "http://localhost:6815/api/book/onebook/" + id;

            complex.book = await bm.OneBook(ApiUrlBook);



            return(PartialView("~/Views/Book/partial/UpdateForm.cshtml", complex));
        }