public void DeleteAbonent(Abonent possibleUser) { Data.SQLCommand( "DELETE FROM [dbo].[PossibleUsers] WHERE [IdPossibleUsers]=@IdPossibleUsers" ); Data.sqlCommand.Parameters.Add("@IdPossibleUsers", SqlDbType.UniqueIdentifier).Value = possibleUser.IdPossibleUsers; Data.ConnectionOpen(); Data.sqlCommand.ExecuteNonQuery(); Data.ConnectionClose(); }
public void AddAbonent(Abonent abonent) { Data.SQLCommand( "INSERT INTO [dbo].[PossibleUsers] ([ServiceName], " + "[IdPossibleUsers], [PhoneNumber]) " + "Values(@ServiceName, @IdPossibleUsers, " + "@PhoneNumber)"); Data.sqlCommand.Parameters.Add("@ServiceName", SqlDbType.VarChar).Value = abonent.ServiceName; Data.sqlCommand.Parameters.Add("@IdPossibleUsers", SqlDbType.UniqueIdentifier).Value = abonent.IdPossibleUsers; Data.sqlCommand.Parameters.Add("@PhoneNumber", SqlDbType.BigInt).Value = abonent.PhoneNumber; Data.ConnectionOpen(); Data.sqlCommand.ExecuteNonQuery(); Data.ConnectionClose(); }