Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }