public bool Update(NHANSX nsx, int MaNSX) { getConnect(); string Sql = string.Format("UPDATE NhaNSX SET TenNSX= N'{1}' ,DiaChiNSX = N'{2}',DienThoaiNSX=N'{3}' WHERE MaNSX = {0}", MaNSX, nsx.TenNSX, nsx.DiaChiNSX, nsx.DienThoaiNSX); SqlCommand cmd = new SqlCommand(Sql, conn); int row = cmd.ExecuteNonQuery(); getDisconnect(); if (row > 0) { return(true); } return(false); }
public bool Insert(NHANSX nsx) { getConnect(); string Sql = string.Format("INSERT INTO NhaNSX(TenNSX,DiaChiNSX,DienThoaiNSX) " + "VALUES(N'{0}',N'{1}',N'{2}')", nsx.TenNSX, nsx.DiaChiNSX, nsx.DienThoaiNSX); SqlCommand cmd = new SqlCommand(Sql, conn); int row = cmd.ExecuteNonQuery(); getDisconnect(); if (row > 0) { return(true); } return(false); }
public bool Them(NHANSX nsx) { return(objdal.Insert(nsx)); }
public bool CapNhat(NHANSX nsx, int MaNSX) { return(objdal.Update(nsx, MaNSX)); }