public void FromDto(AffiliateReferralDTO dto) { if (dto == null) return; this.Id = dto.Id; this.StoreId = dto.StoreId; this.TimeOfReferralUtc = dto.TimeOfReferralUtc; this.AffiliateId = dto.AffiliateId; this.ReferrerUrl = dto.ReferrerUrl; }
//DTO public AffiliateReferralDTO ToDto() { AffiliateReferralDTO dto = new AffiliateReferralDTO(); dto.Id = this.Id; dto.StoreId = this.StoreId; dto.TimeOfReferralUtc = this.TimeOfReferralUtc; dto.AffiliateId = this.AffiliateId; dto.ReferrerUrl = this.ReferrerUrl; return dto; }
private void ImportAffiliateReferrals(int oldId, long newId) { wl(" - Migrating Referrals..."); data.bvc2004Entities db = new data.bvc2004Entities(EFConnString(settings.SourceConnectionString())); var referrals = db.bvc_Referral.Where(y => y.AffID == oldId); if (referrals == null) return; foreach (data.bvc_Referral r in referrals) { AffiliateReferralDTO rnew = new AffiliateReferralDTO(); rnew.AffiliateId = newId; rnew.TimeOfReferralUtc = r.TimeOfReferral; rnew.ReferrerUrl = r.ReferrerURL; Api bv6proxy = GetBV6Proxy(); var res = bv6proxy.AffiliateReferralsCreate(rnew); } }
private void ImportAffiliateReferrals(long oldId, long newId) { wl(" - Migrating Referrals..."); Api oldProxy = GetOldStoreBV6Proxy(); ApiResponse<List<AffiliateReferralDTO>> refs = oldProxy.AffiliateReferralsFindForAffiliate(oldId); if (refs == null) return; if (refs.Content == null) return; foreach (AffiliateReferralDTO r in refs.Content) { AffiliateReferralDTO rnew = new AffiliateReferralDTO(); rnew.AffiliateId = newId; rnew.TimeOfReferralUtc = r.TimeOfReferralUtc; rnew.ReferrerUrl = r.ReferrerUrl; Api bv6proxy = GetMerchantTribeProxy(); var res = bv6proxy.AffiliateReferralsCreate(rnew); } }
public ApiResponse<AffiliateReferralDTO> AffiliateReferralsCreate(AffiliateReferralDTO item) { ApiResponse<AffiliateReferralDTO> result = new ApiResponse<AffiliateReferralDTO>(); result = RestHelper.PostRequest<ApiResponse<AffiliateReferralDTO>>(this.fullApiUri + "affiliates/" + item.AffiliateId + "/referrals?key=" + Enc(key), MerchantTribe.Web.Json.ObjectToJson(item)); return result; }