diff --git a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs index b1da0153..5f82611c 100644 --- a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs +++ b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs @@ -34,7 +34,7 @@ public interface IAccountApplication OperationResult DeActive(long id); OperationResult DirectLogin(long id); - AccountLeftWorkViewModel WorkshopList(long accountId); + // AccountLeftWorkViewModel WorkshopList(long accountId); OperationResult SaveWorkshopAccount( List workshopAccountList, string startDate, diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs index ff2fd102..7171f36d 100644 --- a/AccountManagement.Application/AccountApplication.cs +++ b/AccountManagement.Application/AccountApplication.cs @@ -745,25 +745,25 @@ public class AccountApplication : IAccountApplication } - public AccountLeftWorkViewModel WorkshopList(long accountId) - { - string fullname = this._accountRepository.GetById(accountId).Fullname; - List source = _accountLeftworkRepository.WorkshopList(accountId); - List userWorkshopIds = source.Select(x => x.WorkshopId).ToList(); - List allWorkshops = this._accountLeftworkRepository.GetAllWorkshops(); - List accountSelectList = this._accountRepository.GetAdminAccountSelectList(); - (string StartWorkFa, string LeftWorkFa) byAccountId = this._accountLeftworkRepository.GetByAccountId(accountId); - return new AccountLeftWorkViewModel() - { - AccountId = accountId, - AccountFullName = fullname, - StartDateFa = byAccountId.StartWorkFa, - LeftDateFa = byAccountId.LeftWorkFa, - WorkshopAccountlist = source, - WorkshopSelectList = new SelectList(allWorkshops.Where(x => !userWorkshopIds.Contains(x.Id)), "Id", "WorkshopFullName"), - AccountSelectList = new SelectList(accountSelectList, "Id", "Fullname") - }; - } + // public AccountLeftWorkViewModel WorkshopList(long accountId) + // { + // string fullname = this._accountRepository.GetById(accountId).Fullname; + // List source = _accountLeftworkRepository.WorkshopList(accountId); + // List userWorkshopIds = source.Select(x => x.WorkshopId).ToList(); + // List allWorkshops = this._accountLeftworkRepository.GetAllWorkshops(); + // List accountSelectList = this._accountRepository.GetAdminAccountSelectList(); + // (string StartWorkFa, string LeftWorkFa) byAccountId = this._accountLeftworkRepository.GetByAccountId(accountId); + // return new AccountLeftWorkViewModel() + // { + // AccountId = accountId, + // AccountFullName = fullname, + // StartDateFa = byAccountId.StartWorkFa, + // LeftDateFa = byAccountId.LeftWorkFa, + // WorkshopAccountlist = source, + // WorkshopSelectList = new SelectList(allWorkshops.Where(x => !userWorkshopIds.Contains(x.Id)), "Id", "WorkshopFullName"), + // AccountSelectList = new SelectList(accountSelectList, "Id", "Fullname") + // }; + // } public OperationResult SaveWorkshopAccount( List workshopAccountList, diff --git a/AccountManagement.Domain/AccountLeftWorkAgg/IAccountLeftworkRepository.cs b/AccountManagement.Domain/AccountLeftWorkAgg/IAccountLeftworkRepository.cs index c69d5653..5b3f776c 100644 --- a/AccountManagement.Domain/AccountLeftWorkAgg/IAccountLeftworkRepository.cs +++ b/AccountManagement.Domain/AccountLeftWorkAgg/IAccountLeftworkRepository.cs @@ -10,7 +10,7 @@ public interface IAccountLeftworkRepository : IRepository { (string StartWorkFa, string LeftWorkFa) GetByAccountId(long accountId); List WorkshopList(long accountId); - List GetAllWorkshops(); + // List GetAllWorkshops(); OperationResult CopyWorkshopToNewAccount(long currentAccountId, long newAccountId); diff --git a/AccountMangement.Infrastructure.EFCore/Repository/AccountLeftworkRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/AccountLeftworkRepository.cs index 245efbaa..67f904bd 100644 --- a/AccountMangement.Infrastructure.EFCore/Repository/AccountLeftworkRepository.cs +++ b/AccountMangement.Infrastructure.EFCore/Repository/AccountLeftworkRepository.cs @@ -18,14 +18,13 @@ public class AccountLeftworkRepository : RepositoryBase, { private readonly AccountContext _accountContext; private readonly IWorkshopAccountRepository _workshopAccountRepository; - private readonly IWorkshopApplication _workshopApplication; - public AccountLeftworkRepository(AccountContext accountContext, IWorkshopAccountRepository workshopAccountRepository, IWorkshopApplication workshopApplication) : base(accountContext) + public AccountLeftworkRepository(AccountContext accountContext, + IWorkshopAccountRepository workshopAccountRepository) : base(accountContext) { _accountContext = accountContext; _workshopAccountRepository = workshopAccountRepository; - _workshopApplication = workshopApplication; - } + } public (string StartWorkFa, string LeftWorkFa) GetByAccountId(long accountId) { @@ -58,14 +57,14 @@ public class AccountLeftworkRepository : RepositoryBase, }).ToList(); } - public List GetAllWorkshops() - { - return this._workshopApplication.GetWorkshopAll().Select(x => new WorkshopSelectList() - { - Id = x.Id, - WorkshopFullName = x.WorkshopFullName - }).ToList(); - } + // public List GetAllWorkshops() + // { + // return this._workshopApplication.GetWorkshopAll().Select(x => new WorkshopSelectList() + // { + // Id = x.Id, + // WorkshopFullName = x.WorkshopFullName + // }).ToList(); + // } public OperationResult CopyWorkshopToNewAccount(long currentAccountId, long newAccountId) { diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml index 45e5993d..03e3f716 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml @@ -268,10 +268,10 @@ href="#showmodal=@Url.Page("./Index", "Edit", new { Id = item.Id })"> - - - + @* *@ + @* *@ + @* *@ @if (item.IsActiveString == "true" && item.Role != "مدیر سیستم") { diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs index 902acf03..005202b8 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs @@ -316,14 +316,14 @@ public class IndexModel : PageModel }); } - public IActionResult OnGetAccountWorkshop(long id) - { - var res = _accountApplication.WorkshopList(id); - - - - return Partial("AccountLeftWork", res); - } + // public IActionResult OnGetAccountWorkshop(long id) + // { + // var res = _accountApplication.WorkshopList(id); + // + // + // + // return Partial("AccountLeftWork", res); + // } public IActionResult OnPostCreateAccountLeftWork( List workshopAccountlistViewModel, diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index cc950cf4..53ed6274 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -415,7 +415,6 @@ if (app.Environment.IsDevelopment()) } #endregion - //Create Http Pipeline #region Create Http Pipeline