public int update(KhenThuongEntities obj) { int result = 0; string strQuery = "update dbo.KhenThuong set HinhThucKT='" + obj.Hinhthuckhenthuong + "',LyDo='" + obj.Lydokhenthuong + "' where MaKT='" + obj.Makhenthuong + "'"; DataConfig config = new DataConfig(); result = config.excuteNonquery(strQuery); return(result); }
//them csdl public int insert(KhenThuongEntities obj) { int result = 0; string strQuery = "Insert into dbo.KhenThuong(MaKT,hinhThucKT,LyDo) values ('" + obj.Makhenthuong + "','" + obj.Hinhthuckhenthuong + "','" + obj.Lydokhenthuong + "')"; DataConfig config = new DataConfig(); //khoi tao result = config.excuteNonquery(strQuery); //thuc thi cau lenh return(result); //tra ve so ban ghi dc them }