Exemplo n.º 1
0
        public JsonResult GetFind(string SN)
        {
            Book.BLL.T_Base_Book          bll = new BLL.T_Base_Book();
            List <Book.Model.T_Base_Book> lst = bll.GetFind(SN);

            return(Json(lst));
        }
Exemplo n.º 2
0
        public ActionResult AddSave(string BookName, string Author,
                                    string ISBN, string PressName, int Version, decimal Price)
        {
            //图片保存
            var    file     = Request.Files["ImgFile"];
            string path     = Server.MapPath("\\upLoad\\");
            string fileName = Guid.NewGuid().ToString() + ".jpg";

            file.SaveAs(path + fileName);


            Book.Model.T_Base_Book book = new Model.T_Base_Book();
            book.BookName  = BookName;
            book.Author    = Author;
            book.ISBN      = ISBN;
            book.PressName = PressName;
            book.Version   = Version;
            book.Price     = Price;
            book.Img       = fileName;

            Book.BLL.T_Base_Book bookAddSave = new BLL.T_Base_Book();
            int result = bookAddSave.AddSave(book);

            return(Redirect("/Book/Index"));
        }
Exemplo n.º 3
0
        public ActionResult Delete(int Id)
        {
            Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
            int result = bll.Delete(Id);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
        public JsonResult GetList(int CurrentPage)
        {
            Book.BLL.T_Base_Book          bll = new BLL.T_Base_Book();
            List <Book.Model.T_Base_Book> lst = bll.GetList(CurrentPage, PageSize);

            return(Json(lst));
        }
Exemplo n.º 5
0
        public ActionResult UpdateSave(Book.Model.T_Base_Book book)
        {
            Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
            int result = bll.Update(book);

            return(Redirect("Index"));
        }
Exemplo n.º 6
0
        public JsonResult GetList(int PageSize, int PageNumber, string Query)  //要查找的页数的值
        {
            Book.BLL.T_Base_Book          bll  = new BLL.T_Base_Book();
            List <Book.Model.T_Base_Book> list = bll.GetList(PageNumber, PageSize, Query);
            int count = bll.GetCount(Query);

            return(Json(new { total = count, rows = list }));
        }
Exemplo n.º 7
0
 public ActionResult Update(int Id)
 {
     Book.BLL.T_Base_Book   bll = new BLL.T_Base_Book();
     Book.Model.T_Base_Book book;
     book         = bll.GetModal(Id);
     ViewBag.book = book;
     return(View());
 }
Exemplo n.º 8
0
        public JsonResult GetSearch2(string SN)
        {
            // Name = Name.Trim();
            Book.BLL.T_Base_Book          bll = new BLL.T_Base_Book();
            List <Book.Model.T_Base_Book> lst = bll.GetSearch2(SN);//new List<Model.T_Base_Book>();

            return(Json(lst));
        }
Exemplo n.º 9
0
 // GET: Book
 public ActionResult Index()
 {
     Book.BLL.T_Base_Book        bll  = new BLL.T_Base_Book();
     Book.Model.T_Base_Book_Page page = bll.GetListPage(1, PageSize);
     ViewBag.MaxPageIndex = MaxPageIndex;
     ViewBag.PageSize     = PageSize;
     ViewBag.lst          = page.list;
     ViewBag.count        = page.count;
     return(View());
 }
Exemplo n.º 10
0
        public JsonResult GetList(int currentPage, String BookName = "", String Author = "")
        {
            Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
            //List<Book.Model.T_Base_Book> lst = bll.GetAll();
            List <Book.Model.T_Base_Book> lst = bll.GetList(currentPage, PageSize, BookName, Author);

            //json(new { lst, count });
            int c = bll.GetCount(BookName, Author);

            return(Json(new { count = c, result = Json(lst) }));
        }
Exemplo n.º 11
0
 public ActionResult AddSave(string BookName, string Author, string PressName, string SN, int Version, decimal Price)
 {
     Book.Model.T_Base_Book book = new Model.T_Base_Book();
     book.Author    = Author;
     book.BookName  = BookName;
     book.PressName = PressName;
     book.Price     = Price;
     book.SN        = SN;
     book.Version   = Version;
     Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
     bll.Add(book);
     return(Redirect("Index"));
 }
Exemplo n.º 12
0
        public ActionResult Index(String BookName = "", String Author = "")
        {
            Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();

            Book.Model.T_Base_Book_Page page = bll.GetListPage(1, PageSize, BookName, Author);
            //List<Book.Model.T_Base_Book> lst = bll.GetAll();
            ViewBag.MaxPageIndex = MaxPageIndex;

            ViewBag.PageSize = PageSize;

            ViewBag.BookName = BookName;
            ViewBag.Author   = Author;

            ViewBag.lst   = page.list;
            ViewBag.count = page.count;


            return(View());
        }
Exemplo n.º 13
0
        public ActionResult Index()
        {
            Book.BLL.T_Base_Admin admin = new BLL.T_Base_Admin();
            ViewBag.admin = admin.GetCount();

            Book.BLL.T_Base_Book book = new BLL.T_Base_Book();
            ViewBag.book = book.GetCount();

            Book.BLL.T_Base_Provider provider = new BLL.T_Base_Provider();
            ViewBag.provider = provider.GetCount();

            Book.BLL.T_Base_Customer customer = new BLL.T_Base_Customer();
            ViewBag.customer = provider.GetCount();

            Book.BLL.T_Stock_Report stock = new BLL.T_Stock_Report();
            ViewBag.stock = stock.GetCount();


            return(View());
        }
Exemplo n.º 14
0
        public JsonResult DeleteJson(int Id)
        {
            Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
            int result = bll.Delete(Id);

            Book.Model.Message msg;
            if (result > 0)
            {
                msg = new Book.Model.Message()
                {
                    Code = 200, Content = "删除成功"
                };
            }
            else
            {
                msg = new Book.Model.Message()
                {
                    Code = 500, Content = "删除失败"
                };
            }
            return(Json(msg));
        }
Exemplo n.º 15
0
 public JsonResult GetSearch(string query, int mathCount)
 {
     BLL.T_Base_Book bll = new BLL.T_Base_Book();
     return(Json(bll.GetSearch(query, mathCount)));
 }
Exemplo n.º 16
0
 public JsonResult Delete(string[] Ids)
 {
     Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
     return(Json(bll.Delete(Ids)));
 }
Exemplo n.º 17
0
 public ActionResult Alter(int Id)
 {
     Book.BLL.T_Base_Book bll = new BLL.T_Base_Book();
     ViewBag.book = bll.Alter(Id);
     return(View());
 }