public virtual CustomerGiftRegistrySearches UpdateCustomerGiftRegistrySearches(CustomerGiftRegistrySearches entity)
        {
            if (entity.IsTransient())
            {
                return(entity);
            }
            CustomerGiftRegistrySearches other = GetCustomerGiftRegistrySearches(entity.CustomerGiftRegistrySearchesId);

            if (entity.Equals(other))
            {
                return(entity);
            }
            string sql = @"Update CustomerGiftRegistrySearches set  [CustomerGiftRegistrySearchesGUID]=@CustomerGiftRegistrySearchesGUID
							, [CustomerID]=@CustomerID
							, [GiftRegistryGUID]=@GiftRegistryGUID
							, [CreatedOn]=@CreatedOn 
							 where CustomerGiftRegistrySearchesID=@CustomerGiftRegistrySearchesID"                            ;

            SqlParameter[] parameterArray = new SqlParameter[] {
                new SqlParameter("@CustomerGiftRegistrySearchesID", entity.CustomerGiftRegistrySearchesId)
                , new SqlParameter("@CustomerGiftRegistrySearchesGUID", entity.CustomerGiftRegistrySearchesGuid)
                , new SqlParameter("@CustomerID", entity.CustomerId)
                , new SqlParameter("@GiftRegistryGUID", entity.GiftRegistryGuid)
                , new SqlParameter("@CreatedOn", entity.CreatedOn)
            };
            SqlHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql, parameterArray);
            return(GetCustomerGiftRegistrySearches(entity.CustomerGiftRegistrySearchesId));
        }
        public virtual CustomerGiftRegistrySearches InsertCustomerGiftRegistrySearches(CustomerGiftRegistrySearches entity)
        {
            CustomerGiftRegistrySearches other = new CustomerGiftRegistrySearches();

            other = entity;
            if (entity.IsTransient())
            {
                string         sql            = @"Insert into CustomerGiftRegistrySearches ( [CustomerGiftRegistrySearchesGUID]
				,[CustomerID]
				,[GiftRegistryGUID]
				,[CreatedOn] )
				Values
				( @CustomerGiftRegistrySearchesGUID
				, @CustomerID
				, @GiftRegistryGUID
				, @CreatedOn );
				Select scope_identity()"                ;
                SqlParameter[] parameterArray = new SqlParameter[] {
                    new SqlParameter("@CustomerGiftRegistrySearchesID", entity.CustomerGiftRegistrySearchesId)
                    , new SqlParameter("@CustomerGiftRegistrySearchesGUID", entity.CustomerGiftRegistrySearchesGuid)
                    , new SqlParameter("@CustomerID", entity.CustomerId)
                    , new SqlParameter("@GiftRegistryGUID", entity.GiftRegistryGuid)
                    , new SqlParameter("@CreatedOn", entity.CreatedOn)
                };
                var identity = SqlHelper.ExecuteScalar(this.ConnectionString, CommandType.Text, sql, parameterArray);
                if (identity == DBNull.Value)
                {
                    throw new DataException("Identity column was null as a result of the insert operation.");
                }
                return(GetCustomerGiftRegistrySearches(Convert.ToInt32(identity)));
            }
            return(entity);
        }
        public virtual CustomerGiftRegistrySearches CustomerGiftRegistrySearchesFromDataRow(DataRow dr)
        {
            if (dr == null)
            {
                return(null);
            }
            CustomerGiftRegistrySearches entity = new CustomerGiftRegistrySearches();

            entity.CustomerGiftRegistrySearchesId   = (System.Int32)dr["CustomerGiftRegistrySearchesID"];
            entity.CustomerGiftRegistrySearchesGuid = (System.Guid)dr["CustomerGiftRegistrySearchesGUID"];
            entity.CustomerId       = (System.Int32)dr["CustomerID"];
            entity.GiftRegistryGuid = (System.Guid)dr["GiftRegistryGUID"];
            entity.CreatedOn        = (System.DateTime)dr["CreatedOn"];
            return(entity);
        }
 public virtual CustomerGiftRegistrySearches DeleteCustomerGiftRegistrySearches(CustomerGiftRegistrySearches entity)
 {
     this.DeleteCustomerGiftRegistrySearches(entity.CustomerGiftRegistrySearchesId);
     return(entity);
 }
Ejemplo n.º 5
0
 public CustomerGiftRegistrySearches InsertCustomerGiftRegistrySearches(CustomerGiftRegistrySearches entity)
 {
     return(_iCustomerGiftRegistrySearchesRepository.InsertCustomerGiftRegistrySearches(entity));
 }
Ejemplo n.º 6
0
 public CustomerGiftRegistrySearches UpdateCustomerGiftRegistrySearches(CustomerGiftRegistrySearches entity)
 {
     return(_iCustomerGiftRegistrySearchesRepository.UpdateCustomerGiftRegistrySearches(entity));
 }