Add Edit Mode for Administration

This commit is contained in:
Shaun Walker 2019-09-04 11:07:48 -04:00
parent 1e4c07889b
commit e1cc1ce973
14 changed files with 253 additions and 192 deletions

View File

@ -11,7 +11,7 @@
<ModuleMessage Message="@message" />
@if (profiles != null)
@if (PageState.User != null && profiles != null)
{
<table class="table table-borderless">
<tr>
@ -55,6 +55,7 @@
</table>
<button type="button" class="btn btn-primary" @onclick="@SaveUser">Save</button>
<button type="button" class="btn btn-secondary" @onclick="@Cancel">Cancel</button>
<br /><br />
}
@code {
@ -71,10 +72,17 @@
{
try
{
displayname = PageState.User.DisplayName;
email = PageState.User.Email;
profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId);
settings = await SettingService.GetUserSettingsAsync(PageState.User.UserId);
if (PageState.User != null)
{
displayname = PageState.User.DisplayName;
email = PageState.User.Email;
profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId);
settings = await SettingService.GetUserSettingsAsync(PageState.User.UserId);
}
else
{
message = "Current User Is Not Logged In";
}
}
catch (Exception ex)
{
@ -89,23 +97,30 @@
private async Task SaveUser()
{
User user = PageState.User;
user.DisplayName = displayname;
user.Email = email;
await UserService.UpdateUserAsync(user);
foreach (Profile profile in profiles)
try
{
string value = SettingService.GetSetting(settings, profile.Name, "");
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId, profile.Name, value);
}
User user = PageState.User;
user.DisplayName = displayname;
user.Email = email;
await UserService.UpdateUserAsync(user);
UriHelper.NavigateTo("");
foreach (Profile profile in profiles)
{
string value = SettingService.GetSetting(settings, profile.Name, "");
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId, profile.Name, value);
}
UriHelper.NavigateTo("");
}
catch (Exception ex)
{
message = ex.Message;
}
}
private void Cancel()
{
UriHelper.NavigateTo(NavigateUrl("")); // navigate to home
UriHelper.NavigateTo(NavigateUrl(""));
}
private void ProfileChanged(UIChangeEventArgs e, string SettingName)

View File

@ -34,7 +34,7 @@
string style = "";
bool authorized = false;
protected override void OnInitialized()
protected override void OnParametersSet()
{
text = Action;
if (!String.IsNullOrEmpty(Text))
@ -49,39 +49,42 @@
if (!string.IsNullOrEmpty(Class))
{
classname = Class;
classname = Class;
}
if (!string.IsNullOrEmpty(Style))
{
style = Style;
style = Style;
}
url = EditUrl(Action, parameters);
string typename = ModuleState.ModuleType.Replace(Utilities.GetTypeNameClass(ModuleState.ModuleType) + ",", Action + ",");
Type moduleType = Type.GetType(typename);
if (moduleType != null)
if (PageState.EditMode)
{
var moduleobject = Activator.CreateInstance(moduleType);
SecurityAccessLevel SecurityAccessLevel = (SecurityAccessLevel)moduleType.GetProperty("SecurityAccessLevel").GetValue(moduleobject, null);
switch (SecurityAccessLevel)
string typename = ModuleState.ModuleType.Replace(Utilities.GetTypeNameClass(ModuleState.ModuleType) + ",", Action + ",");
Type moduleType = Type.GetType(typename);
if (moduleType != null)
{
case SecurityAccessLevel.Anonymous:
authorized = true;
break;
case SecurityAccessLevel.View:
authorized = UserSecurity.IsAuthorized(PageState.User, "View", ModuleState.Permissions);
break;
case SecurityAccessLevel.Edit:
authorized = UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions);
break;
case SecurityAccessLevel.Admin:
authorized = UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole);
break;
case SecurityAccessLevel.Host:
authorized = UserSecurity.IsAuthorized(PageState.User, Constants.HostRole);
break;
var moduleobject = Activator.CreateInstance(moduleType);
SecurityAccessLevel SecurityAccessLevel = (SecurityAccessLevel)moduleType.GetProperty("SecurityAccessLevel").GetValue(moduleobject, null);
switch (SecurityAccessLevel)
{
case SecurityAccessLevel.Anonymous:
authorized = true;
break;
case SecurityAccessLevel.View:
authorized = UserSecurity.IsAuthorized(PageState.User, "View", ModuleState.Permissions);
break;
case SecurityAccessLevel.Edit:
authorized = UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions);
break;
case SecurityAccessLevel.Admin:
authorized = UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole);
break;
case SecurityAccessLevel.Host:
authorized = UserSecurity.IsAuthorized(PageState.User, Constants.HostRole);
break;
}
}
}
}

View File

@ -18,7 +18,7 @@
RenderFragment DynamicComponent { get; set; }
protected override void OnInitialized()
protected override void OnParametersSet()
{
DynamicComponent = builder =>
{

View File

@ -13,7 +13,7 @@
RenderFragment DynamicComponent { get; set; }
protected override void OnInitialized()
protected override void OnParametersSet()
{
DynamicComponent = builder =>
{

View File

@ -19,6 +19,7 @@ namespace Oqtane.Shared
public Dictionary<string, string> QueryString { get; set; }
public int ModuleId { get; set; }
public string Control { get; set; }
public bool EditMode { get; set; }
public int Reload { get; set; }
}
}

View File

@ -26,9 +26,9 @@
string paneadminborder = "";
string panetitle = "";
protected override void OnInitialized()
protected override void OnParametersSet()
{
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions) && Name != Constants.AdminPane)
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions) && Name != Constants.AdminPane)
{
paneadminborder = "pane-admin-border";
panetitle = "<div class=\"pane-admin-title\">" + Name + " Pane</div>";

View File

@ -9,7 +9,7 @@
RenderFragment DynamicComponent { get; set; }
protected override void OnInitialized()
protected override void OnParametersSet()
{
DynamicComponent = builder =>
{

View File

@ -86,11 +86,13 @@
List<Module> modules;
int moduleid = -1;
string control = "";
bool editmode = false;
int reload = 0;
if (PageState != null)
{
reload = PageState.Reload;
editmode = PageState.EditMode;
}
if (PageState == null || reload == Constants.ReloadApplication)
@ -188,6 +190,7 @@
{
page = pages.Where(item => item.Path == path).FirstOrDefault();
reload = Constants.ReloadPage;
editmode = false;
}
user = null;
@ -238,6 +241,7 @@
modules = PageState.Modules;
}
pagestate.Modules = modules;
pagestate.EditMode = editmode;
pagestate.Reload = 0;
OnStateChange?.Invoke(pagestate);

View File

@ -8,7 +8,7 @@
RenderFragment DynamicComponent { get; set; }
protected override void OnInitialized()
protected override void OnParametersSet()
{
DynamicComponent = builder =>
{

View File

@ -12,67 +12,83 @@
@inject IModuleService ModuleService
@inject IPageModuleService PageModuleService
<div id="actions" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeActions()">x</a>
<div class="overlay-content">
<ul class="nav flex-column">
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Add")" Match="NavLinkMatch.All">Add Page</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Edit")" Match="NavLinkMatch.All">Edit Page</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Delete")" Match="NavLinkMatch.All">Delete Page</NavLink>
</li>
</ul>
<hr style="width: 100%; color: white; height: 1px; background-color:white;" />
<div class="container">
<div class="form-group">
<label for="Module" class="control-label" style="color: white !important;">Module: </label>
@if (moduledefinitions != null)
{
<select class="form-control" @bind="@moduledefinitionname">
<option value="">&lt;Select Module&gt;</option>
@foreach (var moduledefinition in moduledefinitions)
@if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
{
<div id="actions" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeActions()">x</a>
<div class="overlay-content">
<ul class="nav flex-column">
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Add")" Match="NavLinkMatch.All">Add Page</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Edit")" Match="NavLinkMatch.All">Edit Page</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="btn btn-primary" href="@PageUrl("Delete")" Match="NavLinkMatch.All">Delete Page</NavLink>
</li>
</ul>
<hr style="width: 100%; color: white; height: 1px; background-color:white;" />
<div class="container">
<div class="form-group">
<label for="Module" class="control-label" style="color: white !important;">Module: </label>
@if (moduledefinitions != null)
{
<select class="form-control" @bind="@moduledefinitionname">
<option value="">&lt;Select Module&gt;</option>
@foreach (var moduledefinition in moduledefinitions)
{
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
}
</select>
}
</div>
<div class="form-group">
<label for="Pane" class="control-label" style="color: white !important;">Pane: </label>
<select class="form-control" @bind="@pane">
<option value="">&lt;Select Pane&gt;</option>
@foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
<option value="@pane">@pane Pane</option>
}
</select>
}
</div>
<div class="form-group">
<label for="Title" class="control-label" style="color: white !important;">Title: </label>
<input type="text" name="Title" class="form-control" @bind="@title" />
</div>
<div class="form-group">
<label for="Container" class="control-label" style="color: white !important;">Container: </label>
<select class="form-control" @bind="@containertype">
<option value="">&lt;Select Container&gt;</option>
@foreach (KeyValuePair<string, string> container in containers)
{
<option value="@container.Key">@container.Value</option>
}
</select>
</div>
<button type="button" class="btn btn-primary" @onclick="@AddModule">Add Module To Page</button>
</div>
<div class="form-group">
<label for="Pane" class="control-label" style="color: white !important;">Pane: </label>
<select class="form-control" @bind="@pane">
<option value="">&lt;Select Pane&gt;</option>
@foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
<option value="@pane">@pane Pane</option>
}
</select>
</div>
<div class="form-group">
<label for="Title" class="control-label" style="color: white !important;">Title: </label>
<input type="text" name="Title" class="form-control" @bind="@title" />
</div>
<div class="form-group">
<label for="Container" class="control-label" style="color: white !important;">Container: </label>
<select class="form-control" @bind="@containertype">
<option value="">&lt;Select Container&gt;</option>
@foreach (KeyValuePair<string, string> container in containers)
{
<option value="@container.Key">@container.Value</option>
}
</select>
</div>
<button type="button" class="btn btn-primary" @onclick="@AddModule">Add Module To Page</button>
</div>
</div>
</div>
<span class="oi oi-menu" style="@display" onclick="openActions()"></span>
@if (PageState.EditMode)
{
<button type="button" class="btn btn-outline-primary active" data-toggle="button" aria-pressed="true" autocomplete="off" @onclick="EditMode">
<span class="oi oi-pencil"></span>
</button>
}
else
{
<button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off" @onclick="EditMode">
<span class="oi oi-pencil"></span>
</button>
}
<span class="oi oi-menu" onclick="openActions()"></span>
}
@code {
string display = "display: none";
List<ModuleDefinition> moduledefinitions;
Dictionary<string, string> containers = new Dictionary<string, string>();
int pagemanagementmoduleid = -1;
@ -83,45 +99,47 @@
protected override async Task OnInitializedAsync()
{
moduledefinitions = PageState.ModuleDefinitions;
containers = ThemeService.GetContainerTypes(PageState.Themes);
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
if (modules.Count > 0)
{
pagemanagementmoduleid = modules.FirstOrDefault().ModuleId;
}
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
{
display = "display: inline";
moduledefinitions = PageState.ModuleDefinitions;
containers = ThemeService.GetContainerTypes(PageState.Themes);
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
if (modules.Count > 0)
{
pagemanagementmoduleid = modules.FirstOrDefault().ModuleId;
}
}
}
private async Task AddModule()
{
Module module = new Module();
module.SiteId = PageState.Site.SiteId;
module.ModuleDefinitionName = moduledefinitionname;
module.Permissions = PageState.Page.Permissions;
await ModuleService.AddModuleAsync(module);
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, moduledefinitionname);
int ModuleId = modules.LastOrDefault().ModuleId;
PageModule pagemodule = new PageModule();
pagemodule.PageId = PageState.Page.PageId;
pagemodule.ModuleId = ModuleId;
if (title == "")
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
{
title = moduledefinitions.Where(item => item.ModuleDefinitionName == moduledefinitionname).FirstOrDefault().Name;
}
pagemodule.Title = title;
pagemodule.Pane = pane;
pagemodule.Order = 0;
pagemodule.ContainerType = containertype;
await PageModuleService.AddPageModuleAsync(pagemodule);
Module module = new Module();
module.SiteId = PageState.Site.SiteId;
module.ModuleDefinitionName = moduledefinitionname;
module.Permissions = PageState.Page.Permissions;
await ModuleService.AddModuleAsync(module);
PageState.Reload = Constants.ReloadPage;
UriHelper.NavigateTo(NavigateUrl());
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, moduledefinitionname);
int ModuleId = modules.LastOrDefault().ModuleId;
PageModule pagemodule = new PageModule();
pagemodule.PageId = PageState.Page.PageId;
pagemodule.ModuleId = ModuleId;
if (title == "")
{
title = moduledefinitions.Where(item => item.ModuleDefinitionName == moduledefinitionname).FirstOrDefault().Name;
}
pagemodule.Title = title;
pagemodule.Pane = pane;
pagemodule.Order = 0;
pagemodule.ContainerType = containertype;
await PageModuleService.AddPageModuleAsync(pagemodule);
PageState.Reload = Constants.ReloadPage;
UriHelper.NavigateTo(NavigateUrl());
}
}
private string PageUrl(string action)
@ -144,4 +162,21 @@
}
return url;
}
private void EditMode()
{
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
{
if (PageState.EditMode)
{
PageState.EditMode = false;
}
else
{
PageState.EditMode = true;
}
PageState.Reload = Constants.ReloadPage;
UriHelper.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + PageState.EditMode.ToString().ToLower()));
}
}
}

View File

@ -8,75 +8,78 @@
@inject IUserService UserService
@inject IPageModuleService PageModuleService
<div class="dropdown" style="@display">
<button type="button" class="btn dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
@foreach (var action in actions)
{
<a class="dropdown-item" @onclick="@(async () => await ModuleAction(action.Action))">@action.Name</a>
}
@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions))
{
<div class="dropdown">
<button type="button" class="btn dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
@foreach (var action in actions)
{
<a class="dropdown-item" @onclick="@(async () => await ModuleAction(action.Action))">@action.Name</a>
}
</div>
</div>
</div>
}
@code {
string display = "display: none";
List<ActionViewModel> actions;
protected override void OnInitialized()
protected override void OnParametersSet()
{
actions = new List<ActionViewModel>();
if (ModuleState.PaneModuleIndex > 0)
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions))
{
actions.Add(new ActionViewModel { Action = "up", Name = "Move Up" });
}
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
{
actions.Add(new ActionViewModel { Action = "down", Name = "Move Down" });
}
foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
if (pane != ModuleState.Pane)
actions = new List<ActionViewModel>();
if (ModuleState.PaneModuleIndex > 0)
{
actions.Add(new ActionViewModel { Action = pane, Name = "Move To " + pane + " Pane" });
actions.Add(new ActionViewModel { Action = "up", Name = "Move Up" });
}
}
actions.Add(new ActionViewModel { Action = "settings", Name = "Settings" });
actions.Add(new ActionViewModel { Action = "delete", Name = "Delete" });
if (UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions))
{
display = "display: inline";
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
{
actions.Add(new ActionViewModel { Action = "down", Name = "Move Down" });
}
foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
if (pane != ModuleState.Pane)
{
actions.Add(new ActionViewModel { Action = pane, Name = "Move To " + pane + " Pane" });
}
}
actions.Add(new ActionViewModel { Action = "settings", Name = "Settings" });
actions.Add(new ActionViewModel { Action = "delete", Name = "Delete" });
}
}
protected async Task ModuleAction(string action)
{
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
string url = NavigateUrl();
switch (action)
if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions))
{
case "up":
pagemodule.Order += -1;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
case "down":
pagemodule.Order += 1;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
case "settings":
url = EditUrl(pagemodule.ModuleId, "Settings");
break;
case "delete":
await PageModuleService.DeletePageModuleAsync(pagemodule.PageModuleId);
break;
default: // move to pane
pagemodule.Pane = action;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
string url = NavigateUrl();
switch (action)
{
case "up":
pagemodule.Order += -1;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
case "down":
pagemodule.Order += 1;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
case "settings":
url = EditUrl(pagemodule.ModuleId, "Settings");
break;
case "delete":
await PageModuleService.DeletePageModuleAsync(pagemodule.PageModuleId);
break;
default: // move to pane
pagemodule.Pane = action;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
break;
}
PageState.Reload = Constants.ReloadPage;
UriHelper.NavigateTo(url);
}
PageState.Reload = Constants.ReloadPage;
UriHelper.NavigateTo(url);
}
public class ActionViewModel

View File

@ -21,7 +21,7 @@ namespace Oqtane.Repository
public IEnumerable<Profile> GetProfiles(int SiteId)
{
return db.Profile.Where(item => item.SiteId == SiteId);
return db.Profile.Where(item => item.SiteId == SiteId || item.SiteId == null);
}
public Profile AddProfile(Profile Profile)

View File

@ -383,28 +383,28 @@ GO
SET IDENTITY_INSERT [dbo].[Profile] ON
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (1, 1, 'FirstName', 'First Name', 'Your First Or Given Name', 'Name', 1, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (1, null, 'FirstName', 'First Name', 'Your First Or Given Name', 'Name', 1, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (2, 1, 'LastName', 'Last Name', 'Your Last Or family Name', 'Name', 2, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (2, null, 'LastName', 'Last Name', 'Your Last Or family Name', 'Name', 2, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (3, 1, 'Street', 'Street', 'Street Or Building Address', 'Address', 3, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (3, null, 'Street', 'Street', 'Street Or Building Address', 'Address', 3, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (4, 1, 'City', 'City', 'City', 'Address', 4, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (4, null, 'City', 'City', 'City', 'Address', 4, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (5, 1, 'Region', 'Region', 'State Or Province', 'Address', 5, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (5, null, 'Region', 'Region', 'State Or Province', 'Address', 5, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (6, 1, 'Country', 'Country', 'Country', 'Address', 6, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (6, null, 'Country', 'Country', 'Country', 'Address', 6, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (7, 1, 'PostalCode', 'Postal Code', 'Postal Code Or Zip Code', 'Address', 7, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (7, null, 'PostalCode', 'Postal Code', 'Postal Code Or Zip Code', 'Address', 7, 50, '', 1, 0, '', getdate(), '', getdate())
GO
INSERT [dbo].[Profile]([ProfileId], [SiteId], [Name], [Title], [Description], [Category], [ViewOrder], [MaxLength], [DefaultValue], [IsRequired], [IsPrivate], [CreatedBy], [CreatedOn], [ModifiedBy], [ModifiedOn])
VALUES (8, 1, 'Phone', 'Phone Number', 'Phone Number', 'Contact', 8, 50, '', 1, 0, '', getdate(), '', getdate())
VALUES (8, null, 'Phone', 'Phone Number', 'Phone Number', 'Contact', 8, 50, '', 1, 0, '', getdate(), '', getdate())
GO
SET IDENTITY_INSERT [dbo].[Profile] OFF
GO

View File

@ -5,7 +5,7 @@ namespace Oqtane.Models
public class Profile : IAuditable
{
public int ProfileId { get; set; }
public int SiteId { get; set; }
public int? SiteId { get; set; }
public string Name { get; set; }
public string Title { get; set; }
public string Description { get; set; }