Ejemplo n.º 1
0
 public RecipientProfile(RecipientProfile profile)
 {
     this.Name         = profile.Name;
     this.AddressLine1 = profile.AddressLine1;
     this.AddressLine2 = profile.AddressLine2;
     this.City         = profile.City;
     this.State        = profile.State;
     this.AreaCode     = profile.AreaCode;
     this.CountryId    = profile.CountryId;
 }
Ejemplo n.º 2
0
        private SentItem CreateSentItem(LockedTemplate template, RecipientProfile profile)
        {
            SentItem sentItem = new SentItem();

            // Deep copy the relevant profile into a new profile
            sentItem.RecipientProfile = new RecipientProfile(profile);

            // Lock the profiles as a sent item so it cannot be modified
            sentItem.RecipientProfile.IsProfileLocked = true;

            // Parse the template with profile info
            TemplateParser parser = new TemplateParser();

            sentItem.FrontHtml  = parser.ParseTemplate(template.FrontHtml, profile);
            sentItem.BackHtml   = parser.ParseTemplate(template.BackHtml, profile);
            sentItem.ItemTypeId = template.ItemTypeId;

            // Get the price of the mail item
            sentItem.LockedInPrice = this.Prices.Where(p => p.CountryId == profile.CountryId && p.ItemTypeId == template.ItemTypeId).FirstOrDefault().Ammount;

            return(sentItem);
        }