Ejemplo n.º 1
0
 public int CreateAdMedia(AdMediaEntity adMediaEntity)
 {
     using (var scope = new TransactionScope())
     {
         var adMedia = new AdMedia()
         {
             id          = adMediaEntity.id,
             name        = adMediaEntity.name,
             description = adMediaEntity.description
         };
         _unitOfWork.AdMediaRepository.Insert(adMedia);
         _unitOfWork.Save();
         scope.Complete();
         return(adMedia.id);
     }
 }
Ejemplo n.º 2
0
    public AdPage(Dictionary<string, object> data)
    {
        type = PageTypeFromString(data["type"] as string);
        title = data["title"] as string;
        if (data.ContainsKey("audio"))
            audio = new AdMedia(data["audio"] as Dictionary<string, object>);
        else
            audio = null;
        foreach (Dictionary<string, object> part in data["parts"] as List<object>)
        {
            AdMedia med = new AdMedia(part);
            parts.Add(med);
        }
        foreach (Dictionary<string, object> part in data["text"] as List<object>)
        {
            AdMarkup mar = new AdMarkup(part);
            text.Add(mar);
        }
        narrative = data["narrative"] as string;
        more = null;
        if (data.ContainsKey("more") && ((data["more"] as Dictionary<string, object>)["title"] as string) != "")
            more = new AdPage(data["more"] as Dictionary<string, object>);
        else
            more = null;

        expert = new AdMedia(data["expert"] as Dictionary<string, object>);
        background = new AdBackground(data["background"] as Dictionary<string, object>);
        font = data["font"] as string;
    }
Ejemplo n.º 3
0
 public AdData(Dictionary<string, object> ad)
 {
     background = new AdBackground(ad["background"] as Dictionary<string, object>);
     expert = new AdMedia(ad["expert"] as Dictionary<string, object>);
     font = ad["font"] as string;
     version = Convert.ToInt32(ad["version"]);
     pages = new List<AdPage>();
     if (((ad["megadeal"] as Dictionary<string, object>)["title"] as string) != "")
         mega = new AdMegaDeal(ad["megadeal"] as Dictionary<string, object>);
     foreach (Dictionary<string, object> page in ad["pages"] as List<object>)
     {
         if ((page["title"] as string) != "")
         {
             AdPage curPage = new AdPage(page);
             pages.Add(curPage);
         }
     }
 }