public int update(HopDongEntities obj) { int result = 0; string strQuery = "update dbo.HopDong set TenHD='" + obj.Tenhd + "',NgayKiKet='" + obj.Ngaykiket + "',NgayHetHan='" + obj.Ngayhethan + "' where MaHD='" + obj.Mahd + "'"; DataConfig config = new DataConfig(); result = config.excuteNonquery(strQuery); //thucthi return(result); //tra ve so ban ghi }
public int Insert(HopDongEntities obj) { int result = 0; string strQuery = "insert into dbo.HopDong(MaHD,TenHD,NgayKiKet,NgayHetHan) values('" + obj.Mahd + "','" + obj.Tenhd + "','" + obj.Ngaykiket + "','" + obj.Ngayhethan + "')"; DataConfig config = new DataConfig(); result = config.excuteNonquery(strQuery); //thucthi return(result); //tra ve so ban ghi }