v1.2.10.3 interim-1
This commit is contained in:
@@ -309,6 +309,15 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
return GetCodeTypeCaption(Sax.CodeType.OpportunityType, opportunityType);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Support.
|
||||
|
||||
// User Report Type.
|
||||
public String GetUserReportTypeCaption(Sax.UserReportType reportType)
|
||||
{
|
||||
return GetCodeTypeCaption(Sax.CodeType.UserReportType, reportType);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Region.
|
||||
public String GetRegionName(SaxRegion.Data region)
|
||||
|
||||
@@ -20,6 +20,7 @@ using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Consoles;
|
||||
using Saxonite.Net.Standard.Base.Mgr;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
@@ -111,6 +112,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
|
||||
public SaxAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
||||
public SaxActivityMgr ActivityMgr { get { return Internals.ActivityMgr; } }
|
||||
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
|
||||
public SaxSupportMgr SupportMgr { get { return Internals.SupportMgr; } }
|
||||
// System codes.
|
||||
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
|
||||
public List<TypeCodeDesc> SportSpecialityLabelCodes { get { return Internals.SportSpecialityLabelCodes; } }
|
||||
@@ -130,6 +132,8 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
|
||||
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }
|
||||
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
|
||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||
// Email.
|
||||
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
|
||||
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
|
||||
|
||||
@@ -13,6 +13,7 @@ using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Consoles;
|
||||
using Saxonite.Net.Standard.Base.Mgr;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -87,6 +88,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
||||
public SaxAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
||||
public SaxActivityMgr ActivityMgr { get { return Internals.ActivityMgr; } }
|
||||
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
|
||||
public SaxSupportMgr SupportMgr { get { return Internals.SupportMgr; } }
|
||||
// System codes.
|
||||
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
|
||||
public List<TypeCodeDesc> YesNoCodes { get { return Internals.YesNoCodes; } }
|
||||
@@ -107,6 +109,8 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
||||
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }
|
||||
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
|
||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Common data components.
|
||||
@@ -274,6 +278,22 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
||||
return maxLength;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Form control value max length - support database.
|
||||
/// <para>In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted.</para>
|
||||
/// <para>Hence, several cases where the value entered in the control isn't allowed the full database length.</para>
|
||||
/// </summary>
|
||||
public int GetControlMaxLength(SaxDbDfn_Support.ColumnIdx column)
|
||||
{
|
||||
int maxLength = (int)SaxDbDfn_Support.GetColTextLen(column);
|
||||
switch (column)
|
||||
{
|
||||
case SaxDbDfn_Support.ColumnIdx.UserReport_Title:
|
||||
break;
|
||||
}
|
||||
return maxLength;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Display data - Dates.
|
||||
public String FormatDateForDisplay(DateTime value)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"AppConfigs": {
|
||||
"SAX-Prod": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "",
|
||||
"URLs": {
|
||||
"Online": {
|
||||
"Root": "https://sportierre.com/"
|
||||
}
|
||||
},
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:.\\SQL2016Exp.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
},
|
||||
"Support": {
|
||||
"Location": "MsSql:.\\SQL2016Exp.Saxonite_Support_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
}
|
||||
},
|
||||
"Security": {
|
||||
"Password": {
|
||||
"MinLength": 9
|
||||
},
|
||||
"SignIn": {
|
||||
"KeepLoggedIn": {
|
||||
"Allowed": true,
|
||||
"CookieExpiresDays": 5
|
||||
},
|
||||
"PasswordRequest": {
|
||||
"LinkExpiresMins": 30
|
||||
}
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Prod",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [],
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
},
|
||||
"Signup": {
|
||||
"Activate": {
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
},
|
||||
"Welcome": {
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Documents": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Admin\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Admin\\Logs"
|
||||
},
|
||||
"Variants": [
|
||||
{
|
||||
"ApplicationRootFolder": "C:\\Sarand\\Saxonite\\Demo\\Admin\\App",
|
||||
"Instance": "Demo",
|
||||
"Documents": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Admin\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Admin\\Logs"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -633,6 +633,9 @@
|
||||
<data name="label.summary" xml:space="preserve">
|
||||
<value>Summary</value>
|
||||
</data>
|
||||
<data name="label.support" xml:space="preserve">
|
||||
<value>Support</value>
|
||||
</data>
|
||||
<data name="label.team" xml:space="preserve">
|
||||
<value>Team</value>
|
||||
</data>
|
||||
@@ -887,4 +890,10 @@ You will then be able to publicise your sporting activities.</value>
|
||||
<data name="security.msg.warn.sessionExpired" xml:space="preserve">
|
||||
<value>Your session has expired.</value>
|
||||
</data>
|
||||
<data name="support.caption.user.report" xml:space="preserve">
|
||||
<value>User Report</value>
|
||||
</data>
|
||||
<data name="support.caption.user.reports" xml:space="preserve">
|
||||
<value>User Reports</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -185,6 +185,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
ColumnDfn colOpportunityCount = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Opportunity_Count);
|
||||
ColumnDfn colStatus = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Status);
|
||||
ColumnDfn colCreatedOn = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.CreateOn_Date);
|
||||
ColumnDfn colLogoCount = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_LogoImage_Count);
|
||||
ColumnDfn colRoleCodes = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.OrganisationRoleCodes);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
@@ -192,7 +193,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
colOrganisationSportName, colOrganisationRegionName,
|
||||
colMemberCount, colOpportunityCount,
|
||||
colStatus, colStatus, colCreatedOn,
|
||||
colRoleCodes
|
||||
colLogoCount, colRoleCodes
|
||||
};
|
||||
|
||||
// Sort columns.
|
||||
@@ -205,11 +206,12 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
SysId organisationId = new SysId(values.GetLong(colId.DataName));
|
||||
Sax.OrganisationCategory organisationCategory = (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(values.GetString(colOrganisationCategory.DataName));
|
||||
Sax.OrganisationType organisationType = (Sax.OrganisationType)OrganisationTypeCodes.GetTypeForCode(values.GetString(colOrganisationType.DataName));
|
||||
ProfileOrganisationListData organisationData = new ProfileOrganisationListData()
|
||||
{
|
||||
Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))),
|
||||
Id = model.EncryptId(organisationId),
|
||||
Name = values.GetString(colOrganisationName.DataName),
|
||||
CategoryDesc = Localiser.GetOrganisationCategoryCaption(organisationCategory),
|
||||
TypeDesc = Localiser.GetOrganisationTypeCaption(organisationType),
|
||||
@@ -219,6 +221,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
};
|
||||
// Primary region.
|
||||
organisationData.RegionPrimary.Name = values.GetString(colOrganisationRegionName.DataName);
|
||||
// Logo.
|
||||
if (values.GetLong(colLogoCount.DataName) > 0)
|
||||
organisationData.LogoUrl = GetOrganisationLogoLink(organisationId, false);
|
||||
// Roles.
|
||||
List<String> roleCodes = StringListUtil.Split(values.GetString(colRoleCodes.DataName), SaxUserOrganisation.UserOrgnisationRoleDelim);
|
||||
if (roleCodes.ContainsCI(OrganisationRoleCodes.GetCodeForType(Sax.OrganisationRole.Admin)))
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Saxonite.Net.Core.Web.Online.Models;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using static Saxonite.Net.Standard.Base.App.Sax.Config;
|
||||
using static Saxonite.Net.Standard.Base.Bus.SaxArticle;
|
||||
using Saxonite.Net.Standard.Base.Bus.Support;
|
||||
using static Saxonite.Net.Standard.Base.App.Sax;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
// Online Support Controller - Feedback - Ajax actions.
|
||||
//=======================================================================
|
||||
partial class SupportController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data definitions.
|
||||
private class UserReportResponseListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
// Account Id only populated while account names are being queried, then nulled.
|
||||
public long? UserAccountId { get; set; }
|
||||
public String UserDisplayName { get; set; }
|
||||
public String ReportType { get; set; }
|
||||
public String ReportTitle { get; set; }
|
||||
public String RecordedOn { get; set; }
|
||||
}
|
||||
private class UserReportResponseItemData : UserReportResponseListData
|
||||
{
|
||||
public String Report { get; set; }
|
||||
}
|
||||
private void PopulateUserReportResponseListData(Model_Support model, SaxUserReport userReport, SaxUserAccount userAccount, UserReportResponseListData data)
|
||||
{
|
||||
data.Id = model.EncryptId(userReport.Id);
|
||||
data.UserDisplayName = userAccount.GetDisplayName();
|
||||
data.ReportType = Localiser.GetUserReportTypeCaption(userReport.ReportType);
|
||||
data.ReportTitle = userReport.Title;
|
||||
data.RecordedOn = model.FormatDateForDisplay(userReport.RecordedOn);
|
||||
}
|
||||
private void PopulateUserReportResponseItemData(Model_Support model, SaxUserReport userReport, SaxUserAccount userAccount, UserReportResponseItemData data)
|
||||
{
|
||||
PopulateUserReportResponseListData(model, userReport, userAccount, data);
|
||||
data.Report = userReport.Report;
|
||||
data.CreatedOnFmt = model.FormatDateForDisplay(userReport.CreateStamp.On);
|
||||
data.StatusCode = userReport.StatusCode;
|
||||
data.StatusDesc = userReport.StatusDesc;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Support - Get User Reports.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_UserReportsData : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_UserReportsData(SaxModel_Online model) : base(model) { }
|
||||
// Reference data.
|
||||
public List<ItemCodeDesc> ReportTypes { get; } = new List<ItemCodeDesc>();
|
||||
// User Report list.
|
||||
public List<UserReportResponseListData> Reports { get; } = new List<UserReportResponseListData>();
|
||||
}
|
||||
// Ajax request.
|
||||
[HttpPost]
|
||||
[Route("Support/Ajax/GetUserReports")]
|
||||
public IActionResult GetUserReports(Model_Support model)
|
||||
{
|
||||
String fn = GetType().Name + ".GetUserReports";
|
||||
AjaxResponse_UserReportsData responseData = new AjaxResponse_UserReportsData(model);
|
||||
String messageTitle = Localiser["support.caption.user.reports"];
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer) return Forbid();
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
RefreshModel(model);
|
||||
|
||||
// Reference data - Report types.
|
||||
List<Sax.UserReportType> validReportTypes = new List<Sax.UserReportType>(EnumUtil.GetValues<Sax.UserReportType>());
|
||||
foreach (TypeCodeDesc reportType in UserReportTypeCodes)
|
||||
{
|
||||
if (!validReportTypes.Contains((Sax.UserReportType)reportType.Type)) continue;
|
||||
responseData.ReportTypes.Add(new AjaxResponse_Data.ItemCodeDesc() { Code = reportType.Code, Desc = Localiser.GetUserReportTypeCaption((Sax.UserReportType)reportType.Type) });
|
||||
}
|
||||
|
||||
// Item filter.
|
||||
SaxUserReport.Params prmUserReport = new SaxUserReport.Params();
|
||||
prmUserReport.UserAccountIdsIncluded.Add(SessionUserAccountId);
|
||||
prmUserReport.StatusCat = SaxUserReport.StatusCat.NotDeleted;
|
||||
model.Paging.ItemTotal = (ulong)SupportMgr.GetUserReportCount(prmUserReport);
|
||||
model.PopulatePagingTo(prmUserReport.ResultsPaging);
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.Id);
|
||||
ColumnDfn colUserAccountId = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.UserAccountId);
|
||||
ColumnDfn colReportType = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.ReportType);
|
||||
ColumnDfn colReportTitle = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.Title);
|
||||
ColumnDfn colRecordedOn = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.RecordedOn);
|
||||
ColumnDfn colStatus = SupportMgr.GetUserReportColumnDfn(SaxUserReport.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId,
|
||||
colUserAccountId, colReportType, colReportTitle,colRecordedOn,
|
||||
colStatus,
|
||||
};
|
||||
|
||||
// Sort columns.
|
||||
prmUserReport.SortColumns.Add(colRecordedOn);
|
||||
|
||||
// User account details must be queried separately - different database!
|
||||
HashSet<SysId> userAccountIds = new HashSet<SysId>();
|
||||
|
||||
// Query items.
|
||||
using (DbResultSet resultSet = SupportMgr.ExecuteUserReportQuery(columns, prmUserReport))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
SysId userAccountId = new SysId(values.GetLong(colUserAccountId.DataName));
|
||||
userAccountIds.Add(userAccountId);
|
||||
Sax.UserReportType reportType = (Sax.UserReportType)values.GetLong(colReportType.DataName);
|
||||
UserReportResponseListData userReportData = new UserReportResponseListData()
|
||||
{
|
||||
Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))),
|
||||
UserAccountId = SysId.ToLong(userAccountId),
|
||||
ReportType = values.GetString(colReportType.DataName),
|
||||
ReportTitle = values.GetString(colReportTitle.DataName),
|
||||
RecordedOn = model.FormatDateForDisplay(values.GetDate(colRecordedOn.DataName)),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))
|
||||
};
|
||||
responseData.Reports.Add(userReportData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Reports.Count;
|
||||
|
||||
// Query and populate User Account details.
|
||||
if (userAccountIds.Any())
|
||||
{
|
||||
// User Account columns.
|
||||
ColumnDfn colUserAccount_Id = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.Id);
|
||||
ColumnDfn colUserAccount_Title = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.Title);
|
||||
ColumnDfn colUserAccount_FirstName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.FirstName);
|
||||
ColumnDfn colUserAccount_LastName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.LastName);
|
||||
List<ColumnDfn> userAccountCols = new List<ColumnDfn>() { colUserAccount_Id, colUserAccount_Title, colUserAccount_FirstName, colUserAccount_LastName };
|
||||
// User Account filter.
|
||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||
prmUserAccount.IdsIncluded.AddRange(userAccountIds);
|
||||
prmUserAccount.StatusCat = SaxUserAccount.StatusCat.Any;
|
||||
// Query user accounts and populate properties to report list.
|
||||
using (DbResultSet resultSet = AccountMgr.ExecuteUserAccountQuery(columns, prmUserAccount))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
SysId userAccountId = new SysId(values.GetLong(colUserAccount_Id.DataName));
|
||||
String title = values.GetString(colUserAccount_Title.DataName);
|
||||
String firstName = values.GetString(colUserAccount_FirstName.DataName);
|
||||
String lastName = values.GetString(colUserAccount_LastName.DataName);
|
||||
foreach (UserReportResponseListData userReportData in responseData.Reports.FindAll(item => item.UserAccountId.Equals(userAccountId)))
|
||||
{
|
||||
userReportData.UserDisplayName = SaxUserAccount.GetDisplayName(title, firstName, lastName);
|
||||
userReportData.UserAccountId = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Clear any remaining User Account Ids.
|
||||
foreach (UserReportResponseListData userReportData in responseData.Reports.FindAll(item => item.UserAccountId != null))
|
||||
userReportData.UserAccountId = null;
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get User Report ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_UserReport : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_UserReport(SaxModel_Online model) : base(model) { }
|
||||
// Sport details.
|
||||
public UserReportResponseItemData Report { get; } = new UserReportResponseItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Support/Ajax/GetUserReport")]
|
||||
public IActionResult Ajax_GetUserReport(Model_Support model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUserReport";
|
||||
String messageTitle = Localiser["support.caption.user.report"];
|
||||
AjaxResponse_UserReport responseData = new AjaxResponse_UserReport(model);
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer) return Forbid();
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
RefreshModel(model);
|
||||
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId userReportId = model.ExtractSysId(model.UserReport.Id);
|
||||
if (!SysId.IsValid(userReportId))
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||
|
||||
// Retrieve item.
|
||||
SaxUserReport userReport = SupportMgr.GetUserReportById(userReportId);
|
||||
disposableItems.Add(userReport);
|
||||
if (userReport == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to retrieve User Report for Id: '" + model.UserReport.Id + "'");
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||
}
|
||||
|
||||
// Retrieve user.
|
||||
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userReport.UserAccountId);
|
||||
disposableItems.Add(userAccount);
|
||||
if (userAccount == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to retrieve User Account for Id: '" + userReport.UserAccountId + "'");
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||
}
|
||||
|
||||
// Construct response.
|
||||
PopulateUserReportResponseItemData(model, userReport, userAccount, responseData.Report);
|
||||
responseData.Success = true;
|
||||
}
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Store User Report ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Support/Ajax/StoreUserReport")]
|
||||
public IActionResult Ajax_StoreUserReport(Model_Support model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreUserReport";
|
||||
String messageTitle = Localiser["support.caption.user.report"];
|
||||
AjaxResponse_UserReport responseData = new AjaxResponse_UserReport(model);
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer) return Forbid();
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
if (!SessionData_Online.User.Roles.Exists(item => item.Role == Sax.UserRole.SystemReviewer)) return Forbid();
|
||||
RefreshModel(model);
|
||||
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
|
||||
// Validate item properties.
|
||||
model.ValidateUserReportData(responseData);
|
||||
if (responseData.HasControlErrors())
|
||||
return Json(responseData);
|
||||
|
||||
// Validate User Report Id against 'Exists' flag.
|
||||
SysId userReportId = model.ExtractSysId(model.UserReport.Id);
|
||||
bool userReportExists = StringUtil.ToBool(model.UserReport.Exists);
|
||||
if (userReportExists && !SysId.IsValid(userReportId))
|
||||
{
|
||||
SaLogger.Warn(fn + " Id not specified for existing User Report.");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
if (!userReportExists && SysId.IsValid(userReportId))
|
||||
{
|
||||
SaLogger.Warn(fn + " Id specified for new User Report: '" + model.UserReport.Id + "'");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Retrieve user.
|
||||
SysId userAccountId = SessionUserAccountId;
|
||||
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userAccountId);
|
||||
disposableItems.Add(userAccount);
|
||||
if (userAccount == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to retrieve User Account for Id: '" + userAccountId + "'");
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||
}
|
||||
|
||||
// Retrieve existing item.
|
||||
SaxUserReport userReport = SupportMgr.GetUserReportById(userReportId);
|
||||
disposableItems.Add(userReport);
|
||||
if (userReport == null && SysId.IsValid(userReportId))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to retrieve User Report for Id: '" + model.UserReport.Id + "'");
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||
}
|
||||
// Validate User Report properties.
|
||||
if (userReport != null)
|
||||
{
|
||||
if (!userReport.UserAccountId.Equals(userAccountId))
|
||||
{
|
||||
SaLogger.Warn(fn + " Inconsistent User Account Id specified for User Report. Expected: " + userReport.UserAccountId + ". Found: " + userAccountId);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
}
|
||||
|
||||
// If User Report doesn't exist, create a new one.
|
||||
if (userReport == null)
|
||||
{
|
||||
userReport = SupportMgr.CreateUserReport(userAccountId);
|
||||
disposableItems.Add(userReport);
|
||||
}
|
||||
|
||||
// Populate item properties.
|
||||
if (model.UserReport.ReportType != null)
|
||||
userReport.ReportType = model.GetReportType();
|
||||
if (model.UserReport.Title != null)
|
||||
userReport.Title = model.UserReport.Title;
|
||||
if (model.UserReport.Report != null)
|
||||
userReport.Report = model.UserReport.Report;
|
||||
|
||||
// Store item.
|
||||
if (!SysId.IsValid(userReport.Id))
|
||||
{
|
||||
if (!SupportMgr.InsertUserReport(userReport, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert user report: " + SupportMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SupportMgr.UpdateUserReport(userReport, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to update user report [Id:" + SysId.ToString(userReport.Id) + "]: " + SupportMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"]));
|
||||
}
|
||||
}
|
||||
|
||||
// Construct response.
|
||||
PopulateUserReportResponseItemData(model, userReport, userAccount, responseData.Report);
|
||||
responseData.Success = true;
|
||||
}
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+8
-8
@@ -16,13 +16,13 @@ using System.Threading.Tasks;
|
||||
namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
// Online Application Controller.
|
||||
// Online Support Controller.
|
||||
//=======================================================================
|
||||
public partial class ApplicationController : SaxController_Online
|
||||
public partial class SupportController : SaxController_Online
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public ApplicationController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
public SupportController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
base(localiser, logger)
|
||||
{
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// No Application index page.
|
||||
// No Support index page.
|
||||
return RedirectToAction("", "");
|
||||
}
|
||||
|
||||
@@ -46,13 +46,13 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
Model_Support model = new Model_Support(Localiser);
|
||||
|
||||
// User must be a member of the 'Reviewers' role.
|
||||
if (!SessionData_Online.User.Roles.Exists(item => item.Role == Sax.UserRole.SystemReviewer))
|
||||
if (!SessionData_Online.User.SupportMenuAllowed)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Applincation index page.
|
||||
Model_Application model = new Model_Application(Localiser);
|
||||
model.ProhibitCache = false;
|
||||
return View(model);
|
||||
}
|
||||
@@ -64,13 +64,13 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
Model_Support model = new Model_Support(Localiser);
|
||||
|
||||
// User must be a member of the 'Reviewers' role.
|
||||
if (!SessionData_Online.User.Roles.Exists(item => item.Role == Sax.UserRole.SystemReviewer))
|
||||
if (!SessionData_Online.User.SupportMenuAllowed)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Applincation index page.
|
||||
Model_Application model = new Model_Application(Localiser);
|
||||
model.ProhibitCache = false;
|
||||
return View(model);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Online.Models
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_Application : SaxModel_Online
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public Model_Application(SaxLocaliser localiser) :
|
||||
base(localiser)
|
||||
{
|
||||
AdditionalFiles_CSS.Add("css/sax-appl.css");
|
||||
AdditionalFiles_JS.Add("js/sax-appl.js");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||
using Saxonite.Net.Core.Web.Base.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Saxonite.Net.Standard.Base.App.Sax.Config;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Online.Models
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_Support : SaxModel_Online
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public Model_Support(SaxLocaliser localiser) :
|
||||
base(localiser)
|
||||
{
|
||||
AdditionalFiles_CSS.Add("css/sax-appl.css");
|
||||
AdditionalFiles_JS.Add("js/sax-appl.js");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// User Report proerties.
|
||||
public class UserReportData
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String Exists { get; set; }
|
||||
public String ReportType { get; set; }
|
||||
public String Title { get; set; }
|
||||
public String Report { get; set; }
|
||||
// Filter.
|
||||
public class UserReportFilterData
|
||||
{
|
||||
public String User { get; set; }
|
||||
public String Report { get; set; }
|
||||
}
|
||||
public UserReportFilterData Filter { get; } = new UserReportFilterData();
|
||||
}
|
||||
public UserReportData UserReport { get; } = new UserReportData();
|
||||
public Standard.Base.App.Sax.UserReportType GetReportType() { return (Standard.Base.App.Sax.UserReportType)(UserReportTypeCodes.GetTypeForCode(UserReport.ReportType)); }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate User Report data.
|
||||
public bool ValidateUserReportData(SaxController_Base.AjaxResponse_Data responseData)
|
||||
{
|
||||
|
||||
// Report Title.
|
||||
String controlName = "UserReportTitle";
|
||||
if (UserReport.Title != null)
|
||||
{
|
||||
responseData.SetControlValue(controlName, UserReport.Title);
|
||||
if (StringUtil.IsEmpty(UserReport.Title))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(UserReport.Title) > GetControlMaxLength(SaxDbDfn_Support.ColumnIdx.UserReport_Title))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Support.ColumnIdx.UserReport_Title)]);
|
||||
}
|
||||
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -50,8 +50,8 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
public bool ArticlesAllowed { get { return UserIsJournalist || UserCanManageOrganisationArticles; } }
|
||||
public bool OrganisationOpportunitiesAllowed { get { return UserCanManageOrganisationOpportunities; } }
|
||||
public bool OrganisationEventsAllowed { get { return UserCanManageOrganisationSchedule; } }
|
||||
// Application menu is for admin reviewers only.
|
||||
public bool ApplicationMenuAllowed { get { return SessionData_Online?.User.Roles.Exists(item => item.Role == Sax.UserRole.SystemReviewer) ?? false; } }
|
||||
// Support menu is for admin reviewers only.
|
||||
public bool SupportMenuAllowed { get { return SessionData_Online?.User.SupportMenuAllowed ?? false; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Security profile.
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.Machine.Sarand602.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Update="appsettings.Machine.Sarand107.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
|
||||
@@ -39,13 +39,15 @@
|
||||
|
||||
<div class="sax-content">
|
||||
@* Profile Organisations list *@
|
||||
<div class="sax-panel-results Organisations"></div>
|
||||
<div class="sax-panel-item-list sax-panel-results Organisations"></div>
|
||||
</div>
|
||||
|
||||
@* Item templates *@
|
||||
<div class="sax-panel-item-template">
|
||||
@* Organisation template *@
|
||||
<div class="sax-panel-item Organisation">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="sax-header row">
|
||||
<div class="col"><div class="sax-caption"><div class="sax-action OrganisationName"></div></div></div>
|
||||
<div class="fixed">
|
||||
@@ -59,6 +61,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sax-content">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-sm-6"><div class="OrganisationSport sax-note"></div></div>
|
||||
<div class="col-sm-6 text-sm-right"><div class="OrganisationRegionPrimary sax-note"></div></div>
|
||||
@@ -68,6 +72,11 @@
|
||||
<div class="col-sm-6 text-sm-right"><div class="OrganisationOpportunityCount sax-note sa-action">@Localiser["label.opportunities"]: <span class="OpportunityCount"></span></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed"><img src="" class="OrganisationLogo" alt="" title="" style="margin:0 0 0 6px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation Burger dropdown template - ul is ignored *@
|
||||
<ul class="sax-dropdown-menu ProfileOrganisation">
|
||||
|
||||
@@ -160,15 +160,15 @@
|
||||
<div class="dropdown-item text-dark sax-action" onclick="sax.goToPage('Search/Organisations');">@Localiser["organisation.caption.organisations"]</div>
|
||||
</div>
|
||||
</li>
|
||||
@if (Model.ApplicationMenuAllowed)
|
||||
@if (Model.SupportMenuAllowed)
|
||||
{
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link text-dark dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@Localiser["label.application"]
|
||||
@Localiser["label.support"]
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<div class="dropdown-item text-dark sax-action" onclick="sax.navigateTo('Application/Feedback');">@Localiser["caption.feedback"]</div>
|
||||
<div class="dropdown-item text-dark sax-action" onclick="sax.navigateTo('Application/Versions');">@Localiser["caption.version.history"]</div>
|
||||
<div class="dropdown-item text-dark sax-action" onclick="sax.navigateTo('Support/Feedback');">@Localiser["caption.feedback"]</div>
|
||||
<div class="dropdown-item text-dark sax-action" onclick="sax.navigateTo('Support/Versions');">@Localiser["caption.version.history"]</div>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
@model Model_Application
|
||||
@model Model_Support
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Online - Application - Index.
|
||||
ViewData["Title"] = "Application";
|
||||
// Online - Support - Feedback.
|
||||
ViewData["Title"] = "Support - Feedback";
|
||||
}
|
||||
|
||||
<div style="max-width:400px;margin:12px auto;padding:12px;font-size:16px;text-align:center;border:1px solid #808080;border-radius:4px;">
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
@model Model_Application
|
||||
@model Model_Support
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Online - Application - Index.
|
||||
ViewData["Title"] = "Application";
|
||||
// Online - Support - Versions.
|
||||
ViewData["Title"] = "Support - Versions";
|
||||
}
|
||||
|
||||
<div style="max-width:400px;margin:12px auto;padding:12px;font-size:16px;text-align:center;border:1px solid #808080;border-radius:4px;">
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"AppConfigs": {
|
||||
"SAX-Prod": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "",
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:.\\SQL2016Exp.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
},
|
||||
"Support": {
|
||||
"Location": "MsSql:.\\SQL2016Exp.Saxonite_Support_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
}
|
||||
},
|
||||
"Security": {
|
||||
"Password": {
|
||||
"MinLength": 8
|
||||
},
|
||||
"SignIn": {
|
||||
"KeepLoggedIn": {
|
||||
"Allowed": true,
|
||||
"CookieExpiresDays": 30
|
||||
},
|
||||
"PasswordRequest": {
|
||||
"LinkExpiresMins": 60
|
||||
}
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Prod",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [],
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
},
|
||||
"Signup": {
|
||||
"Activate": {
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
},
|
||||
"Welcome": {
|
||||
"AddressesBcc": [ "info@sportierre.com" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Documents": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Online\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Online\\Logs"
|
||||
},
|
||||
"Variants": [
|
||||
{
|
||||
"ApplicationRootFolder": "C:\\Sarand\\Saxonite\\Demo\\Online\\App",
|
||||
"Instance": "Demo",
|
||||
"Documents": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Online\\Docs"
|
||||
},
|
||||
"Logging": {
|
||||
"RootFolder": "C:\\Sarand\\Saxonite\\Demo\\Online\\Logs"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,8 @@
|
||||
color: #606060;
|
||||
background-color: #fff;
|
||||
border: 1px solid #989898;
|
||||
border-bottom-right-radius: 8px;
|
||||
border-radius: 3px;
|
||||
border-top-right-radius: 8px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
$('.OrganisationSport', $item).text(item.sportName);
|
||||
$('.OrganisationRegionPrimary', $item).text(item.regionPrimary.name);
|
||||
$('.OrganisationMemberCount', $item).toggle(!!item.memberCount).find('.MemberCount').text(item.memberCount);
|
||||
$('.OrganisationOpportunityCount', $item).toggle(!!item.opportunityCount).find('.MemberCount').text(item.opportunityCount);
|
||||
$('.OrganisationOpportunityCount', $item).toggle(!!item.opportunityCount).find('.OpportunityCount').text(item.opportunityCount);
|
||||
$('img.OrganisationLogo', $item).prop('src', item.logoUrl).toggle(!!item.logoUrl);
|
||||
|
||||
let $bgr = $('.sax-burger', $item);
|
||||
let $mnu = $('ul.sax-dropdown-menu', $bgr).empty();
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.10.2";
|
||||
private static String version { get; } = "1.2.10.3";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
EventType,
|
||||
OpportunityType,
|
||||
ActivityReaction,
|
||||
// Support.
|
||||
UserReportType,
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -100,6 +102,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
ItemAddress = 405,
|
||||
ItemAssociation = 410,
|
||||
ItemSport = 420,
|
||||
// Support.
|
||||
UserReport = 1010,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -395,6 +399,19 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
Exceptional = 5,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Support.
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>User Report Type</summary>
|
||||
public enum UserReportType
|
||||
{
|
||||
Unknown = 0,
|
||||
/* Do not change the values or codes - tied to database. */
|
||||
Enhancement= 10,
|
||||
Information = 20,
|
||||
Bug = 30,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -29,6 +29,7 @@ namespace Saxonite.Base.App
|
||||
UserReport_Id,
|
||||
UserReport_UserAccountId,
|
||||
UserReport_ReportType,
|
||||
UserReport_Title,
|
||||
UserReport_Report,
|
||||
UserReport_RecordedOn,
|
||||
UserReport_ReportData,
|
||||
@@ -60,7 +61,7 @@ namespace Saxonite.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 2;
|
||||
private static readonly int columnCount = 29;
|
||||
private static readonly int columnCount = 30;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -237,6 +238,7 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(1,"Id",5,-5,true,19),
|
||||
new ColumnDfn(1,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(1,"ReportType",3,5,false,5),
|
||||
new ColumnDfn(1,"Title",0,-9,false,1000),
|
||||
new ColumnDfn(1,"Report",0,-9,false,4000),
|
||||
new ColumnDfn(1,"RecordedOn",9,93,false,16),
|
||||
new ColumnDfn(1,"ReportData",0,-9,false,0),
|
||||
|
||||
@@ -10,6 +10,7 @@ using Saxonite.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.App
|
||||
{
|
||||
@@ -29,6 +30,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
public SaxAccountMgr accountMgr = null;
|
||||
public SaxActivityMgr activityMgr = null;
|
||||
public SaxItemDataMgr itemDataMgr = null;
|
||||
public SaxSupportMgr supportMgr = null;
|
||||
}
|
||||
private readonly Managers mgr = new Managers();
|
||||
private class Consoles
|
||||
@@ -70,6 +72,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
if (mgr.accountMgr != null) mgr.accountMgr.Dispose(); mgr.accountMgr = null;
|
||||
if (mgr.activityMgr != null) mgr.activityMgr.Dispose(); mgr.activityMgr = null;
|
||||
if (mgr.itemDataMgr != null) mgr.itemDataMgr.Dispose(); mgr.itemDataMgr = null;
|
||||
if (mgr.supportMgr != null) mgr.supportMgr.Dispose(); mgr.supportMgr = null;
|
||||
if (con.activityConsole != null) con.activityConsole.Dispose(); con.activityConsole = null;
|
||||
}
|
||||
}
|
||||
@@ -88,6 +91,12 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// System codes.
|
||||
private readonly Dictionary<Sax.CodeType, List<TypeCodeDesc>> codeTypes = new Dictionary<Sax.CodeType, List<TypeCodeDesc>>();
|
||||
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
|
||||
{
|
||||
if (!codeTypes.ContainsKey(codeType))
|
||||
codeTypes.Add(codeType, SaxSystem.GetCodesOfType(codeType));
|
||||
return new List<TypeCodeDesc>(codeTypes[codeType]);
|
||||
}
|
||||
public List<TypeCodeDesc> DataItemTypeCodes { get { return GetCodesOfType(Sax.CodeType.DataItemType); } }
|
||||
public List<TypeCodeDesc> YesNoCodes { get { return GetCodesOfType(Sax.CodeType.YesNo); } }
|
||||
public List<TypeCodeDesc> GenderCodes { get { return GetCodesOfType(Sax.CodeType.Gender); } }
|
||||
@@ -108,12 +117,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
public List<TypeCodeDesc> EventTypeCodes { get { return GetCodesOfType(Sax.CodeType.EventType); } }
|
||||
public List<TypeCodeDesc> OpportunityTypeCodes { get { return GetCodesOfType(Sax.CodeType.OpportunityType); } }
|
||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return GetCodesOfType(Sax.CodeType.ActivityReaction); } }
|
||||
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
|
||||
{
|
||||
if (!codeTypes.ContainsKey(codeType))
|
||||
codeTypes.Add(codeType, SaxSystem.GetCodesOfType(codeType));
|
||||
return new List<TypeCodeDesc>(codeTypes[codeType]);
|
||||
}
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return GetCodesOfType(Sax.CodeType.UserReportType); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Consoles.
|
||||
@@ -161,6 +166,15 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
return mgr.itemDataMgr;
|
||||
}
|
||||
}
|
||||
public SaxSupportMgr SupportMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mgr.supportMgr == null)
|
||||
mgr.supportMgr = System.CreateSupportMgr(SessionContext, this);
|
||||
return mgr.supportMgr;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Regions.
|
||||
|
||||
@@ -149,6 +149,12 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
private readonly List<RoleData> roles = new List<RoleData>();
|
||||
public List<RoleData> Roles { get { return new List<RoleData>(roles); } protected set { roles.Clear(); roles.AddRange(value); } }
|
||||
[JsonIgnore]
|
||||
public bool IsSystemAdmin { get { return roles?.Exists(item => item.Role == Sax.UserRole.SystemAdmin) ?? false; } }
|
||||
[JsonIgnore]
|
||||
public bool IsSystemReviewer { get { return roles?.Exists(item => item.Role == Sax.UserRole.SystemReviewer) ?? false; } }
|
||||
[JsonIgnore]
|
||||
public bool SupportMenuAllowed { get { return roles?.Exists(item => item.Role == Sax.UserRole.SystemAdmin || item.Role == Sax.UserRole.SystemReviewer) ?? false; } }
|
||||
[JsonIgnore]
|
||||
public bool IsJournalist { get { return roles?.Exists(item => item.Role == Sax.UserRole.Journalist) ?? false; } }
|
||||
}
|
||||
protected abstract UserData CreateUserData(SaxSessionContext sessionContext, SaxUserAccount userAccount, List<SaxUserRole> userRoles);
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
private static readonly List<TypeCodeDesc> eventTypeCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> opportunityTypeCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> activityReactionCodes = new List<TypeCodeDesc>();
|
||||
// Support.
|
||||
private static readonly List<TypeCodeDesc> userReportTypeCodes = new List<TypeCodeDesc>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C o d e T y p e s
|
||||
@@ -89,6 +91,10 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
case Sax.CodeType.ActivityReaction:
|
||||
return new List<TypeCodeDesc>(activityReactionCodes);
|
||||
|
||||
// Support.
|
||||
case Sax.CodeType.UserReportType:
|
||||
return new List<TypeCodeDesc>(userReportTypeCodes);
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(nameof(SaxSystem) + ".GetCodesOfType Unexpected code type: " + codeType.ToString());
|
||||
}
|
||||
@@ -289,6 +295,14 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
activityReactionCodes.Add(Sax.ActivityReaction.VeryGood, "VeryGood", "Very Good");
|
||||
activityReactionCodes.Add(Sax.ActivityReaction.Exceptional, "Exceptional", "Exceptional");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Support.
|
||||
|
||||
// User Report Types.
|
||||
userReportTypeCodes.Add(Sax.UserReportType.Enhancement, "Enhancement", "Enhancement request");
|
||||
userReportTypeCodes.Add(Sax.UserReportType.Information, "Information", "Information request");
|
||||
userReportTypeCodes.Add(Sax.UserReportType.Bug, "Bug", "Bug report");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.App
|
||||
{
|
||||
@@ -27,6 +28,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
public abstract SaxAccountMgr CreateAccountMgr(SaxSessionContext sessionContext, SaxInternals internals);
|
||||
public abstract SaxItemDataMgr CreateItemDataMgr(SaxSessionContext sessionContext, SaxInternals internals);
|
||||
public abstract SaxActivityMgr CreateActivityMgr(SaxSessionContext sessionContext, SaxInternals internals);
|
||||
public abstract SaxSupportMgr CreateSupportMgr(SaxSessionContext sessionContext, SaxInternals internals);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
Organisation_Sport_Name,
|
||||
Organisation_Member_Count,
|
||||
Organisation_Opportunity_Count,
|
||||
Organisation_LogoImage_Count,
|
||||
// Properties.
|
||||
AdminComment,
|
||||
// Associated data.
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using static Sarand.Net.Standard.Base.Bus.SacsHierarchyItem;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// UserReport.
|
||||
//=======================================================================
|
||||
public abstract class SaxUserReport : SacsHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
UserAccountId,
|
||||
ReportType,
|
||||
ReportType_Desc,
|
||||
Title,
|
||||
Report,
|
||||
RecordedOn,
|
||||
// Associated data.
|
||||
// Common.
|
||||
Notes,
|
||||
Flags,
|
||||
Status,
|
||||
Status_Desc,
|
||||
Status_Ind,
|
||||
CreateOn_Date,
|
||||
UpdateOn_Date,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public SysId UserAccountId { get; set; }
|
||||
public Sax.UserReportType ReportType { get; set; }
|
||||
public String Title { get; set; } = String.Empty;
|
||||
public String Report { get; set; } = String.Empty;
|
||||
public DateTime RecordedOn { get; set; }
|
||||
public String ReportData { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public SysId UserAccountId
|
||||
{
|
||||
get { return data.UserAccountId; }
|
||||
set { CheckChanged(data.UserAccountId, value); data.UserAccountId = value; }
|
||||
}
|
||||
public Sax.UserReportType ReportType
|
||||
{
|
||||
get { return data.ReportType; }
|
||||
set { CheckChanged((short)data.ReportType, (short)value); data.ReportType = value; }
|
||||
}
|
||||
public String Title
|
||||
{
|
||||
get { return data.Title; }
|
||||
set { CheckChanged(data.Title, value); data.Title = value; }
|
||||
}
|
||||
public String Report
|
||||
{
|
||||
get { return data.Report; }
|
||||
set { CheckChanged(data.Report, value); data.Report = value; }
|
||||
}
|
||||
public DateTime RecordedOn
|
||||
{
|
||||
get { return data.RecordedOn; }
|
||||
set { CheckChanged(data.RecordedOn, value); data.RecordedOn = value; }
|
||||
}
|
||||
public String ReportData
|
||||
{
|
||||
get { return data.ReportData; }
|
||||
set { CheckChanged(data.ReportData, value); data.ReportData = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
UserAccountId = data.UserAccountId;
|
||||
ReportType = data.ReportType;
|
||||
Title = data.Title;
|
||||
Report = data.Report;
|
||||
RecordedOn = data.RecordedOn;
|
||||
ReportData = data.ReportData;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue UserAccountId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ReportType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Title { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Report { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RecordedOn { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ReportData { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxUserReport(SysId id, SysId userAccountId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
this.UserAccountId = userAccountId;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Preparation,
|
||||
SaStatus.InProgress,
|
||||
SaStatus.Cancelled,
|
||||
SaStatus.Closed,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Preparation; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Preparation) return DataValue.TriStateType.Yellow;
|
||||
if (status == SaStatus.InProgress) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Completed) return DataValue.TriStateType.Blue;
|
||||
if (status == SaStatus.Cancelled) return DataValue.TriStateType.Red;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public ItemId GetItemId()
|
||||
{
|
||||
return new ItemId((short)Sax.DataItemType.UserReport, Id);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
String fn = GetType().Name + ".SetData";
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException(fn + " Id cannot be changed");
|
||||
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
|
||||
throw new NotSupportedException(fn + " UserAccountId cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public SysId UserAccountId
|
||||
{
|
||||
get { return data.UserAccountId; }
|
||||
protected set { data.UserAccountId = value; }
|
||||
}
|
||||
public Sax.UserReportType ReportType
|
||||
{
|
||||
get { return data.ReportType; }
|
||||
set { data.ReportType = value; }
|
||||
}
|
||||
public String Title
|
||||
{
|
||||
get { return data.Title; }
|
||||
set { data.Title = value; }
|
||||
}
|
||||
public String Report
|
||||
{
|
||||
get { return data.Report; }
|
||||
set { data.Report = value; }
|
||||
}
|
||||
public DateTime RecordedOn
|
||||
{
|
||||
get { return data.RecordedOn; }
|
||||
set { data.RecordedOn = value; }
|
||||
}
|
||||
public String ReportData
|
||||
{
|
||||
get { return data.ReportData; }
|
||||
set { data.ReportData = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
Preparation,
|
||||
Open,
|
||||
Completed,
|
||||
Cancelled,
|
||||
Closed,
|
||||
NotDeleted,
|
||||
Deleted,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public List<SysId> IdsIncluded { get; } = new List<SysId>();
|
||||
public List<SysId> IdsExcluded { get; } = new List<SysId>();
|
||||
public List<SysId> UserAccountIdsIncluded { get; } = new List<SysId>();
|
||||
public List<Sax.UserReportType> ReportTypesIncluded { get; } = new List<Sax.UserReportType>();
|
||||
/// <summary>Generic filter - caption, report, or other matching value (tbd).</summary>
|
||||
public String UserReportFilter { get; set; }
|
||||
public String TitlePartial { get; set; }
|
||||
public String ReportPartial { get; set; }
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.Open;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxUserReportList
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
public static SaxUserReport GetUserReportById(this IEnumerable<SaxUserReport> values, SysId userReportId)
|
||||
{
|
||||
if (!SysId.IsValid(userReportId)) return null;
|
||||
foreach (SaxUserReport userReport in values)
|
||||
if (userReport.Id.Equals(userReportId)) return userReport;
|
||||
return null;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
// Data members.
|
||||
private class DataMembers
|
||||
{
|
||||
public SaxInternals internals;
|
||||
public SaxInternals internals = null;
|
||||
public bool internalsCreatedHere = false;
|
||||
}
|
||||
private DataMembers data = new DataMembers();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Consoles;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Mgr.Support
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaxItemMgr_Support : SaxItemMgr
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
protected SaxItemMgr_Support(SaxSessionContext sessionContext, SaxInternals internals) :
|
||||
base (sessionContext, internals)
|
||||
{
|
||||
}
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public ISacsDatabase SupportDatabase { get { return SaxGlobals.App.GetDatabase(SessionContext, Sax.Database.Support); } }
|
||||
public IDatabaseInfo SupportDbInfo() { return SaxGlobals.App.CreateDbInfo(SessionContext, Sax.Database.Support); }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Base.App;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Bus.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Mgr.Support
|
||||
{
|
||||
//=======================================================================
|
||||
partial class SaxSupportMgr
|
||||
{
|
||||
//*******************************************************************
|
||||
// Support Mgr - User Report
|
||||
//*******************************************************************
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public abstract SaxUserReport CreateUserReport(SysId userAccountId);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
public bool UserReportExistsById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
SaxUserReport.Params prmUserReport = new SaxUserReport.Params();
|
||||
prmUserReport.IdsIncluded.Add(id);
|
||||
prmUserReport.StatusCat = SaxUserReport.StatusCat.Any;
|
||||
return GetUserReportCount(prmUserReport) == 1;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve individual items.
|
||||
public abstract SaxUserReport GetUserReport(SaxUserReport.Params prmUserReport);
|
||||
public SaxUserReport GetUserReportById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
SaxUserReport.Params prmUserReport = new SaxUserReport.Params();
|
||||
prmUserReport.IdsIncluded.Add(id);
|
||||
prmUserReport.StatusCat = SaxUserReport.StatusCat.Any;
|
||||
return GetUserReport(prmUserReport);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item data.
|
||||
public bool IsValidUserReport(SaxUserReport userReport)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (userReport == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
||||
return IsValidUserReportData(userReport.GetData(), new SaxUserReport.ErrField());
|
||||
}
|
||||
public virtual bool IsValidUserReportData(SaxUserReport.Data data, SaxUserReport.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
// User Account.
|
||||
if (errField.UserAccountId != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.UserAccountId))
|
||||
{
|
||||
errField.UserAccountId = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("User Account Id must be specified");
|
||||
}
|
||||
// Report Type.
|
||||
if (errField.ReportType != SacsHierarchyItem.ValidValue.Ignore && (int)data.ReportType < 1)
|
||||
{
|
||||
errField.ReportType = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Report type must be specified");
|
||||
}
|
||||
// Title.
|
||||
if (errField.Title != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Title, "title", (long)SaxDbDfn_Support.GetColTextLen(SaxDbDfn_Support.ColumnIdx.UserReport_Title), true))
|
||||
{
|
||||
errField.Title = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Report.
|
||||
if (errField.Report != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Report, "report", (long)SaxDbDfn_Support.GetColTextLen(SaxDbDfn_Support.ColumnIdx.UserReport_Report)))
|
||||
{
|
||||
errField.Report = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Recorded On.
|
||||
if (errField.RecordedOn != SacsHierarchyItem.ValidValue.Ignore && !DateUtil.IsValid(data.RecordedOn))
|
||||
{
|
||||
errField.RecordedOn = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Recorded on date must be specified");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Common properties.
|
||||
if (errField.Notes != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Notes, "notes", (long)SaxDbDfn_Support.GetColTextLen(SaxDbDfn_Support.ColumnIdx.UserReport_Notes)))
|
||||
{
|
||||
errField.Notes = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
if (errField.Status != SacsHierarchyItem.ValidValue.Ignore)
|
||||
{
|
||||
if (!IsValidValue(data.StatusCode, "status", (long)SaxDbDfn_Support.GetColTextLen(SaxDbDfn_Support.ColumnIdx.UserReport_Status), true, true))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
if (!SaxUserReport.ValidStatuses.Contains(data.Status))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState(ErrorMessage.InvalidStatus);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item database interface.
|
||||
public abstract bool InsertUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool UserReportCanBeDeleted(SaxUserReport userReport)
|
||||
{
|
||||
ClearErrorState();
|
||||
return true;
|
||||
}
|
||||
public abstract bool DeleteUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public abstract ColumnDfn GetUserReportColumnDfn(SaxUserReport.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetUserReportQueryFilter(SaxUserReport.Params prmUserReport);
|
||||
public abstract long GetUserReportCount(SaxUserReport.Params prmUserReport);
|
||||
public abstract List<SaxUserReport> GetUserReportList(SaxUserReport.Params prmUserReport);
|
||||
public abstract DbResultSet ExecuteUserReportQuery(List<ColumnDfn> columns, SaxUserReport.Params prmUserReport);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Extract and format result set data value where specific handling is required.
|
||||
/// <para>Where response is an invalid data value, format value using column.FormatValue(values).</para>
|
||||
/// </summary>
|
||||
public virtual DataValue GetUserReportDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxUserReport.Column)column.Id)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
// Report Type.
|
||||
case SaxUserReport.Column.ReportType_Desc:
|
||||
{
|
||||
Sax.UserReportType userReportType = (Sax.UserReportType)values.GetValue(column.DataName).AsLong();
|
||||
value = new DataValue(UserReportTypeCodes.GetDescForType(userReportType));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Notes.
|
||||
case SaxUserReport.Column.Notes:
|
||||
{
|
||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Status.
|
||||
case SaxUserReport.Column.Status_Desc:
|
||||
case SaxUserReport.Column.Status_Ind:
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxUserReport.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxUserReport.Column.Status_Ind)
|
||||
value = new DataValue(SaxUserReport.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Mgr.Support
|
||||
{
|
||||
//=======================================================================
|
||||
public abstract partial class SaxSupportMgr : SaxItemMgr_Support
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
protected SaxSupportMgr(SaxSessionContext sessionContext, SaxInternals internals) :
|
||||
base(sessionContext, internals)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Mgr;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
using Saxonite.Net.Standard.Dbas.Mgr;
|
||||
using Saxonite.Net.Standard.Dbas.Mgr.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -35,6 +37,10 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
{
|
||||
return new SaxItemDataMgr_Dbas(sessionContext, internals);
|
||||
}
|
||||
public override SaxSupportMgr CreateSupportMgr(SaxSessionContext sessionContext, SaxInternals internals)
|
||||
{
|
||||
return new SaxSupportMgr_Dbas(sessionContext, internals);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Bus.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Dbas.Bus.Support
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaxUserReport_Dbas : SaxUserReport
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private ISacsDatabase database;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaxUserReport_Dbas(ISacsDatabase database, SysId id, SysId userAccountId, UInt16 flags) :
|
||||
base(id, userAccountId)
|
||||
{
|
||||
this.database = database;
|
||||
Flags = flags;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Associated data.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 12-Dec-2022 13:20:42
|
||||
// Code generated by Sarand Database Utilities Sat 14-Jan-2023 12:13:03
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
{
|
||||
@@ -22,6 +22,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
|
||||
public ColumnDataInt32 _UserAccountId { get; } = new ColumnDataInt32("UserAccountId");
|
||||
public ColumnDataInt16 _ReportType { get; } = new ColumnDataInt16("ReportType");
|
||||
public ColumnDataString _Title { get; } = new ColumnDataString("Title");
|
||||
public ColumnDataString _Report { get; } = new ColumnDataString("Report");
|
||||
public ColumnDataDateTime _RecordedOn { get; } = new ColumnDataDateTime("RecordedOn");
|
||||
public ColumnDataString _ReportData { get; } = new ColumnDataString("ReportData");
|
||||
@@ -43,6 +44,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
"Id",
|
||||
"UserAccountId",
|
||||
"ReportType",
|
||||
"Title",
|
||||
"Report",
|
||||
"RecordedOn",
|
||||
"ReportData",
|
||||
@@ -90,6 +92,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _UserAccountId { get { return Cols._UserAccountId.Value; } set { Cols._UserAccountId.Value = value; } }
|
||||
public Int16 _ReportType { get { return Cols._ReportType.Value; } set { Cols._ReportType.Value = value; } }
|
||||
public String _Title { get { return Cols._Title.Value; } set { Cols._Title.Value = value; } }
|
||||
public String _Report { get { return Cols._Report.Value; } set { Cols._Report.Value = value; } }
|
||||
public DateTime _RecordedOn { get { return Cols._RecordedOn.Value; } set { Cols._RecordedOn.Value = value; } }
|
||||
public String _ReportData { get { return Cols._ReportData.Value; } set { Cols._ReportData.Value = value; } }
|
||||
@@ -126,6 +129,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
|
||||
_UserAccountId = GetFieldInt32(dbDataReader, "UserAccountId", _UserAccountId);
|
||||
_ReportType = GetFieldInt16(dbDataReader, "ReportType", _ReportType);
|
||||
_Title = GetFieldString(dbDataReader, "Title", _Title);
|
||||
_Report = GetFieldString(dbDataReader, "Report", _Report);
|
||||
_RecordedOn = GetFieldDateTime(dbDataReader, "RecordedOn", _RecordedOn);
|
||||
_ReportData = GetFieldString(dbDataReader, "ReportData", _ReportData);
|
||||
@@ -161,6 +165,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
dbCommand.Parameters.Clear();
|
||||
if (columnNames.ContainsCI("UserAccountId")) AddCommandParameter(dbCommand, "@UserAccountId", _UserAccountId);
|
||||
if (columnNames.ContainsCI("ReportType")) AddCommandParameter(dbCommand, "@ReportType", _ReportType);
|
||||
if (columnNames.ContainsCI("Title")) AddCommandParameter(dbCommand, "@Title", _Title);
|
||||
if (columnNames.ContainsCI("Report")) AddCommandParameter(dbCommand, "@Report", _Report);
|
||||
if (columnNames.ContainsCI("RecordedOn")) AddCommandParameter(dbCommand, "@RecordedOn", _RecordedOn);
|
||||
if (columnNames.ContainsCI("ReportData")) AddCommandParameter(dbCommand, "@ReportData", _ReportData);
|
||||
@@ -211,6 +216,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
|
||||
dbCommand.Parameters.Clear();
|
||||
if (columnNames.ContainsCI("UserAccountId")) AddCommandParameter(dbCommand, "@UserAccountId", _UserAccountId);
|
||||
if (columnNames.ContainsCI("ReportType")) AddCommandParameter(dbCommand, "@ReportType", _ReportType);
|
||||
if (columnNames.ContainsCI("Title")) AddCommandParameter(dbCommand, "@Title", _Title);
|
||||
if (columnNames.ContainsCI("Report")) AddCommandParameter(dbCommand, "@Report", _Report);
|
||||
if (columnNames.ContainsCI("RecordedOn")) AddCommandParameter(dbCommand, "@RecordedOn", _RecordedOn);
|
||||
if (columnNames.ContainsCI("ReportData")) AddCommandParameter(dbCommand, "@ReportData", _ReportData);
|
||||
|
||||
@@ -261,6 +261,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
private static readonly String prefixUserOrganisation_Organisation_Sport = "UsrOrg_Org_Spt_";
|
||||
private static readonly String dataName_UserOrganisation_Organisation_Member_Count = "UsrOrg_Org_Mbr_Count";
|
||||
private static readonly String dataName_UserOrganisation_Organisation_Opportunity_Count = "UsrOrg_Org_Opp_Count";
|
||||
private static readonly String dataName_UserOrganisation_Organisation_LogoImage_Count = "UsrOrg_Org_Logo_Count";
|
||||
private void SetUserOrganisationColDfn
|
||||
(ColumnDfn col, String caption, int width, SaxDbDfn_Core.ColumnIdx dbCol,
|
||||
ColumnAlignment align = ColumnAlignment.Default, DataValue.DataType dataType = DataValue.DataType.String,
|
||||
@@ -385,6 +386,10 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
columnDfn.DataName = dataName_UserOrganisation_Organisation_Opportunity_Count;
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxUserOrganisation.Column.Organisation_LogoImage_Count:
|
||||
SetOrganisationColDfn(columnDfn, "Logos", 76, SaxDbDfn_Core.ColumnIdx.Unknown, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||
columnDfn.DataName = dataName_UserOrganisation_Organisation_LogoImage_Count;
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Properties.
|
||||
@@ -787,6 +792,22 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
query.Columns.Add("(" + qryOrgOpp.BuildQuery() + ")", dataName_UserOrganisation_Organisation_Opportunity_Count);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Organisation Logo Image count.
|
||||
if (columns.HasId(SaxUserOrganisation.Column.Organisation_LogoImage_Count))
|
||||
{
|
||||
String aliasLogoCount = "Img_Org_Logo";
|
||||
DbQuery queryLogoCount = new DbQuery(CoreDatabase.DbmsType);
|
||||
queryLogoCount.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemImage), aliasLogoCount);
|
||||
queryLogoCount.Columns.Add("Count(*)");
|
||||
queryLogoCount.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemImage_ItemType, aliasLogoCount) + "=" + (int)Sax.DataItemType.Organisation);
|
||||
queryLogoCount.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemImage_ItemId, aliasLogoCount) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserOrganisation_OrganisationId, aliasUserOrganisation));
|
||||
queryLogoCount.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemImage_ImageType, aliasLogoCount) + "=" + (int)Sax.ImageType.OrganisationLogo);
|
||||
queryLogoCount.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemImage_Status, aliasLogoCount) + "='" + SacsSystem.GetStatusCode(SaStatus.Active) + "'");
|
||||
// Construct sub-query.
|
||||
query.Columns.Add("(" + queryLogoCount.BuildQuery() + ")", dataName_UserOrganisation_Organisation_LogoImage_Count);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Populate filter.
|
||||
query.Filters.AddRange(GetUserOrganisationQueryFilter(prm));
|
||||
|
||||
@@ -0,0 +1,563 @@
|
||||
using Sarand.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Saxonite.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Text;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System.Linq;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Dbas.Internal.Core;
|
||||
using Saxonite.Net.Standard.Base.Bus.Support;
|
||||
using Saxonite.Net.Standard.Dbas.Bus.Support;
|
||||
using Saxonite.Net.Standard.Dbas.Internal.Support;
|
||||
|
||||
namespace Saxonite.Net.Standard.Dbas.Mgr.Support
|
||||
{
|
||||
//=======================================================================
|
||||
partial class SaxSupportMgr_Dbas
|
||||
{
|
||||
//*******************************************************************
|
||||
// Support Mgr - User Report
|
||||
//*******************************************************************
|
||||
// Utilities.
|
||||
private List<StringPair> GetLogProperties(SaxUserReport userReport)
|
||||
{
|
||||
return new List<StringPair>()
|
||||
{
|
||||
new StringPair("Id",SysId.ToString(userReport.Id)),
|
||||
new StringPair("UserAccountId",SysId.ToString(userReport.UserAccountId)),
|
||||
new StringPair("ReportType",userReport.ReportType.ToString()),
|
||||
new StringPair("Status",userReport.StatusCode)
|
||||
};
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public override SaxUserReport CreateUserReport(SysId userAccountId)
|
||||
{
|
||||
ClearErrorState();
|
||||
return new SaxUserReport_Dbas(CoreDatabase, null, userAccountId, 0);
|
||||
}
|
||||
private SaxUserReport_Dbas CreateUserReport(UserReport_Db dbUserReport)
|
||||
{
|
||||
ClearErrorState();
|
||||
SaxUserReport_Dbas userReport = new SaxUserReport_Dbas(CoreDatabase, new SysId(dbUserReport._Id), new SysId(dbUserReport._UserAccountId), (ushort)dbUserReport._Flags);
|
||||
PopulateFrom(dbUserReport, userReport);
|
||||
return userReport;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get item.
|
||||
public override SaxUserReport GetUserReport(SaxUserReport.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
return GetUserReport(GetUserReportQueryFilter(prm).Concat(" And ", "(", ")"));
|
||||
}
|
||||
private SaxUserReport GetUserReport(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
long count = GetUserReportCount(filter);
|
||||
if (count == 0) return null;
|
||||
if (count != 1)
|
||||
{
|
||||
SetErrorState("Multiple items found");
|
||||
return null;
|
||||
}
|
||||
SaxUserReport userReport = null;
|
||||
// Query data.
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
dbConnection.Open();
|
||||
UserReport_Db dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
dbUserReport.PopulateFrom(dbCommand, aliasUserReport, filter);
|
||||
userReport = CreateUserReport(dbUserReport);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SetErrorState("Database query exception");
|
||||
SaLogger.Warn(GetType().Name + ".GetUserReport\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
|
||||
}
|
||||
}
|
||||
return userReport;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item.
|
||||
public override bool IsValidUserReportData(SaxUserReport.Data data, SaxUserReport.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.IsValidUserReportData(data, errField)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert item.
|
||||
public override bool InsertUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".InsertUserReport";
|
||||
ClearErrorState();
|
||||
if (!IsValidUserReport(userReport)) return false;
|
||||
if (SysId.IsValid(userReport.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
dbConnection.Open();
|
||||
UserReport_Db dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
PopulateTo(dbUserReport, userReport, dbUpdateInfo);
|
||||
if (UserReport_Db.FieldsNonId.Contains("Id"))
|
||||
{
|
||||
// Generate next Id.
|
||||
dbUserReport._Id = CoreDatabase.GetNextIdFromTable("UserReport");
|
||||
}
|
||||
dbUserReport.ExecuteInsertCommand(dbCommand);
|
||||
userReport.Id = new SysId(dbUserReport._Id);
|
||||
userReport.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Inserted. " + GetLogProperties(userReport).Concat(": ").Concat("", "\n\t"));
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
}
|
||||
return !HasErrorState();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update item.
|
||||
public override bool UpdateUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".UpdateUserReport";
|
||||
ClearErrorState();
|
||||
if (!IsValidUserReport(userReport)) return false;
|
||||
if (!SysId.IsValid(userReport.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
|
||||
if (!userReport.Changed)
|
||||
{
|
||||
if (DebugMode) SaLogger.Debug(fn + " Data not changed. " + GetLogProperties(userReport).Concat(": ").Concat("", "\n\t"));
|
||||
return true;
|
||||
}
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
UserReport_Db dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
dbUserReport.PopulateFrom(dbCommand, aliasUserReport, "Id=" + SysId.ToString(userReport.Id));
|
||||
// ToDo SaxUpdateLogItemMonitor_UserReport updateLogMonitor = new SaxUpdateLogItemMonitor_UserReport(SessionContext, CreateUserReport(dbUserReport), dbUpdateInfo);
|
||||
// Update item.
|
||||
PopulateTo(dbUserReport, userReport, dbUpdateInfo);
|
||||
dbUserReport.ExecuteUpdateCommand(dbCommand);
|
||||
userReport.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Updated. " + GetLogProperties(userReport).Concat(": ").Concat("", "\n\t"));
|
||||
// Record updates.
|
||||
// ToDo updateLogMonitor.RecordUpdatedValues(userReport);
|
||||
// ToDo updateLogMonitor.LogUpdates();
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
}
|
||||
return !HasErrorState();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete item.
|
||||
public override bool UserReportCanBeDeleted(SaxUserReport userReport)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.UserReportCanBeDeleted(userReport)) return false;
|
||||
return true;
|
||||
}
|
||||
public override bool DeleteUserReport(SaxUserReport userReport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".DeleteUserReport";
|
||||
ClearErrorState();
|
||||
if (!UserReportCanBeDeleted(userReport)) return false;
|
||||
|
||||
// User Roles are logically deleted by changing the status.
|
||||
userReport.Status = SaStatus.Deleted;
|
||||
return UpdateUserReport(userReport, dbUpdateInfo);
|
||||
|
||||
/*
|
||||
* Physical deletion.
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
UserReport_Db dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
dbUserReport.PopulateFrom(dbCommand, aliasUserReport, "Id=" + userReport.Id.ToString());
|
||||
// Delete item.
|
||||
dbCommand.CommandType = System.Data.CommandType.Text;
|
||||
dbCommand.CommandText = "DELETE FROM " + SaxDbDfn_Support.GetTableName(SaxDbDfn_Support.TableIdx.UserReport) + " WHERE Id=" + SysId.ToString(userReport.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
userReport.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Deleted. " + GetLogProperties(userReport).Concat(": ").Concat("", "\n\t"));
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
}
|
||||
return !HasErrorState();
|
||||
*/
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Copy data properties to and from database.
|
||||
private void PopulateTo(UserReport_Db dbUserReport, SaxUserReport userReport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
dbUserReport._Id = SysId.ToLong(userReport.Id);
|
||||
dbUserReport._UserAccountId = SysId.ToInt(userReport.UserAccountId);
|
||||
dbUserReport._ReportType = (short)userReport.ReportType;
|
||||
dbUserReport._Title = userReport.Title;
|
||||
dbUserReport._Report = userReport.Report;
|
||||
dbUserReport._ReportData = userReport.ReportData;
|
||||
dbUserReport._RecordedOn = userReport.RecordedOn;
|
||||
// Common.
|
||||
dbUserReport._Notes = userReport.Notes;
|
||||
dbUserReport._Status = SacsSystem.GetStatusCode(userReport.Status);
|
||||
dbUserReport._Flags = (short)userReport.Flags;
|
||||
if (!SysId.IsValid(userReport.Id))
|
||||
{
|
||||
dbUserReport._CreateOn = DateTime.Now;
|
||||
dbUserReport._CreateBy = dbUpdateInfo.UserId.ToInt();
|
||||
dbUserReport._CreateHost = dbUpdateInfo.Host;
|
||||
}
|
||||
dbUserReport._UpdateOn = DateTime.Now;
|
||||
dbUserReport._UpdateBy = dbUpdateInfo.UserId.ToInt();
|
||||
dbUserReport._UpdateHost = dbUpdateInfo.Host;
|
||||
}
|
||||
private void PopulateFrom(UserReport_Db dbUserReport, SaxUserReport userReport)
|
||||
{
|
||||
//userReport.Id = new SysId(dbUserReport._Id);
|
||||
//userReport.UserAccountId = new SysId(dbUserReport._UserAccountId);
|
||||
userReport.ReportType = (Sax.UserReportType)dbUserReport._ReportType;
|
||||
userReport.Title = dbUserReport._Title;
|
||||
userReport.Report = dbUserReport._Report;
|
||||
userReport.ReportData = dbUserReport._ReportData;
|
||||
userReport.RecordedOn = dbUserReport._RecordedOn;
|
||||
// Common.
|
||||
userReport.Notes = dbUserReport._Notes;
|
||||
userReport.Status = SacsSystem.GetStatusForCode(dbUserReport._Status);
|
||||
userReport.SetCreateStamp(dbUserReport._CreateOn, new SysId(dbUserReport._CreateBy), dbUserReport._CreateHost);
|
||||
userReport.SetUpdateStamp(dbUserReport._UpdateOn, new SysId(dbUserReport._UpdateBy), dbUserReport._UpdateHost);
|
||||
userReport.AcceptChanges();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item column definitions.
|
||||
private static readonly String aliasUserReport = "UsrRpt";
|
||||
private static readonly String aliasUserReport_UserAccount = "UsrRpt_Usr";
|
||||
private static readonly String prefixUserReport_UserAccount = aliasUserReport_UserAccount + "_";
|
||||
private void SetUserReportColDfn
|
||||
(ColumnDfn col, String caption, int width, SaxDbDfn_Support.ColumnIdx dbCol,
|
||||
ColumnAlignment align = ColumnAlignment.Default, DataValue.DataType dataType = DataValue.DataType.String,
|
||||
String alias = "", String prefix = "")
|
||||
{
|
||||
if (String.IsNullOrEmpty(alias) && SaxDbDfn_Support.GetTableForColumn(dbCol) == SaxDbDfn_Support.TableIdx.UserReport)
|
||||
alias = aliasUserReport;
|
||||
col.Set(caption, width, (int)dbCol, prefix + SaxDbDfn_Support.GetColumnName(dbCol, false), SaxDbDfn_Support.GetColumnNameQual(dbCol, alias), dataType, align);
|
||||
if (dataType == DataValue.DataType.String && dbCol != SaxDbDfn_Support.ColumnIdx.Unknown)
|
||||
col.MaxLength = (int)SaxDbDfn_Support.GetColTextLen(dbCol);
|
||||
}
|
||||
public override ColumnDfn GetUserReportColumnDfn(SaxUserReport.Column columnId, string caption = "", int width = 0)
|
||||
{
|
||||
ColumnDfn columnDfn = new ColumnDfn((int)columnId, caption, width);
|
||||
switch (columnId)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
case SaxUserReport.Column.Pos:
|
||||
SetUserReportColDfn(columnDfn, "Pos", 60, SaxDbDfn_Support.ColumnIdx.Unknown, ColumnAlignment.Right);
|
||||
columnDfn.SortMode = ColumnDfn.ColumnSortMode.Off;
|
||||
columnDfn.ReadOnly = true;
|
||||
columnDfn.Resizable = false;
|
||||
break;
|
||||
case SaxUserReport.Column.UserAccountId:
|
||||
SetUserReportColDfn(columnDfn, "User Id", 80, SaxDbDfn_Support.ColumnIdx.UserReport_UserAccountId, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxUserReport.Column.Id:
|
||||
SetUserReportColDfn(columnDfn, "Id", 80, SaxDbDfn_Support.ColumnIdx.UserReport_Id, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
|
||||
//-------------------------------------------------------
|
||||
case SaxUserReport.Column.ReportType:
|
||||
SetUserReportColDfn(columnDfn, "Type", 80, SaxDbDfn_Support.ColumnIdx.UserReport_ReportType, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxUserReport.Column.ReportType_Desc:
|
||||
SetUserReportColDfn(columnDfn, "Type", 120, SaxDbDfn_Support.ColumnIdx.UserReport_ReportType, ColumnAlignment.Center);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxUserReport.Column.Title:
|
||||
SetUserReportColDfn(columnDfn, "Title", 120, SaxDbDfn_Support.ColumnIdx.UserReport_Title);
|
||||
break;
|
||||
case SaxUserReport.Column.Report:
|
||||
SetUserReportColDfn(columnDfn, "Report", 120, SaxDbDfn_Support.ColumnIdx.UserReport_Report);
|
||||
break;
|
||||
case SaxUserReport.Column.RecordedOn:
|
||||
SetUserReportColDfn(columnDfn, "Recorded", 100, SaxDbDfn_Support.ColumnIdx.UserReport_RecordedOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Derived properties.
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Common properties.
|
||||
case SaxUserReport.Column.Notes:
|
||||
SetUserReportColDfn(columnDfn, "Notes", 240, SaxDbDfn_Support.ColumnIdx.UserReport_Notes);
|
||||
break;
|
||||
case SaxUserReport.Column.Flags:
|
||||
SetUserReportColDfn(columnDfn, "Flags", 60, SaxDbDfn_Support.ColumnIdx.UserReport_Flags, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||
break;
|
||||
case SaxUserReport.Column.Status:
|
||||
SetUserReportColDfn(columnDfn, "Status", 80, SaxDbDfn_Support.ColumnIdx.UserReport_Status, ColumnAlignment.Center);
|
||||
break;
|
||||
case SaxUserReport.Column.Status_Desc:
|
||||
SetUserReportColDfn(columnDfn, "Status", 90, SaxDbDfn_Support.ColumnIdx.UserReport_Status, ColumnAlignment.Center);
|
||||
break;
|
||||
case SaxUserReport.Column.Status_Ind:
|
||||
SetUserReportColDfn(columnDfn, "Status", 80, SaxDbDfn_Support.ColumnIdx.UserReport_Status, ColumnAlignment.Center, DataValue.DataType.TriState);
|
||||
columnDfn.TriStateFormat = ColumnTriStateFormat.Lights;
|
||||
break;
|
||||
case SaxUserReport.Column.CreateOn_Date:
|
||||
SetUserReportColDfn(columnDfn, "Created", 80, SaxDbDfn_Support.ColumnIdx.UserReport_CreateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxUserReport.Column.UpdateOn_Date:
|
||||
SetUserReportColDfn(columnDfn, "Updated", 80, SaxDbDfn_Support.ColumnIdx.UserReport_UpdateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
if (!String.IsNullOrEmpty(caption))
|
||||
columnDfn.Caption = caption;
|
||||
if (width > 0)
|
||||
columnDfn.Width = width;
|
||||
return columnDfn;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item query filter.
|
||||
public override List<string> GetUserReportQueryFilter(SaxUserReport.Params prm)
|
||||
{
|
||||
List<String> filter = new List<String>();
|
||||
|
||||
// Item Ids.
|
||||
String idsIncluded = prm.IdsIncluded.Concat(",");
|
||||
if (!idsIncluded.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Id, aliasUserReport) + " IN (" + idsIncluded + ")");
|
||||
String idsxcluded = prm.IdsExcluded.Concat(",");
|
||||
if (!idsxcluded.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Id, aliasUserReport) + " NOT IN (" + idsxcluded + ")");
|
||||
|
||||
// User accounts.
|
||||
String userAccountIdsIncluded = prm.UserAccountIdsIncluded.Concat(",");
|
||||
if (!userAccountIdsIncluded.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_UserAccountId, aliasUserReport) + " IN (" + userAccountIdsIncluded + ")");
|
||||
|
||||
// Report Types.
|
||||
String reportTypes = prm.ReportTypesIncluded.Select(item => ((int)item).ToString()).Concat(",", "'", "'", true, true);
|
||||
if (!reportTypes.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_ReportType, aliasUserReport) + " IN (" + reportTypes + ")");
|
||||
|
||||
if (StringUtil.IsBlank(prm.UserReportFilter))
|
||||
{
|
||||
// Split filter into words.
|
||||
List<String> filterWords = prm.UserReportFilter.Split((char[])null).ToList();
|
||||
filterWords.RemoveDuplicatesCI();
|
||||
filterWords.RemoveBlanks();
|
||||
foreach (String filterWord in filterWords)
|
||||
{
|
||||
List<String> articleFilter = new List<String>();
|
||||
articleFilter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Title, aliasUserReport) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
|
||||
articleFilter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Report, aliasUserReport) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
|
||||
filter.Add(articleFilter.Concat(" OR ", "(", ")"));
|
||||
}
|
||||
}
|
||||
|
||||
// Title.
|
||||
if (!StringUtil.IsEmpty(prm.TitlePartial))
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Title, aliasUserReport) + " LIKE '%" + DbQuery.FormatForLike(prm.TitlePartial) + "%'");
|
||||
|
||||
// Report.
|
||||
if (!StringUtil.IsEmpty(prm.ReportPartial))
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Report, aliasUserReport) + " LIKE '%" + DbQuery.FormatForLike(prm.ReportPartial) + "%'");
|
||||
|
||||
// Notes.
|
||||
if (!StringUtil.IsEmpty(prm.NotesPartial))
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Notes, aliasUserReport) + " LIKE '%" + DbQuery.FormatForLike(prm.NotesPartial) + "%'");
|
||||
|
||||
// Status.
|
||||
if (prm.StatusCat != SaxUserReport.StatusCat.Any)
|
||||
filter.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Status, aliasUserReport) + GetUserReportStatusCatFilterCondition(prm.StatusCat));
|
||||
|
||||
if (filter.Count < 1) filter.Add("1=1");
|
||||
return filter;
|
||||
}
|
||||
internal static String GetUserReportStatusCatFilterCondition(SaxUserReport.StatusCat statusCat)
|
||||
{
|
||||
if (statusCat == SaxUserReport.StatusCat.Preparation)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Preparation) + "'";
|
||||
if (statusCat == SaxUserReport.StatusCat.Open)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.InProgress) + "'";
|
||||
if (statusCat == SaxUserReport.StatusCat.Completed)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Completed) + "'";
|
||||
if (statusCat == SaxUserReport.StatusCat.Cancelled)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Cancelled) + "'";
|
||||
if (statusCat == SaxUserReport.StatusCat.Closed)
|
||||
return " IN ('" + SacsSystem.GetStatusCode(SaStatus.Completed) + "','" + SacsSystem.GetStatusCode(SaStatus.Cancelled) + "')";
|
||||
if (statusCat == SaxUserReport.StatusCat.NotDeleted)
|
||||
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||
if (statusCat == SaxUserReport.StatusCat.Deleted)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||
return "";
|
||||
}
|
||||
// Item sort columns.
|
||||
public List<String> GetUserReportSortColumns(SaxUserReport.Params prm)
|
||||
{
|
||||
// Sort sequence:
|
||||
List<String> sortColumnNames = new List<String>();
|
||||
foreach (var columnDfn in prm.SortColumns)
|
||||
{
|
||||
// Need to ensure correct alias used for UserReport columns in case of conflict.
|
||||
String sortCol = String.Empty;
|
||||
if (SaxDbDfn_Support.GetTableForColumn((SaxDbDfn_Support.ColumnIdx)columnDfn.DbColumn) == SaxDbDfn_Support.TableIdx.UserReport)
|
||||
{
|
||||
sortCol = SaxDbDfn_Support.GetColumnNameQual((SaxDbDfn_Support.ColumnIdx)columnDfn.DbColumn, aliasUserReport);
|
||||
}
|
||||
else
|
||||
{
|
||||
sortCol = columnDfn.DataName;
|
||||
if (!StringUtil.IsEmpty(columnDfn.SortDataName))
|
||||
sortCol = columnDfn.SortDataName;
|
||||
}
|
||||
if (!sortCol.IsEmpty())
|
||||
{
|
||||
DbOrderByNullMode orderByNullMode = DbOrderByNullMode.Default; // eSaOrderByDemoteNulls, eSaOrderByPromoteNulls
|
||||
sortColumnNames.Add(DbQuery.FormatForOrderBy(sortCol, columnDfn.SortAscending, orderByNullMode).Concat(", "));
|
||||
}
|
||||
}
|
||||
sortColumnNames.RemoveBlanks();
|
||||
if (sortColumnNames.IsEmpty())
|
||||
{
|
||||
// Default sort columns.
|
||||
sortColumnNames.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Id, aliasUserReport) + " ASC");
|
||||
}
|
||||
return sortColumnNames;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item count.
|
||||
private long GetUserReportCount(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
return CoreDatabase.GetRowCount(SaxDbDfn_Support.GetTableName(SaxDbDfn_Support.TableIdx.UserReport) + " As " + aliasUserReport, filter);
|
||||
}
|
||||
public override long GetUserReportCount(SaxUserReport.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
return GetUserReportCount(GetUserReportQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public override List<SaxUserReport> GetUserReportList(SaxUserReport.Params prm)
|
||||
{
|
||||
List<SaxUserReport> userRoles = new List<SaxUserReport>();
|
||||
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
||||
qry.Tables.Add(SaxDbDfn_Support.GetTableName(SaxDbDfn_Support.TableIdx.UserReport), aliasUserReport);
|
||||
UserReport_Db dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
qry.Columns.AddRange(dbUserReport.ExistingColumnNames);
|
||||
qry.Filters.AddRange(GetUserReportQueryFilter(prm));
|
||||
qry.OrderBy.AddRange(GetUserReportSortColumns(prm));
|
||||
// Query data.
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
dbConnection.Open();
|
||||
dbCommand.CommandText = qry.BuildQuery(prm.ResultsPaging);
|
||||
using (DbDataReader dbDataReader = dbCommand.ExecuteReader())
|
||||
{
|
||||
while (dbDataReader.Read())
|
||||
{
|
||||
dbUserReport = new UserReport_Db(CoreDbInfo);
|
||||
dbUserReport.PopulateFrom(dbDataReader);
|
||||
userRoles.Add(CreateUserReport(dbUserReport));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn(GetType().Name + ".GetUserReportList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
|
||||
}
|
||||
}
|
||||
return userRoles;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item query execution.
|
||||
public override DbResultSet ExecuteUserReportQuery(List<ColumnDfn> columns, SaxUserReport.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Construct query.
|
||||
DbQuery query = new DbQuery(CoreDatabase.DbmsType);
|
||||
query.Tables.Add(SaxDbDfn_Support.GetTableName(SaxDbDfn_Support.TableIdx.UserReport), aliasUserReport);
|
||||
|
||||
// Add columns as defined in query list.
|
||||
if (columns.HasId(SaxUserReport.Column.Id))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Id, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.UserAccountId))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_UserAccountId, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.ReportType) || columns.HasId(SaxUserReport.Column.ReportType_Desc))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_ReportType, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.Title))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Title, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.Report))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Report, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.RecordedOn))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_RecordedOn, aliasUserReport));
|
||||
// Common properties.
|
||||
if (columns.HasId(SaxUserReport.Column.Notes))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Notes, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.Flags))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Flags, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.Status) || columns.HasId(SaxUserReport.Column.Status_Desc) || columns.HasId(SaxUserReport.Column.Status_Ind))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_Status, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.CreateOn_Date))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_CreateOn, aliasUserReport));
|
||||
if (columns.HasId(SaxUserReport.Column.UpdateOn_Date))
|
||||
query.Columns.Add(SaxDbDfn_Support.GetColumnNameQual(SaxDbDfn_Support.ColumnIdx.UserReport_UpdateOn, aliasUserReport));
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Populate filter.
|
||||
query.Filters.AddRange(GetUserReportQueryFilter(prm));
|
||||
|
||||
if (prm.IdsIncluded.Count != 1)
|
||||
{
|
||||
// Configure sort sequence.
|
||||
foreach (String sortColumn in GetUserReportSortColumns(prm))
|
||||
query.OrderBy.Add(sortColumn);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
//return new DbResultSet_DataTableReader(db, query.BuildQuery(prm.ResultsPaging));
|
||||
return DbResultSet_DataReader.ExecuteQuery(CoreDatabase, query.BuildQuery(prm.ResultsPaging));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Mgr.Support;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Standard.Dbas.Mgr.Support
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class SaxSupportMgr_Dbas : SaxSupportMgr
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaxSupportMgr_Dbas(SaxSessionContext sessionContext, SaxInternals internals) :
|
||||
base (sessionContext, internals)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -61,6 +61,23 @@
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>4</Pos>
|
||||
<Name>Title</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
<DataTypeNative>-9</DataTypeNative>
|
||||
<DataTypeNameNative>nvarchar</DataTypeNameNative>
|
||||
<IsIdentity>false</IsIdentity>
|
||||
<Size>1000</Size>
|
||||
<BufferLen>2000</BufferLen>
|
||||
<DecimalDigits>0</DecimalDigits>
|
||||
<Nullable>NoNulls</Nullable>
|
||||
<IsNullable>false</IsNullable>
|
||||
<Remarks />
|
||||
</DbDfnColumn>
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>5</Pos>
|
||||
<Name>Report</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
@@ -77,7 +94,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>5</Pos>
|
||||
<Pos>6</Pos>
|
||||
<Name>RecordedOn</Name>
|
||||
<DataType>DateTime</DataType>
|
||||
<DataTypeName />
|
||||
@@ -94,7 +111,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>6</Pos>
|
||||
<Pos>7</Pos>
|
||||
<Name>ReportData</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
@@ -111,7 +128,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>7</Pos>
|
||||
<Pos>8</Pos>
|
||||
<Name>Notes</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
@@ -128,7 +145,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>8</Pos>
|
||||
<Pos>9</Pos>
|
||||
<Name>Flags</Name>
|
||||
<DataType>SmallInt</DataType>
|
||||
<DataTypeName />
|
||||
@@ -145,7 +162,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>9</Pos>
|
||||
<Pos>10</Pos>
|
||||
<Name>Status</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
@@ -162,7 +179,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>10</Pos>
|
||||
<Pos>11</Pos>
|
||||
<Name>CreateOn</Name>
|
||||
<DataType>DateTime</DataType>
|
||||
<DataTypeName />
|
||||
@@ -179,7 +196,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>11</Pos>
|
||||
<Pos>12</Pos>
|
||||
<Name>CreateBy</Name>
|
||||
<DataType>Int</DataType>
|
||||
<DataTypeName />
|
||||
@@ -196,7 +213,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>12</Pos>
|
||||
<Pos>13</Pos>
|
||||
<Name>CreateHost</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
@@ -213,7 +230,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>13</Pos>
|
||||
<Pos>14</Pos>
|
||||
<Name>UpdateOn</Name>
|
||||
<DataType>DateTime</DataType>
|
||||
<DataTypeName />
|
||||
@@ -230,7 +247,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>14</Pos>
|
||||
<Pos>15</Pos>
|
||||
<Name>UpdateBy</Name>
|
||||
<DataType>Int</DataType>
|
||||
<DataTypeName />
|
||||
@@ -247,7 +264,7 @@
|
||||
<DbDfnColumn>
|
||||
<Schema>dbo</Schema>
|
||||
<Table>UserReport</Table>
|
||||
<Pos>15</Pos>
|
||||
<Pos>16</Pos>
|
||||
<Name>UpdateHost</Name>
|
||||
<DataType>VarChar</DataType>
|
||||
<DataTypeName />
|
||||
|
||||
Reference in New Issue
Block a user