예제 #1
0
        //
        // GET: /Report/
        public ActionResult Index()
        {
			using(var client = new ApiRef.StoreClient())
			{
				return View(client.GetReport());
			}
        }
예제 #2
0
		public ActionResult Details(int id)
        {
			using (var client = new ApiRef.StoreClient())
			{
				var model = client.GetBook(id);

				return View(model);
			}
        }
예제 #3
0
		public ActionResult Create(Book book)
        {
            try
            {
				using (var client = new ApiRef.StoreClient())
				{
					client.PostBook(book);
				}

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #4
0
		public ActionResult Delete(int id, FormCollection c)
        {
            try
            {
				using (var client = new ApiRef.StoreClient())
				{
					client.DeleteBook(id);
				}

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }