bug fix IUserSettings
This commit is contained in:
parent
0965caaf40
commit
0cc82fec5d
5 changed files with 8 additions and 20 deletions
|
|
@ -8,7 +8,6 @@ namespace Yavsc.Controllers
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Models;
|
||||
using Models.Workflow;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
[Authorize("AdministratorOnly")]
|
||||
|
|
@ -18,7 +17,7 @@ namespace Yavsc.Controllers
|
|||
readonly IStringLocalizer<ActivityController> SR;
|
||||
readonly ILogger logger;
|
||||
|
||||
public ActivityController(ApplicationDbContext context,
|
||||
public ActivityController(ApplicationDbContext context,
|
||||
IStringLocalizer<ActivityController> SR,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
|
|
@ -65,15 +64,15 @@ namespace Yavsc.Controllers
|
|||
var existing = _context.Activities.Include(a => a.Children).FirstOrDefault(a => a.Code == code);
|
||||
if (existing == null) return acts;
|
||||
var pi = acts.FirstOrDefault(i => i.Value == existing.ParentCode);
|
||||
if (pi!=null) pi.Selected = true;
|
||||
if (pi!=null) pi.Selected = true;
|
||||
else nullItem.Selected = true;
|
||||
RecursivelyFilterChild(acts, existing);
|
||||
RecursivelyFilterChild(acts, existing);
|
||||
return acts;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters a activity selection list
|
||||
/// in order to exclude any descendant
|
||||
/// in order to exclude any descendant
|
||||
/// from the eligible list at the <c>Parent</c> property.
|
||||
/// WARN! results in a infinite loop when
|
||||
/// data is corrupted and there is a circularity
|
||||
|
|
@ -172,6 +171,7 @@ namespace Yavsc.Controllers
|
|||
_context.SaveChanges(User.GetUserId());
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
SetSettingClasseInfo();
|
||||
return View(activity);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using Microsoft.Extensions.Localization;
|
|||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Helpers;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Models;
|
||||
|
|
@ -16,8 +15,6 @@ namespace Yavsc.Controllers
|
|||
using Models.Workflow;
|
||||
using Services;
|
||||
using Yavsc.Interface;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Settings;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue