//Hàm xoá public JsonResult DeleteMusic(int?id) { var dao = new MusicsDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <MusicsList> musics = db.MusicsLists.Where(n => n.music_bin == true).OrderBy(n => n.music_name).ToList(); List <jMusics> list = musics.Select(n => new jMusics { music_name = n.music_name, music_active = n.music_active, music_bin = n.music_bin, music_datecreate = n.music_datecreate.Value.ToString("dd/MM/yyyy"), music_dateedit = n.music_dateedit.Value.ToString("dd/MM/yyyy"), music_dowload = n.music_dowload, music_id = n.music_id, music_img = n.music_img, music_linkdow = n.music_linkdow, music_love = n.music_love, music_lyric = n.music_lyric, music_option = n.music_option, music_time = n.music_time, music_view = n.music_view, nation_id = n.nation_id, user_id = n.user_id, nationname = n.National.nation_name }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
//Hàm xoá public JsonResult DeleteNation(int?id) { var dao = new NationsDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <National> nationals = db.Nationals.Where(n => n.nation_bin == true).OrderBy(n => n.nation_name).ToList(); List <jNations> list = nationals.Select(n => new jNations { nation_active = n.nation_active, nation_bin = n.nation_bin, nation_id = n.nation_id, nation_name = n.nation_name, nation_datecreate = n.nation_datecreate.Value.ToString("dd/MM/yyyy"), nation_dateupdate = n.nation_dateupdate.Value.ToString("dd/MM/yyyy"), nation_option = n.nation_option }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
//Hàm xoá public JsonResult DeleteAuthor(int?id) { var dao = new AuthorsDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <Author> authors = db.Authors.Where(n => n.author_bin == true).OrderBy(n => n.author_name).ToList(); List <jAuthors> list = authors.Select(n => new jAuthors { author_active = n.author_active, author_bin = n.author_bin, author_id = n.author_id, author_name = n.author_name, author_note = n.author_note, user_id = n.user_id, author_datecreate = n.author_datecreate.Value.ToString("dd/MM/yyyy"), author_dateupdate = n.author_dateupdate.Value.ToString("dd/MM/yyyy"), author_img = n.author_img, author_option = n.author_option }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
public ActionResult Add(Package package, HttpPostedFileBase IMG, string del) { //Cập nhật có thay đổi package.package_option = true; package.package_pin = false; //Kiem tra thay đổi value if (package.package_active != true && package.package_active != false) { package.package_active = false; } var dao = new PackagesDAO(); var j = new JsonAdminController(); if (dao.Add(package)) { return(Redirect("/Admin/PackagesAdmin")); } else { return(Redirect(Common.Link.NOT_404)); } }
//Hàm xoá public JsonResult DeletePackage(int?id) { var dao = new PackagesDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <Package> packages = db.Packages.Where(n => n.package_pin == true).OrderBy(n => n.package_name).ToList(); List <jPackages> list = packages.Select(n => new jPackages { package_active = n.package_active, package_name = n.package_name, package_content = n.package_content, package_datecreate = n.package_datecreate.Value.ToString("dd/MM/yyyy"), package_id = n.package_id, package_money = n.package_money, package_option = n.package_option, package_pin = n.package_pin, pakage_price = n.pakage_price }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
//Hàm xoá public JsonResult DeleteAlbum(int?id) { var dao = new AlbumsDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <Album> albums = db.Albums.Where(n => n.album_bin == true).OrderBy(n => n.album_name).ToList(); List <jAlbums> list = albums.Select(n => new jAlbums { album_active = n.album_active, album_name = n.album_name, album_bin = n.album_bin, album_datecreate = n.album_datecreate.Value.ToString("dd/MM/yyyy"), album_dateedit = n.album_dateedit.Value.ToString("dd/MM/yyyy"), album_id = n.album_id, album_img = n.album_img, album_love = n.album_love, album_note = n.album_note, album_view = n.album_view, album_option = n.album_option, user_id = n.user_id }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
//Hàm xoá public JsonResult DeleteCate(int?id) { var dao = new CategoriesDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <Category> categories = db.Categories.Where(n => n.category_bin == true).OrderBy(n => n.category_name).ToList(); List <jCategories> list = categories.Select(n => new jCategories { category_active = n.category_active, category_bin = n.category_bin, category_id = n.category_id, category_name = n.category_name, category_note = n.category_note, category_view = n.category_view, user_id = n.user_id, category_datecreate = n.category_datecreate.Value.ToString("dd/MM/yyyy"), category_dateupdate = n.category_dateupdate.Value.ToString("dd/MM/yyyy"), category_img = n.category_img, category_option = n.category_option }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
//Hàm xoá public JsonResult DeleteUser(int?id) { var dao = new UsersDAO(); var j = new JsonAdminController(); if (dao.Delete(id)) { List <User> users = db.Users.Where(n => n.user_bin == true).OrderBy(n => n.user_name).ToList(); List <jUsers> list = users.Select(n => new jUsers { user_active = n.user_active, user_bin = n.user_bin, user_code = n.user_code, user_datecreate = n.user_datecreate.Value.ToString("dd/MM/yyyy hh:mm:ss"), user_datelogin = n.user_datelogin.Value.ToString("dd/MM/yyyy hh:mm:ss"), user_deadline = n.user_deadline.Value.ToString("dd/MM/yyyy hh:mm:ss"), user_email = n.user_email, user_id = n.user_id, user_img = n.user_img, user_name = n.user_name, user_option = n.user_option, user_pass = n.user_pass, user_point = n.user_point, user_token = n.user_token }).ToList(); return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null)); } }
public ActionResult Add(MusicsList musics, HttpPostedFileBase IMG, HttpPostedFileBase MP3, string del) { //Cập nhật có thay đổi musics.music_option = true; musics.music_bin = false; //Kiem tra thay đổi value if (musics.music_active != true && musics.music_active != false) { musics.music_active = false; } //Hinh ảnh if (IMG != null) { var code = Guid.NewGuid().ToString(); var img = new ImagesController(); img.AddImages(IMG, Common.Link.IMG_MUSIC, code); musics.music_img = code + IMG.FileName; } else { musics.music_img = "notImg.png"; } //Nhạc if (MP3 != null) { var code = Guid.NewGuid().ToString(); var mp3 = new ImagesController(); mp3.AddMP3(MP3, Common.Link.MP3_MUSIC, code); musics.music_linkdow = code + MP3.FileName; } else { musics.music_linkdow = "NULL"; } var dao = new MusicsDAO(); var j = new JsonAdminController(); if (dao.Add(musics)) { return(Redirect("/Admin/MusicsListAdmin")); } else { return(Redirect(Common.Link.NOT_404)); } }
public ActionResult Add(National national, HttpPostedFileBase IMG, string del) { //Cập nhật có thay đổi national.nation_option = true; national.nation_bin = false; //Kiem tra thay đổi value if (national.nation_active != true && national.nation_active != false) { national.nation_active = false; } ////Hinh ảnh //if (IMG != null) //{ // var code = Guid.NewGuid().ToString(); // var img = new ImagesController(); // img.AddImages(IMG, Common.Link.IMG_AUTHOR, code); // national.nation_img = code + IMG.FileName; //} //else //{ // national.nation_img = "notImg.png"; //} var dao = new NationsDAO(); var j = new JsonAdminController(); if (dao.Add(national)) { return(Redirect("/Admin/NationsAdmin")); } else { return(Redirect(Common.Link.NOT_404)); } }
public ActionResult Add(Author author, HttpPostedFileBase IMG, string del) { //Cập nhật có thay đổi author.author_option = true; author.author_bin = false; //Kiem tra thay đổi value if (author.author_active != true && author.author_active != false) { author.author_active = false; } //Hinh ảnh if (IMG != null) { var code = Guid.NewGuid().ToString(); var img = new ImagesController(); img.AddImages(IMG, Common.Link.IMG_AUTHOR, code); author.author_img = code + IMG.FileName; } else { author.author_img = "notImg.png"; } var dao = new AuthorsDAO(); var j = new JsonAdminController(); if (dao.Add(author)) { return(Redirect("/Admin/AuthorsAdmin")); } else { return(Redirect(Common.Link.NOT_404)); } }
public ActionResult Add(Category category, HttpPostedFileBase IMG, string del) { //Cập nhật có thay đổi category.category_option = true; category.category_bin = false; //Kiem tra thay đổi value if (category.category_active != true && category.category_active != false) { category.category_active = false; } //Hinh ảnh if (IMG != null) { var code = Guid.NewGuid().ToString(); var img = new ImagesController(); img.AddImages(IMG, Common.Link.IMG_CATEGORY, code); category.category_img = code + IMG.FileName; } else { category.category_img = "notImg.png"; } var dao = new CategoriesDAO(); var j = new JsonAdminController(); if (dao.ADD(category)) { return(Redirect("/Admin/CategoriesAdmin")); } else { return(Redirect(Common.Link.NOT_404)); } }