Exemplo n.º 1
0
        public ActionResult Move(int page = 1, int pageSize = 5, int id = 1)
        {
            var dao   = new AudioDao();
            var model = dao.ListLevelPaging(page, pageSize, id);

            return(View(model));
        }
Exemplo n.º 2
0
        // GET: Audios
        public ActionResult Index(string searchString, int page = 1, int pageSize = 3)
        {
            var dao   = new AudioDao();
            var model = dao.ListAllPaging(searchString, page, pageSize);

            ViewBag.SearchString = searchString;

            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult Upload()
        {
            HttpPostedFileBase file      = Request.Files["audio"];
            string             filePath  = string.Empty;
            string             fileName  = DateTime.Now.ToString("yyyy-MM-dd_hhmmsss");
            string             audioName = fileName + Path.GetExtension(file.FileName);

            filePath = Path.Combine(HttpContext.Server.MapPath("~/Uploads/"), audioName);
            file.SaveAs(filePath);
            AudioDao.AddItem(new AudioItem(fileName, "/Uploads/" + audioName));
            return(Json(new { status = 1, msg = "上传成功!" }));
        }
Exemplo n.º 4
0
        public ActionResult GetDatas()
        {
            List <AudioItem> list = AudioDao.GetAllItems();

            return(Json(new { status = 1, msg = $"共{list.Count}首歌曲", data = list }, JsonRequestBehavior.AllowGet));
        }