Ejemplo n.º 1
0
        public string LayChiTietSanPham()
        {
            CHITIETSANPHAM ctSp     = db.CHITIETSANPHAMs.Single(r => r.MaSP == MaSP);
            MULTIMEDIA     mul      = db.MULTIMEDIAs.Single(item => item.MaCTSP == ctSp.MaCTSP);
            string         filePath = mul.Multimedia1;

            filePath = HttpContext.Current.Server.MapPath(mul.Multimedia1);
            return(filePath);
        }
Ejemplo n.º 2
0
        public ActionResult Create(CHITIETSANPHAM chitietsanpham)
        {
            if (ModelState.IsValid)
            {
                db.CHITIETSANPHAMs.Add(chitietsanpham);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.MaSP = new SelectList(db.SANPHAMs, "MaSP", "MaLoaiSP", chitietsanpham.MaSP);
            return View(chitietsanpham);
        }
Ejemplo n.º 3
0
 public ActionResult Edit(CHITIETSANPHAM chitietsanpham)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chitietsanpham).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.MaSP = new SelectList(db.SANPHAMs, "MaSP", "MaLoaiSP", chitietsanpham.MaSP);
     return View(chitietsanpham);
 }