Пример #1
0
        public static void UpdateSach(int idSach, string tenSach, int idTheLoai, int idTacGia, int namXuatBan, string nxb, DateTime ngayNhap,
                                      double triGia, bool tinhTrang)
        {
            SACH sach = db.SACHes.Find(idSach);

            sach.TenSach    = tenSach;
            sach.IDTheLoai  = idTheLoai;
            sach.IDTacGia   = idTacGia;
            sach.NamXuatBan = namXuatBan;
            sach.NhaXuatBan = nxb;
            sach.NgayNhap   = ngayNhap;
            sach.TriGia     = triGia;
            sach.TinhTrang  = tinhTrang;
            db.SaveChanges();
        }