Initial commit

This commit is contained in:
2025-02-13 22:10:32 +01:00
commit 3563d783d4
162 changed files with 14738 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
using System;
using System.Runtime.Serialization;
using DotNetNuke.ComponentModel.DataAnnotations;
using Bring2mind.InMemoriam.Core.Data;
namespace Bring2mind.InMemoriam.Core.Models.Stories
{
[TableName("B2M_InMemoriam_Stories")]
[PrimaryKey("StoryId", AutoIncrement = true)]
[DataContract]
[Scope("ModuleId")]
public partial class StoryBase : AuditableEntity
{
#region .ctor
public StoryBase()
{
StoryId = -1;
}
#endregion
#region Properties
[DataMember]
public int StoryId { get; set; }
[DataMember]
public int ModuleId { get; set; }
[DataMember]
public string Title { get; set; }
[DataMember]
public string Contents { get; set; }
[DataMember]
public int StoryYear { get; set; }
[DataMember]
public int StoryMonth { get; set; }
[DataMember]
public int StoryDay { get; set; }
[DataMember]
public int Visibility { get; set; }
#endregion
#region Methods
public void ReadStoryBase(StoryBase story)
{
if (story.StoryId > -1)
StoryId = story.StoryId;
if (story.ModuleId > -1)
ModuleId = story.ModuleId;
if (!String.IsNullOrEmpty(story.Title))
Title = story.Title;
if (!String.IsNullOrEmpty(story.Contents))
Contents = story.Contents;
if (story.StoryYear > -1)
StoryYear = story.StoryYear;
if (story.StoryMonth > -1)
StoryMonth = story.StoryMonth;
if (story.StoryDay > -1)
StoryDay = story.StoryDay;
if (story.Visibility > -1)
Visibility = story.Visibility;
}
#endregion
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Runtime.Serialization;
using DotNetNuke.ComponentModel.DataAnnotations;
using Bring2mind.InMemoriam.Core.Data;
namespace Bring2mind.InMemoriam.Core.Models.Stories
{
public partial class StoryBase : AuditableEntity
{
public void ReadEditedStoryBase(StoryBase story)
{
Title = story.Title.Trim();
Contents = story.Contents.Trim();
StoryYear = story.StoryYear;
StoryMonth = story.StoryMonth;
StoryDay = story.StoryDay;
Visibility = story.Visibility;
}
}
}

View File

@@ -0,0 +1,83 @@
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.Stories
{
public partial class StoryBase : IHydratable, IPropertyAccess
{
#region IHydratable
public virtual void Fill(IDataReader dr)
{
FillAuditFields(dr);
StoryId = Convert.ToInt32(Null.SetNull(dr["StoryId"], StoryId));
ModuleId = Convert.ToInt32(Null.SetNull(dr["ModuleId"], ModuleId));
Title = Convert.ToString(Null.SetNull(dr["Title"], Title));
Contents = Convert.ToString(Null.SetNull(dr["Contents"], Contents));
StoryYear = Convert.ToInt32(Null.SetNull(dr["StoryYear"], StoryYear));
StoryMonth = Convert.ToInt32(Null.SetNull(dr["StoryMonth"], StoryMonth));
StoryDay = Convert.ToInt32(Null.SetNull(dr["StoryDay"], StoryDay));
Visibility = Convert.ToInt32(Null.SetNull(dr["Visibility"], Visibility));
}
[IgnoreColumn()]
public int KeyID
{
get { return StoryId; }
set { StoryId = 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 "storyid": // Int
return StoryId.ToString(strFormat, formatProvider);
case "moduleid": // Int
return ModuleId.ToString(strFormat, formatProvider);
case "title": // NVarChar
if (Title == null)
{
return "";
};
return PropertyAccess.FormatString(Title, strFormat);
case "contents": // NVarCharMax
if (Contents == null)
{
return "";
};
return PropertyAccess.FormatString(Contents, strFormat);
case "storyyear": // Int
return StoryYear.ToString(strFormat, formatProvider);
case "storymonth": // Int
return StoryMonth.ToString(strFormat, formatProvider);
case "storyday": // Int
return StoryDay.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
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Runtime.Serialization;
using DotNetNuke.ComponentModel.DataAnnotations;
namespace Bring2mind.InMemoriam.Core.Models.Stories
{
[TableName("vw_B2M_InMemoriam_Stories")]
[PrimaryKey("StoryId", AutoIncrement = true)]
[DataContract]
[Scope("ModuleId")]
public partial class Story : StoryBase
{
#region .ctor
public Story() : base()
{
}
#endregion
#region Properties
[DataMember]
public string CreatedByUser { get; set; }
[DataMember]
public string LastModifiedByUser { get; set; }
#endregion
#region Methods
public StoryBase GetStoryBase()
{
StoryBase res = new StoryBase();
res.StoryId = StoryId;
res.ModuleId = ModuleId;
res.Title = Title;
res.Contents = Contents;
res.StoryYear = StoryYear;
res.StoryMonth = StoryMonth;
res.StoryDay = StoryDay;
res.Visibility = Visibility;
res.CreatedByUserID = CreatedByUserID;
res.CreatedOnDate = CreatedOnDate;
res.LastModifiedByUserID = LastModifiedByUserID;
res.LastModifiedOnDate = LastModifiedOnDate;
return res;
}
public Story Clone()
{
Story res = new Story();
res.StoryId = StoryId;
res.ModuleId = ModuleId;
res.Title = Title;
res.Contents = Contents;
res.StoryYear = StoryYear;
res.StoryMonth = StoryMonth;
res.StoryDay = StoryDay;
res.Visibility = Visibility;
res.CreatedByUser = CreatedByUser;
res.LastModifiedByUser = LastModifiedByUser;
res.CreatedByUserID = CreatedByUserID;
res.CreatedOnDate = CreatedOnDate;
res.LastModifiedByUserID = LastModifiedByUserID;
res.LastModifiedOnDate = LastModifiedOnDate;
return res;
}
#endregion
}
}

View 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.Stories
{
[Serializable(), XmlRoot("Story")]
public partial class Story
{
#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
}
}