-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
234 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace MediaMind.Course.Models | ||
{ | ||
public class Ad | ||
{ | ||
public virtual string Type | ||
{ | ||
get | ||
{ | ||
if (Data is VideoStripImageAdData) | ||
return "Video Strip Image"; | ||
if (Data is StandardBanner) | ||
return "Standard Banner"; | ||
|
||
return "no idea"; | ||
} | ||
} | ||
public virtual Campaign Campaign { get; set; } | ||
public virtual long Id { get; set; } | ||
public virtual string Name { get; set; } | ||
public virtual SharedAdData Data { get; set; } | ||
} | ||
|
||
public abstract class SharedAdData | ||
{ | ||
public virtual long Id { get; set; } | ||
public virtual int SmartResource { get; set; } | ||
} | ||
|
||
public class VideoStripImageAdData : SharedAdData | ||
{ | ||
public virtual string DefaultImage { get; set; } | ||
} | ||
|
||
public class StandardBanner : SharedAdData | ||
{ | ||
public virtual string Size { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" | ||
namespace="MediaMind.Course.Models" | ||
assembly="MediaMind.Course"> | ||
|
||
<class name="Ad"> | ||
<id name="Id" column="Id" type="System.Int64"> | ||
<generator class="hilo"/> | ||
</id> | ||
<property name="Name" not-null="true"/> | ||
<many-to-one name="Campaign"/> | ||
|
||
<any name="Data" id-type="System.Int64" meta-type="System.String" | ||
cascade="save-update"> | ||
|
||
<meta-value class="StandardBanner" value="StandardBanner"/> | ||
<meta-value class="VideoStripImageAdData" value="VideoStripImageAdData"/> | ||
|
||
<column name="DataType"/> | ||
<column name="DataId"/> | ||
</any> | ||
|
||
</class> | ||
|
||
<class name="SharedAdData" abstract="true"> | ||
<id name="Id" column="Id" type="System.Int64"> | ||
<generator class="hilo"/> | ||
</id> | ||
<property name="SmartResource"/> | ||
|
||
<union-subclass name="VideoStripImageAdData"> | ||
<property name="DefaultImage"/> | ||
</union-subclass> | ||
|
||
<union-subclass name="StandardBanner"> | ||
<property name="Size"/> | ||
</union-subclass> | ||
</class> | ||
|
||
|
||
</hibernate-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters