public CustomerArtistINT LoadCustomerArtistINT(SqlDataReader dataReader)
        {
            CustomerArtistINT customerArtistINT = new CustomerArtistINT()
            {
                ArtistID   = dataReader.GetInt32(dataReader.GetOrdinal("ArtistID")),
                CustomerID = dataReader.GetInt32(dataReader.GetOrdinal("CustomerID"))
            };

            return(customerArtistINT);
        }
예제 #2
0
        public static CustomerArtistINT Convert(CustomerArtistINTDto customerArtistINTDto)
        {
            if (customerArtistINTDto == null)
            {
                return(null);
            }
            CustomerArtistINT customerArtistINT = new CustomerArtistINT()
            {
                ArtistID   = customerArtistINTDto.ArtistID.Id,
                CustomerID = customerArtistINTDto.CustomerID.Id
            };

            return(customerArtistINT);
        }
예제 #3
0
        public static CustomerArtistINTDto Convert(CustomerArtistINT customerArtistINT)
        {
            if (customerArtistINT == null)
            {
                return(null);
            }
            CustomerArtistINTDto customerArtistINTDto = new CustomerArtistINTDto()
            {
                ArtistID   = Convert(DaoFactory.GetArtistDao().Get(customerArtistINT.ArtistID)),
                CustomerID = Convert(DaoFactory.GetCustomerDao().Get(customerArtistINT.CustomerID))
            };

            return(customerArtistINTDto);
        }
 public void Add(CustomerArtistINT customerArtistINT)
 {
     using (var conn = GetConnection())
     {
         conn.Open();
         using (var cmd = conn.CreateCommand())
         {
             cmd.CommandText = "INSERT INTO Customer_Artist_INT(ArtistID, CustomerID) VALUES(@ArtistID, @CustomerID)";
             cmd.Parameters.AddWithValue("@ArtistID", customerArtistINT.ArtistID);
             cmd.Parameters.AddWithValue("@CustomerID", customerArtistINT.CustomerID);
             cmd.ExecuteNonQuery();
         }
     }
 }