public void Update_ThanhTien(string MaNhap) { NhapSach nhapSach = new NhapSach(); nhapSach = data.NhapSaches.SingleOrDefault(u => u.MaNhap == MaNhap); nhapSach.ThanhTien = TinhThanhTien(MaNhap); }
public bool _NhapSach(NhapSachDTO nhapSachDTO) { try { NhapSach nhapSach = new NhapSach(); nhapSach.MaNhap = nhapSachDTO.MaNhap; nhapSach.MaNV = nhapSachDTO.MaNV; nhapSach.NgayNhap = nhapSachDTO.NgayNhap; nhapSach.ThanhTien = 0; nhapSach.TrangThai = true; data.NhapSaches.Add(nhapSach); data.SaveChanges(); return(true); } catch (Exception) { return(false); } }