Пример #1
0
        // GET: Book
        public ActionResult Index()
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            return(View());
        }
Пример #2
0
        public ActionResult InsertIndex(Models.Orders selectitem)
        {
            Models.OrdersService ordersService = new Models.OrdersService();
            Models.CodeService   codeService   = new Models.CodeService();

            ViewBag.CompanyName     = this.codeService.GetCustomer();
            ViewBag.empData         = this.codeService.GetEmpname();
            ViewBag.shipData        = this.codeService.GetShipperName();
            ViewBag.ProductCodeData = this.codeService.GetProduct();
            return(View(new Models.Orders()));
        }
Пример #3
0
        public ActionResult Search()
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            ViewBag.List   = books;
            ViewBag.length = books.Count;
            ViewBag.see    = books[0].BOOK_NAME;


            return(View());
        }
Пример #4
0
        public ActionResult Insert(Models.Book book)
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            books = result.InsertBooks(book);


            ViewBag.List   = books;
            ViewBag.length = books.Count;
            return(View("Search"));
        }
Пример #5
0
        public ActionResult Index(Models.BookSearchArg arg)
        {
            Models.CodeService codeService = new Models.CodeService();
            ViewBag.BookClassNameItem = codeService.GetBookClassName();
            ViewBag.BookBoughterItem  = codeService.GetBookBoughter();
            ViewBag.BookStatusItem    = codeService.GetBookStatus();

            Models.BookService bookService = new Models.BookService();
            ViewBag.BookSearchResult = bookService.GetBookByCondition(arg);

            return(InsertBook());
        }
Пример #6
0
        public ActionResult Search(Models.Book book)
        {
            Models.CodeService result    = new Models.CodeService();
            IList <Book>       books     = result.GetBooks();
            IList <Book>       CatchBook = new List <Book>();///創一個IList來接想查詢的值

            ViewBag.length = 0;
            for (int i = 0; i < books.Count; i++)
            {
                if (book.BOOK_NAME != null)                          ///如果有填書名
                {
                    if (books[i].BOOK_NAME.Contains(book.BOOK_NAME)) ///如果三個資料內contain傳進來的bookname
                    {
                        CatchBook.Add(books[i]);
                        ViewBag.length = ViewBag.length + 1;
                        continue;
                    }
                }
                if (book.BOOK_TYPE != null)                        ///如果有填種類
                {
                    if (books[i].BOOK_TYPE.Equals(book.BOOK_TYPE)) ///如果三個資料有跟表單一樣的種類
                    {
                        CatchBook.Add(books[i]);
                        ViewBag.length = ViewBag.length + 1;
                        continue;
                    }
                }
                if (book.BOOK_KEEPER != null)
                {
                    if (books[i].BOOK_KEEPER.Equals(book.BOOK_KEEPER))///如果三個資料有跟表單一樣的借書人
                    {
                        CatchBook.Add(books[i]);
                        ViewBag.length = ViewBag.length + 1;
                        continue;
                    }
                }
                if (book.BOOK_STATUS != null)
                {
                    if (books[i].BOOK_STATUS.Equals(book.BOOK_STATUS))///如果三個資料有跟表單一樣的借閱狀態
                    {
                        CatchBook.Add(books[i]);
                        ViewBag.length = ViewBag.length + 1;
                        continue;
                    }
                }
            }
            ViewBag.List = CatchBook;
            return(View());
        }
Пример #7
0
        public ActionResult Update(Models.Book book)
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            books = result.UpdateBooks(book);
            for (int i = 0; i < books.Count; i++)
            {
                if (books[i].BOOK_NAME.Equals(book.BOOK_NAME)) ///如果name一樣進來
                {
                    books[i] = book;                           ///把要顯示的Tlist設為剛剛傳進來的book
                }
            }
            ViewBag.List   = books;
            ViewBag.length = books.Count;
            return(View("Search"));
        }
Пример #8
0
        /// <summary>
        /// 每次只能刪一個
        /// </summary>
        /// <param name="BookName"></param>
        /// <returns></returns>
        public ActionResult Delete(String BookName)
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            for (int i = 0; i < books.Count; i++)
            {
                if (books[i].BOOK_NAME.Equals(BookName))
                {
                    books.Remove(books[i]);
                }
            }

            ViewBag.List   = books;
            ViewBag.length = books.Count;

            return(View("Search"));
        }
Пример #9
0
        // GET: Order
        public ActionResult Index(Models.Customer arg)
        {
            ///取得聯絡人職稱
            Models.CodeService  codser = new Models.CodeService();
            Models.OrderService ser    = new Models.OrderService();

            ViewBag.CustContactTitle = codser.GetCustContactTitle();
            if (arg.indexboo)
            {
                ///條件客戶資料
                ViewBag.custdata = ser.GetCustInforby(arg);
            }
            else
            {
                ///客戶資料
                ViewBag.custdata = ser.GetCustInfor();
            }
            return(View());
        }
Пример #10
0
        public ActionResult Update(String BookName)
        {
            Models.CodeService result = new Models.CodeService();
            IList <Book>       books  = result.GetBooks();

            for (int i = 0; i < books.Count; i++)
            {
                if (books[i].BOOK_NAME.Equals(BookName))
                {
                    ViewBag.BookName    = books[i].BOOK_NAME;
                    ViewBag.Author      = books[i].BOOK_AUTHOR;
                    ViewBag.Publisher   = books[i].BOOK_PUBLISHER;
                    ViewBag.Note        = books[i].BOOK_NOTE;
                    ViewBag.BroughtDate = books[i].BOOK_BOUGHT_DATE;
                    ViewBag.Type        = books[i].BOOK_TYPE;
                    ViewBag.Status      = books[i].BOOK_STATUS;
                    ViewBag.Keeper      = books[i].BOOK_KEEPER;
                }
            }

            return(View());
        }