public ActionResult ChuDe(long idCD) { var cd = new ChuDeDAO(); Session["Title"] = cd.Find(idCD).Ten; var sach = new SachDAO(); Session["Products"] = sach.GetListCD(idCD); return(View("../DanhSachSanPham/Index")); }
public void FindTest()// lay ra 1 doi tuong va so sanh ten { ChuDe test = new ChuDe(); test.IdChuDe = 3; test.Ten = "CDtest3"; test.XuatXu = "In"; test.flag = true; Assert.AreEqual(test.Ten, dao.Find(3).Ten); }
public ActionResult Update(long idChuDe) { var tk = Session["TaiKhoan"] as KhachHang; if (tk == null) { return(View("../Login/Index")); } else { if (tk.LoaiTK != "Admin") { return(View("../Home/Index")); } else { var db = new ChuDeDAO(); Session["UpdateCD"] = db.Find(idChuDe); return(View("Index")); } } }