public ActionResult AddHinhAnhOnEdit(Post post, String LinkAnh, int id) { Post post_model = (Post)TempData["Post" + id]; post = post_model; post_model.AddHinhAnh(LinkAnh); TempData["Post" + id] = post_model; return RedirectToAction("EditAlbum",new{id = id}); }
public ActionResult AddTheLoai(Post post, string TheLoaiList) { post = (Post)TempData["Post"]; post.AddTheLoai(TheLoaiList); TempData["post"] = post; return RedirectToAction("AddTheLoai"); }
public ActionResult AddHinhAnh(Post post, string LinkAnh) { post = (Post)TempData["Post"]; post.AddHinhAnh(LinkAnh); TempData["post"] = post; return RedirectToAction("AddHinhAnh"); }
public ActionResult AddTheLoaiOnEdit(Post post, String TheLoaiList, int id) { Post post_model = (Post)TempData["Post" +id]; post = post_model; post_model.AddTheLoai(TheLoaiList); TempData["Post" + id] = post_model; return RedirectToAction("EditTheLoai", new {id = id }); }
public ActionResult RemoveTheLoaiOnEdit(Post post, String Ma_the_loai, int id) { Post post_model = (Post)TempData["Post" + id]; post = post_model; post_model.TheLoai.Remove(Ma_the_loai); TempData["Post" + id] = post_model; return RedirectToAction("EditTheLoai", new {id=id }); }
// public ActionResult RemoveTheLoaiOnCreate(Post post, String Ma_the_loai) { post = (Post)TempData["Post"]; post.TheLoai.Remove(Ma_the_loai); TempData["post"] = post; return RedirectToAction("AddTheLoai"); }
// public ActionResult RemoveHinhAnhOnCreate(Post post, String Duong_dan) { post = (Post)TempData["Post"]; post.AlbumAnh.Remove(Duong_dan); TempData["post"] = post; return RedirectToAction("AddHinhAnh"); }
//[HttpPost] public ActionResult FinishEditAlbumAnh(Post post, int id) { Post post_model = (Post)TempData["Post" + id]; post = post_model; PostBLL.DeleteHinhAnh(post_model.MaBaiPost); PostBLL.AddHinhAnh(PostBLL.GetPost(post_model.MaBaiPost), post_model.AlbumAnh); TempData["Post" + id] = null; return RedirectToAction("Details", "Post", new { id = post_model.MaBaiPost }); }
//[HttpPost] public ActionResult FinishEditTheLoai(Post post, int id) { Post post_model = (Post)TempData["Post" + id]; post = post_model; PostBLL.DeleteTheLoai(post_model.MaBaiPost); PostBLL.AddTheLoai(PostBLL.GetPost(post_model.MaBaiPost), post_model.TheLoai); TempData["Post" + id] = null; return RedirectToAction("Details", "Post", new { id = post_model.MaBaiPost }); }
// public ActionResult FinishCreatePost(Post post) { post = (Post)TempData["Post"]; MembershipUser user = Membership.GetUser(User.Identity.Name); PostBLL.CreatePost(user.ProviderUserKey, post.TenBaiPost, post.NoiDung, post.NamSanXuat, post.DaoDien, post.DienVien, post.LinkTrailer, post.LinkDownLoad, post.DiemDanhGia, post.AnhDaiDien,post.TheLoai,post.AlbumAnh, post.MaQuocGia); return RedirectToAction("Index"); }
public ActionResult EditTheLoai(int id = 0) { Post post_model; if (TempData["Post"+id] == null) { post_model = new Post(); post_model.TheLoai = new List<string>(); List<POST_THELOAI> ds = PostBLL.GetPost(id).POST_THELOAI.ToList(); foreach (POST_THELOAI tl in ds) { String item = tl.Ma_the_loai; post_model.TheLoai.Add(item); } post_model.MaBaiPost = id; post_model.TenBaiPost = PostBLL.GetPost(id).Ten_bai_post; } else { post_model = (Post)TempData["Post" + id]; } // List<THELOAI> ds_tl = TheLoaiBLL.GetList(); List<SelectListItem> THELOAI_LISTITEM = new List<SelectListItem>(); foreach (THELOAI tl in ds_tl) { SelectListItem item = new SelectListItem(); item.Value = tl.Ma_the_loai; item.Text = tl.Ten_the_loai; THELOAI_LISTITEM.Add(item); } SelectList DSTheLoai = new SelectList(THELOAI_LISTITEM, "Value", "Text"); ViewBag.TheLoaiList = DSTheLoai; // TempData["Post" + id] = post_model; return View(post_model); }
// public ActionResult EditAlbum(int id = 0) { Post post_model; if (TempData["Post" + id] == null) { post_model = new Post(); post_model.AlbumAnh = new List<string>(); List<POST_HINHANH> ds = PostBLL.GetPost(id).POST_HINHANH.ToList(); foreach (POST_HINHANH tl in ds) { String item = tl.Duong_dan; post_model.AlbumAnh.Add(item); } post_model.MaBaiPost = id; post_model.TenBaiPost = PostBLL.GetPost(id).Ten_bai_post; } else { post_model = (Post)TempData["Post" + id]; } // // TempData["Post" + id] = post_model; return View(post_model); }
// GET: /Post/Edit/5 public ActionResult Edit(int id = 0) { POST post = PostBLL.GetPost(id); Post post_model = new Post(); post_model.SetData(post.Ten_bai_post, post.Mo_ta, post.Nam_san_xuat.Value, post.Dao_dien, post.Dien_vien, post.Trailer_link, post.Download_link, post.Diem_danh_gia.Value, post.Anh_dai_dienn, post.POST_QUOCGIA.ToList()[0].Ma_quoc_gia); post_model.MaBaiPost = post.Ma_bai_post; if (post == null) { return HttpNotFound(); } // List<QUOCGIA> ds_qg = QuocGiaBLL.GetList(); List<SelectListItem> qg_list_item = new List<SelectListItem>(); foreach (QUOCGIA qg in ds_qg) { SelectListItem item = new SelectListItem(); item.Value = qg.Ma_quoc_gia; item.Text = qg.Ten_quoc_gia; qg_list_item.Add(item); } SelectList list = new SelectList(qg_list_item, "Value", "Text"); ViewBag.QuocGiaList = list; // return View(post_model); }
public ActionResult Create(String TenBaiPost, String NoiDung, DateTime NamSanXuat, String DaoDien, String DienVien, String LinkTrailer, String LinkDownLoad, double DiemDanhGia, String AnhDaiDien, String MaQuocGia) { //MembershipUser user = Membership.GetUser(User.Identity.Name); //PostBLL.CreatePost(user.ProviderUserKey, TenBaiPost, NoiDung, NamSanXuat, DaoDien, DienVien, LinkTrailer, LinkDownLoad, DiemDanhGia, AnhDaiDien); Post post = new Post(); post.SetData(TenBaiPost, NoiDung, NamSanXuat, DaoDien, DienVien, LinkTrailer, LinkDownLoad, DiemDanhGia, AnhDaiDien,MaQuocGia); TempData["post"] = post; return RedirectToAction("AddTheLoai", "Post"); }