Initial commit
This commit is contained in:
94
Server/Core/Models/Pictures/PictureBase.cs
Normal file
94
Server/Core/Models/Pictures/PictureBase.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using DotNetNuke.ComponentModel.DataAnnotations;
|
||||
using Bring2mind.InMemoriam.Core.Data;
|
||||
|
||||
namespace Bring2mind.InMemoriam.Core.Models.Pictures
|
||||
{
|
||||
[TableName("B2M_InMemoriam_Pictures")]
|
||||
[PrimaryKey("PictureId", AutoIncrement = true)]
|
||||
[DataContract]
|
||||
[Scope("ModuleId")]
|
||||
public partial class PictureBase : AuditableEntity
|
||||
{
|
||||
|
||||
#region .ctor
|
||||
public PictureBase()
|
||||
{
|
||||
PictureId = -1;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
[DataMember]
|
||||
public int PictureId { get; set; }
|
||||
[DataMember]
|
||||
public int ModuleId { get; set; }
|
||||
[DataMember]
|
||||
public Guid ImageIdentifier { get; set; }
|
||||
[DataMember]
|
||||
public int OriginalWidth { get; set; }
|
||||
[DataMember]
|
||||
public int OriginalHeight { get; set; }
|
||||
[DataMember]
|
||||
public string OriginalName { get; set; }
|
||||
[DataMember]
|
||||
public string Title { get; set; }
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
[DataMember]
|
||||
public int PictureYear { get; set; }
|
||||
[DataMember]
|
||||
public int PictureMonth { get; set; }
|
||||
[DataMember]
|
||||
public int PictureDay { get; set; }
|
||||
[DataMember]
|
||||
public int Visibility { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public void ReadPictureBase(PictureBase picture)
|
||||
{
|
||||
if (picture.PictureId > -1)
|
||||
PictureId = picture.PictureId;
|
||||
|
||||
if (picture.ModuleId > -1)
|
||||
ModuleId = picture.ModuleId;
|
||||
|
||||
ImageIdentifier = picture.ImageIdentifier;
|
||||
|
||||
if (picture.OriginalWidth > -1)
|
||||
OriginalWidth = picture.OriginalWidth;
|
||||
|
||||
if (picture.OriginalHeight > -1)
|
||||
OriginalHeight = picture.OriginalHeight;
|
||||
|
||||
if (!String.IsNullOrEmpty(picture.OriginalName))
|
||||
OriginalName = picture.OriginalName;
|
||||
|
||||
if (!String.IsNullOrEmpty(picture.Title))
|
||||
Title = picture.Title;
|
||||
|
||||
if (!String.IsNullOrEmpty(picture.Description))
|
||||
Description = picture.Description;
|
||||
|
||||
if (picture.PictureYear > -1)
|
||||
PictureYear = picture.PictureYear;
|
||||
|
||||
if (picture.PictureMonth > -1)
|
||||
PictureMonth = picture.PictureMonth;
|
||||
|
||||
if (picture.PictureDay > -1)
|
||||
PictureDay = picture.PictureDay;
|
||||
|
||||
if (picture.Visibility > -1)
|
||||
Visibility = picture.Visibility;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
20
Server/Core/Models/Pictures/PictureBaseMore.cs
Normal file
20
Server/Core/Models/Pictures/PictureBaseMore.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Bring2mind.InMemoriam.Core.Data;
|
||||
|
||||
namespace Bring2mind.InMemoriam.Core.Models.Pictures
|
||||
{
|
||||
public partial class PictureBase : AuditableEntity
|
||||
{
|
||||
public void ReadEditedPictureBase(PictureBase picture)
|
||||
{
|
||||
Title = picture.Title.Trim();
|
||||
Description = picture.Description.Trim();
|
||||
PictureYear = picture.PictureYear;
|
||||
PictureMonth = picture.PictureMonth;
|
||||
PictureDay = picture.PictureDay;
|
||||
Visibility = picture.Visibility;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
99
Server/Core/Models/Pictures/PictureBase_Interfaces.cs
Normal file
99
Server/Core/Models/Pictures/PictureBase_Interfaces.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
using DotNetNuke.Common.Utilities;
|
||||
using DotNetNuke.ComponentModel.DataAnnotations;
|
||||
using DotNetNuke.Entities.Modules;
|
||||
using DotNetNuke.Services.Tokens;
|
||||
|
||||
namespace Bring2mind.InMemoriam.Core.Models.Pictures
|
||||
{
|
||||
public partial class PictureBase : IHydratable, IPropertyAccess
|
||||
{
|
||||
|
||||
#region IHydratable
|
||||
|
||||
public virtual void Fill(IDataReader dr)
|
||||
{
|
||||
FillAuditFields(dr);
|
||||
PictureId = Convert.ToInt32(Null.SetNull(dr["PictureId"], PictureId));
|
||||
ModuleId = Convert.ToInt32(Null.SetNull(dr["ModuleId"], ModuleId));
|
||||
ImageIdentifier = new Guid(Convert.ToString(Null.SetNull(dr["ImageIdentifier"], ImageIdentifier)));
|
||||
OriginalWidth = Convert.ToInt32(Null.SetNull(dr["OriginalWidth"], OriginalWidth));
|
||||
OriginalHeight = Convert.ToInt32(Null.SetNull(dr["OriginalHeight"], OriginalHeight));
|
||||
OriginalName = Convert.ToString(Null.SetNull(dr["OriginalName"], OriginalName));
|
||||
Title = Convert.ToString(Null.SetNull(dr["Title"], Title));
|
||||
Description = Convert.ToString(Null.SetNull(dr["Description"], Description));
|
||||
PictureYear = Convert.ToInt32(Null.SetNull(dr["PictureYear"], PictureYear));
|
||||
PictureMonth = Convert.ToInt32(Null.SetNull(dr["PictureMonth"], PictureMonth));
|
||||
PictureDay = Convert.ToInt32(Null.SetNull(dr["PictureDay"], PictureDay));
|
||||
Visibility = Convert.ToInt32(Null.SetNull(dr["Visibility"], Visibility));
|
||||
}
|
||||
|
||||
[IgnoreColumn()]
|
||||
public int KeyID
|
||||
{
|
||||
get { return PictureId; }
|
||||
set { PictureId = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IPropertyAccess
|
||||
public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound)
|
||||
{
|
||||
switch (strPropertyName.ToLower())
|
||||
{
|
||||
case "pictureid": // Int
|
||||
return PictureId.ToString(strFormat, formatProvider);
|
||||
case "moduleid": // Int
|
||||
return ModuleId.ToString(strFormat, formatProvider);
|
||||
case "imageidentifier": // UniqueIdentifier
|
||||
return ImageIdentifier.ToString(strFormat, formatProvider);
|
||||
case "originalwidth": // Int
|
||||
return OriginalWidth.ToString(strFormat, formatProvider);
|
||||
case "originalheight": // Int
|
||||
return OriginalHeight.ToString(strFormat, formatProvider);
|
||||
case "originalname": // NVarChar
|
||||
if (OriginalName == null)
|
||||
{
|
||||
return "";
|
||||
};
|
||||
return PropertyAccess.FormatString(OriginalName, strFormat);
|
||||
case "title": // NVarChar
|
||||
if (Title == null)
|
||||
{
|
||||
return "";
|
||||
};
|
||||
return PropertyAccess.FormatString(Title, strFormat);
|
||||
case "description": // NVarCharMax
|
||||
if (Description == null)
|
||||
{
|
||||
return "";
|
||||
};
|
||||
return PropertyAccess.FormatString(Description, strFormat);
|
||||
case "pictureyear": // Int
|
||||
return PictureYear.ToString(strFormat, formatProvider);
|
||||
case "picturemonth": // Int
|
||||
return PictureMonth.ToString(strFormat, formatProvider);
|
||||
case "pictureday": // Int
|
||||
return PictureDay.ToString(strFormat, formatProvider);
|
||||
case "visibility": // Int
|
||||
return Visibility.ToString(strFormat, formatProvider);
|
||||
default:
|
||||
propertyNotFound = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return Null.NullString;
|
||||
}
|
||||
|
||||
[IgnoreColumn()]
|
||||
public CacheLevel Cacheability
|
||||
{
|
||||
get { return CacheLevel.fullyCacheable; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
76
Server/Core/Models/Pictures/Picture_Declaration.cs
Normal file
76
Server/Core/Models/Pictures/Picture_Declaration.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using DotNetNuke.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bring2mind.InMemoriam.Core.Models.Pictures
|
||||
{
|
||||
|
||||
[TableName("vw_B2M_InMemoriam_Pictures")]
|
||||
[PrimaryKey("PictureId", AutoIncrement = true)]
|
||||
[DataContract]
|
||||
[Scope("ModuleId")]
|
||||
public partial class Picture : PictureBase
|
||||
{
|
||||
|
||||
#region .ctor
|
||||
public Picture() : base()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
[DataMember]
|
||||
public string CreatedByUser { get; set; }
|
||||
[DataMember]
|
||||
public string LastModifiedByUser { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public PictureBase GetPictureBase()
|
||||
{
|
||||
PictureBase res = new PictureBase();
|
||||
res.PictureId = PictureId;
|
||||
res.ModuleId = ModuleId;
|
||||
res.ImageIdentifier = ImageIdentifier;
|
||||
res.OriginalWidth = OriginalWidth;
|
||||
res.OriginalHeight = OriginalHeight;
|
||||
res.OriginalName = OriginalName;
|
||||
res.Title = Title;
|
||||
res.Description = Description;
|
||||
res.PictureYear = PictureYear;
|
||||
res.PictureMonth = PictureMonth;
|
||||
res.PictureDay = PictureDay;
|
||||
res.Visibility = Visibility;
|
||||
res.CreatedByUserID = CreatedByUserID;
|
||||
res.CreatedOnDate = CreatedOnDate;
|
||||
res.LastModifiedByUserID = LastModifiedByUserID;
|
||||
res.LastModifiedOnDate = LastModifiedOnDate;
|
||||
return res;
|
||||
}
|
||||
public Picture Clone()
|
||||
{
|
||||
Picture res = new Picture();
|
||||
res.PictureId = PictureId;
|
||||
res.ModuleId = ModuleId;
|
||||
res.ImageIdentifier = ImageIdentifier;
|
||||
res.OriginalWidth = OriginalWidth;
|
||||
res.OriginalHeight = OriginalHeight;
|
||||
res.OriginalName = OriginalName;
|
||||
res.Title = Title;
|
||||
res.Description = Description;
|
||||
res.PictureYear = PictureYear;
|
||||
res.PictureMonth = PictureMonth;
|
||||
res.PictureDay = PictureDay;
|
||||
res.Visibility = Visibility;
|
||||
res.CreatedByUser = CreatedByUser;
|
||||
res.LastModifiedByUser = LastModifiedByUser;
|
||||
res.CreatedByUserID = CreatedByUserID;
|
||||
res.CreatedOnDate = CreatedOnDate;
|
||||
res.LastModifiedByUserID = LastModifiedByUserID;
|
||||
res.LastModifiedOnDate = LastModifiedOnDate;
|
||||
return res;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
48
Server/Core/Models/Pictures/Picture_Interfaces.cs
Normal file
48
Server/Core/Models/Pictures/Picture_Interfaces.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using DotNetNuke.Common.Utilities;
|
||||
using DotNetNuke.Services.Tokens;
|
||||
|
||||
namespace Bring2mind.InMemoriam.Core.Models.Pictures
|
||||
{
|
||||
|
||||
[Serializable(), XmlRoot("Picture")]
|
||||
public partial class Picture
|
||||
{
|
||||
|
||||
#region IHydratable
|
||||
public override void Fill(IDataReader dr)
|
||||
{
|
||||
base.Fill(dr);
|
||||
CreatedByUser = Convert.ToString(Null.SetNull(dr["CreatedByUser"], CreatedByUser));
|
||||
LastModifiedByUser = Convert.ToString(Null.SetNull(dr["LastModifiedByUser"], LastModifiedByUser));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IPropertyAccess
|
||||
public override string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound)
|
||||
{
|
||||
switch (strPropertyName.ToLower()) {
|
||||
case "createdbyuser": // NVarChar
|
||||
if (CreatedByUser == null)
|
||||
{
|
||||
return "";
|
||||
};
|
||||
return PropertyAccess.FormatString(CreatedByUser, strFormat);
|
||||
case "lastmodifiedbyuser": // NVarChar
|
||||
if (LastModifiedByUser == null)
|
||||
{
|
||||
return "";
|
||||
};
|
||||
return PropertyAccess.FormatString(LastModifiedByUser, strFormat);
|
||||
default:
|
||||
return base.GetProperty(strPropertyName, strFormat, formatProvider, accessingUser, accessLevel, ref propertyNotFound);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user