예제 #1
0
        public bool Update(SANPHAM sp)
        {
            var product    = db.SANPHAMs.Find(sp.Id);
            int categoryID = new DANHMUCBLL().GetIDByName(sp.CategoryName);

            product.Name         = sp.Name;
            product.Description  = sp.Description;
            product.Price        = sp.Price;
            product.CategoryName = sp.CategoryName;
            product.ImageName    = sp.ImageName;
            product.MetaTitle    = sp.MetaTitle;
            product.CreateDays   = DateTime.Now;
            product.CategoryID   = categoryID;
            db.SaveChanges();
            return(true);
        }
예제 #2
0
 public bool xoasp(SANPHAM n)
 {
     return(sp.xoa(n));
 }
예제 #3
0
 public bool suasp(SANPHAM n)
 {
     return(sp.sua(n));
 }
예제 #4
0
 public bool themsp(SANPHAM n)
 {
     return(sp.them(n));
 }
예제 #5
0
 public bool ktkc_sp(SANPHAM n)
 {
     return(sp.ktkc(n));
 }
예제 #6
0
 public int Insert(SANPHAM sp)
 {
     db.SANPHAMs.Add(sp);
     db.SaveChanges();
     return(sp.Id);
 }