Beispiel #1
0
    public Int64 SaveProspectCustomerData(string prospectCustomerId, string fieldName, string value)
    {
        OtherDAL otherDal = new OtherDAL();
        long     savedProspectCustomerId = otherDal.SaveProspectCustomerData(Convert.ToInt32(prospectCustomerId), fieldName, value);

        // If this is a new prospect customer, track this conversion.
        if (prospectCustomerId.Equals("0"))
        {
            long clickId = 0;

            HttpCookie clickIdCookie = Context.Request.Cookies["advertiserClick"];
            if (clickIdCookie != null)
            {
                long.TryParse(clickIdCookie.Value, out clickId);
            }

            // if there's a click ID, save which click caused the conversion to a prospective customer, and their prospect ID
            if (clickId > 0)
            {
                IClickConversionRepository ccr = new ClickConversionRepository();
                ccr.SaveProspectConversion(clickId, savedProspectCustomerId);
            }
        }

        return(savedProspectCustomerId);
    }
Beispiel #2
0
    public ProspectCustomer SaveProspectCustomer(ProspectCustomer prospectCustomer)
    {
        long prospectCustomerId = prospectCustomer.Id;

        if (prospectCustomer.Id > 0 && prospectCustomer.CreatedOn == DateTime.MinValue)
        {
            prospectCustomer.CreatedOn = DateTime.Now;
        }
        prospectCustomer = _uniqueItemRepository.Save(prospectCustomer);

        // If this is a new prospect customer, track this conversion.)
        if (prospectCustomerId == 0)
        {
            long clickId = 0;

            HttpCookie clickIdCookie = Context.Request.Cookies["advertiserClick"];
            if (clickIdCookie != null)
            {
                long.TryParse(clickIdCookie.Value, out clickId);
            }

            // if there's a click ID, save which click caused the conversion to a prospective customer, and their prospect ID
            if (clickId > 0)
            {
                IClickConversionRepository clickConversionRepository = new ClickConversionRepository();
                clickConversionRepository.SaveProspectConversion(clickId, prospectCustomer.Id);
            }
        }
        return(prospectCustomer);
    }