예제 #1
0
        // [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
        public ActionResult FetchData()
        {
            var albums = AlbumRepo.GetAlbums();

            return(Json(albums, JsonRequestBehavior.AllowGet));
            //return View(albums);
        }
예제 #2
0
        public ActionResult Index()
        {
            var        albums           = AlbumRepo.GetAlbums();
            HttpCookie _userInfoCookies = Request.Cookies["UserInfo"];

            if (_userInfoCookies != null)
            {
                string UserName = _userInfoCookies["UserName"].ToString();
            }
            return(View(albums));
        }
예제 #3
0
        public ActionResult Index(int?albumId, string albumName)
        {
            var albums = AlbumRepo.GetAlbums();

            if (!string.IsNullOrEmpty(albumName))
            {
                albums = albums.Where(a => a.Title.Contains(albumName)).ToList();
            }

            if (albumId.HasValue)
            {
                albums = albums.Where(a => a.AlbumId == albumId).ToList();
            }

            return(PartialView("_grid", albums));
        }
예제 #4
0
        public ActionResult Index(int?albumId, string albumName)
        {
            var albums = AlbumRepo.GetAlbums();

            if (Request.Form["btnSubmit"] != null)
            {
                if (!string.IsNullOrEmpty(albumName))
                {
                    albums = albums.Where(a => a.Title.Contains(albumName)).ToList();
                }

                if (albumId.HasValue)
                {
                    albums = albums.Where(a => a.AlbumId == albumId).ToList();
                }

                return(PartialView("_grid", albums));
            }
            else if (Request.Form["btnDelete"] != null)
            {
            }
            return(PartialView("_grid", albums));
        }
예제 #5
0
        public ActionResult deleteData(string dataToBeDeleted)
        {
            var albums = AlbumRepo.GetAlbums();

            //if (Request.Form["btnSubmit"] != null)
            //{
            //    if (!string.IsNullOrEmpty(albumName))
            //        albums = albums.Where(a => a.Title.Contains(albumName)).ToList();

            //    if (albumId.HasValue)
            //        albums = albums.Where(a => a.AlbumId == albumId).ToList();

            //    return PartialView("_grid", albums);
            //}
            if (Request.Form["data"] != null)
            {
                String[] dids = Request.Form["data"].Split(new char[] { ',' });
            }
            if (dataToBeDeleted != null)
            {
                String[] dids = dataToBeDeleted.Split(new char[] { ',' });
            }
            return(PartialView("_grid", albums));
        }
예제 #6
0
        //
        // GET: /Home/

        public ActionResult Index()
        {
            var albums = AlbumRepo.GetAlbums();

            return(View(albums));
        }