Browse Source

添加Demo

master
boxu.zheng 1 year ago
parent
commit
f3eb2e63f8
  1. 25
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/CreateUpdateTestSchoolDto.cs
  2. 23
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/CreateUpdateTestStudentDetailDto.cs
  3. 29
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/TestSchoolDto.cs
  4. 27
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/TestStudentDetailDto.cs
  5. 21
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/ITestSchoolAppService.cs
  6. 21
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/ITestStudentDetailAppService.cs
  7. 12
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissionDefinitionProvider.cs
  8. 22
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissions.cs
  9. 30
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBusiness/TestSchool/TestSchoolAppService.cs
  10. 30
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBusiness/TestSchool/TestStudentDetailAppService.cs
  11. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationAutoMapperProfile.cs
  12. 28
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ar.json
  13. 3
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/AppBusiness/TestSchool/ITestSchoolRepository.cs
  14. 3
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/AppBusiness/TestSchool/ITestStudentDetailRepository.cs
  15. 22
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestSchoolEfCoreQuerableExtensions.cs
  16. 20
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestSchoolRepository.cs
  17. 22
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestStudentDetailEfCoreQuerableExtensions.cs
  18. 20
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestStudentDetailRepository.cs
  19. 32
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContext.cs
  20. 5
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEntityFrameworkCoreModule.cs
  21. 1984
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614095851_Added_School_Entity.Designer.cs
  22. 82
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614095851_Added_School_Entity.cs
  23. 114
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/WininDbContextModelSnapshot.cs
  24. 20
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenuContributor.cs
  25. 4
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenus.cs
  26. 18
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/CreateModal.cshtml
  27. 27
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/CreateModal.cshtml.cs
  28. 19
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/EditModal.cshtml
  29. 38
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/EditModal.cshtml.cs
  30. 48
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/Index.cshtml
  31. 14
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/Index.cshtml.cs
  32. 18
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/ViewModels/CreateEditTestSchoolViewModel.cs
  33. 0
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/index.css
  34. 70
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/index.js
  35. 18
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/CreateModal.cshtml
  36. 27
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/CreateModal.cshtml.cs
  37. 19
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/EditModal.cshtml
  38. 38
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/EditModal.cshtml.cs
  39. 48
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/Index.cshtml
  40. 14
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/Index.cshtml.cs
  41. 17
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/ViewModels/CreateEditTestStudentDetailViewModel.cs
  42. 0
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/index.css
  43. 74
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/index.js
  44. 10
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebAutoMapperProfile.cs

25
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/CreateUpdateTestSchoolDto.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using Faster.Zheng.Winin.Enums;
using Faster.Zheng.Winin.Permissions;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
[Serializable]
public class CreateUpdateTestSchoolDto
{
/// <summary>
///
/// </summary>
public string SchoolName { get; set; }
/// <summary>
///
/// </summary>
public SchoolType OrderType { get; set; }
/// <summary>
///
/// </summary>
public List<WininPermissions.TestStudentDetail> Details { get; set; }
}

23
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/CreateUpdateTestStudentDetailDto.cs

@ -0,0 +1,23 @@
using System;
using Faster.Zheng.Winin.Enums;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
[Serializable]
public class CreateUpdateTestStudentDetailDto
{
/// <summary>
///
/// </summary>
public Guid MasterId { get; set; }
/// <summary>
///
/// </summary>
public string StudentName { get; set; }
/// <summary>
///
/// </summary>
public StudentType OrderType { get; set; }
}

29
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/TestSchoolDto.cs

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using Faster.Zheng.Winin.Enums;
using Faster.Zheng.Winin.Permissions;
using Volo.Abp.Application.Dtos;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
/// <summary>
///
/// </summary>
[Serializable]
public class TestSchoolDto : AuditedEntityDto<Guid>
{
/// <summary>
///
/// </summary>
public string SchoolName { get; set; }
/// <summary>
///
/// </summary>
public SchoolType OrderType { get; set; }
/// <summary>
///
/// </summary>
public List<WininPermissions.TestStudentDetail> Details { get; set; }
}

27
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/Dtos/TestStudentDetailDto.cs

@ -0,0 +1,27 @@
using System;
using Faster.Zheng.Winin.Enums;
using Volo.Abp.Application.Dtos;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
/// <summary>
///
/// </summary>
[Serializable]
public class TestStudentDetailDto : AuditedEntityDto<Guid>
{
/// <summary>
///
/// </summary>
public Guid MasterId { get; set; }
/// <summary>
///
/// </summary>
public string StudentName { get; set; }
/// <summary>
///
/// </summary>
public StudentType OrderType { get; set; }
}

21
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/ITestSchoolAppService.cs

@ -0,0 +1,21 @@
using System;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public interface ITestSchoolAppService :
ICrudAppService<
TestSchoolDto,
Guid,
PagedAndSortedResultRequestDto,
CreateUpdateTestSchoolDto,
CreateUpdateTestSchoolDto>
{
}

21
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBusiness/TestSchool/ITestStudentDetailAppService.cs

@ -0,0 +1,21 @@
using System;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public interface ITestStudentDetailAppService :
ICrudAppService<
TestStudentDetailDto,
Guid,
PagedAndSortedResultRequestDto,
CreateUpdateTestStudentDetailDto,
CreateUpdateTestStudentDetailDto>
{
}

12
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissionDefinitionProvider.cs

@ -1,4 +1,4 @@
using Faster.Zheng.Winin.Localization;
using Faster.Zheng.Winin.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
@ -11,6 +11,16 @@ public class WininPermissionDefinitionProvider : PermissionDefinitionProvider
var myGroup = context.AddGroup(WininPermissions.GroupName);
//Define your own permissions here. Example:
//myGroup.AddPermission(WininPermissions.MyPermission1, L("Permission:MyPermission1"));
var testSchoolPermission = myGroup.AddPermission(WininPermissions.TestSchool.Default, L("Permission:TestSchool"));
testSchoolPermission.AddChild(WininPermissions.TestSchool.Create, L("Permission:Create"));
testSchoolPermission.AddChild(WininPermissions.TestSchool.Update, L("Permission:Update"));
testSchoolPermission.AddChild(WininPermissions.TestSchool.Delete, L("Permission:Delete"));
var testStudentDetailPermission = myGroup.AddPermission(WininPermissions.TestStudentDetail.Default, L("Permission:TestStudentDetail"));
testStudentDetailPermission.AddChild(WininPermissions.TestStudentDetail.Create, L("Permission:Create"));
testStudentDetailPermission.AddChild(WininPermissions.TestStudentDetail.Update, L("Permission:Update"));
testStudentDetailPermission.AddChild(WininPermissions.TestStudentDetail.Delete, L("Permission:Delete"));
}
private static LocalizableString L(string name)

22
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissions.cs

@ -1,4 +1,4 @@
namespace Faster.Zheng.Winin.Permissions;
namespace Faster.Zheng.Winin.Permissions;
public static class WininPermissions
{
@ -6,4 +6,24 @@ public static class WininPermissions
//Add your own permission names. Example:
//public const string MyPermission1 = GroupName + ".MyPermission1";
/// <summary>
///
/// </summary>
public class TestSchool
{
public const string Default = GroupName + ".TestSchool";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
public const string Delete = Default + ".Delete";
}
/// <summary>
///
/// </summary>
public class TestStudentDetail
{
public const string Default = GroupName + ".TestStudentDetail";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
public const string Delete = Default + ".Delete";
}
}

30
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBusiness/TestSchool/TestSchoolAppService.cs

@ -0,0 +1,30 @@
using System;
using Faster.Zheng.Winin.AppBase;
using Faster.Zheng.Winin.Permissions;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public class TestSchoolAppService : ZbxBase<TestSchool, TestSchoolDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateTestSchoolDto, CreateUpdateTestSchoolDto>,
ITestSchoolAppService
{
protected override string GetPolicyName { get; set; } = WininPermissions.TestSchool.Default;
protected override string GetListPolicyName { get; set; } = WininPermissions.TestSchool.Default;
protected override string CreatePolicyName { get; set; } = WininPermissions.TestSchool.Create;
protected override string UpdatePolicyName { get; set; } = WininPermissions.TestSchool.Update;
protected override string DeletePolicyName { get; set; } = WininPermissions.TestSchool.Delete;
private readonly ITestSchoolRepository _repository;
public TestSchoolAppService(ITestSchoolRepository repository) : base(repository)
{
_repository = repository;
}
}

30
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBusiness/TestSchool/TestStudentDetailAppService.cs

@ -0,0 +1,30 @@
using System;
using Faster.Zheng.Winin.AppBase;
using Faster.Zheng.Winin.Permissions;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public class TestStudentDetailAppService : ZbxBase<TestStudentDetail, TestStudentDetailDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateTestStudentDetailDto, CreateUpdateTestStudentDetailDto>,
ITestStudentDetailAppService
{
protected override string GetPolicyName { get; set; } = WininPermissions.TestStudentDetail.Default;
protected override string GetListPolicyName { get; set; } = WininPermissions.TestStudentDetail.Default;
protected override string CreatePolicyName { get; set; } = WininPermissions.TestStudentDetail.Create;
protected override string UpdatePolicyName { get; set; } = WininPermissions.TestStudentDetail.Update;
protected override string DeletePolicyName { get; set; } = WininPermissions.TestStudentDetail.Delete;
private readonly ITestStudentDetailRepository _repository;
public TestStudentDetailAppService(ITestStudentDetailRepository repository) : base(repository)
{
_repository = repository;
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationAutoMapperProfile.cs

@ -1,4 +1,6 @@
using AutoMapper;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using AutoMapper;
namespace Faster.Zheng.Winin;
@ -9,5 +11,9 @@ public class WininApplicationAutoMapperProfile : Profile
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<TestSchool, TestSchoolDto>();
CreateMap<CreateUpdateTestSchoolDto, TestSchool>(MemberList.Source);
CreateMap<TestStudentDetail, TestStudentDetailDto>();
CreateMap<CreateUpdateTestStudentDetailDto, TestStudentDetail>(MemberList.Source);
}
}

28
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ar.json

@ -1,8 +1,30 @@
{
"culture": "ar",
"texts": {
"Menu:Home": "الرئيسية",
"Menu:Home": "الصفحة الرئيسية",
"LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io."
"LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io.",
"Permission:TestSchool": "TestSchool",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:TestSchool": "MenuTestSchool",
"TestSchool": "TestSchool",
"TestSchoolSchoolName": "TestSchoolSchoolName",
"TestSchoolOrderType": "TestSchoolOrderType",
"TestSchoolDetails": "TestSchoolDetails",
"CreateTestSchool": "CreateTestSchool",
"EditTestSchool": "EditTestSchool",
"TestSchoolDeletionConfirmationMessage": "Are you sure to delete the testSchool {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"TableFilter": "TableFilter",
"Permission:TestStudentDetail": "TestStudentDetail",
"Menu:TestStudentDetail": "MenuTestStudentDetail",
"TestStudentDetail": "TestStudentDetail",
"TestStudentDetailMasterId": "TestStudentDetailMasterId",
"TestStudentDetailStudentName": "TestStudentDetailStudentName",
"TestStudentDetailOrderType": "TestStudentDetailOrderType",
"CreateTestStudentDetail": "CreateTestStudentDetail",
"EditTestStudentDetail": "EditTestStudentDetail",
"TestStudentDetailDeletionConfirmationMessage": "Are you sure to delete the testStudentDetail {0}?"
}
}
}

3
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/AppBusiness/TestSchool/ITestSchoolRepository.cs

@ -3,6 +3,9 @@ using Volo.Abp.Domain.Repositories;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public interface ITestSchoolRepository : IRepository<TestSchool, Guid>
{
}

3
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/AppBusiness/TestSchool/ITestStudentDetailRepository.cs

@ -3,6 +3,9 @@ using Volo.Abp.Domain.Repositories;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public interface ITestStudentDetailRepository : IRepository<TestStudentDetail, Guid>
{
}

22
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestSchoolEfCoreQuerableExtensions.cs

@ -0,0 +1,22 @@
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public static class TestSchoolEfCoreQueryableExtensions
{
public static IQueryable<TestSchool> IncludeDetails(this IQueryable<TestSchool> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
// .Include(x => x.xxx) // TODO: AbpHelper generated
;
}
}

20
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestSchoolRepository.cs

@ -0,0 +1,20 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Faster.Zheng.Winin.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
public class TestSchoolRepository : EfCoreRepository<WininDbContext, TestSchool, Guid>, ITestSchoolRepository
{
public TestSchoolRepository(IDbContextProvider<WininDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public override async Task<IQueryable<TestSchool>> WithDetailsAsync()
{
return (await GetQueryableAsync()).IncludeDetails();
}
}

22
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestStudentDetailEfCoreQuerableExtensions.cs

@ -0,0 +1,22 @@
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
/// <summary>
///
/// </summary>
public static class TestStudentDetailEfCoreQueryableExtensions
{
public static IQueryable<TestStudentDetail> IncludeDetails(this IQueryable<TestStudentDetail> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
// .Include(x => x.xxx) // TODO: AbpHelper generated
;
}
}

20
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/AppBusiness/TestSchool/TestStudentDetailRepository.cs

@ -0,0 +1,20 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Faster.Zheng.Winin.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace Faster.Zheng.Winin.AppBusiness.TestSchool;
public class TestStudentDetailRepository : EfCoreRepository<WininDbContext, TestStudentDetail, Guid>, ITestStudentDetailRepository
{
public TestStudentDetailRepository(IDbContextProvider<WininDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public override async Task<IQueryable<TestStudentDetail>> WithDetailsAsync()
{
return (await GetQueryableAsync()).IncludeDetails();
}
}

32
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContext.cs

@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.Data;
@ -12,6 +12,8 @@ using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
@ -52,6 +54,14 @@ public class WininDbContext :
public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; }
#endregion
/// <summary>
///
/// </summary>
public DbSet<TestSchool> TestSchools { get; set; }
/// <summary>
///
/// </summary>
public DbSet<TestStudentDetail> TestStudentDetails { get; set; }
public WininDbContext(DbContextOptions<WininDbContext> options)
: base(options)
@ -82,5 +92,25 @@ public class WininDbContext :
// b.ConfigureByConvention(); //auto configure for the base class props
// //...
//});
builder.Entity<TestSchool>(b =>
{
b.ToTable(WininConsts.DbTablePrefix + "TestSchools", WininConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
/* Configure more properties here */
});
builder.Entity<TestStudentDetail>(b =>
{
b.ToTable(WininConsts.DbTablePrefix + "TestStudentDetails", WininConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
/* Configure more properties here */
});
}
}

5
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEntityFrameworkCoreModule.cs

@ -1,4 +1,5 @@
using System;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using System;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Uow;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -41,6 +42,8 @@ public class WininEntityFrameworkCoreModule : AbpModule
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
options.AddRepository<TestSchool, TestSchoolRepository>();
options.AddRepository<TestStudentDetail, TestStudentDetailRepository>();
});
Configure<AbpDbContextOptions>(options =>

1984
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614095851_Added_School_Entity.Designer.cs

File diff suppressed because it is too large

82
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614095851_Added_School_Entity.cs

@ -0,0 +1,82 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Faster.Zheng.Winin.Migrations
{
/// <inheritdoc />
public partial class AddedSchoolEntity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppTestSchools",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SchoolName = table.Column<string>(type: "nvarchar(450)", nullable: false),
OrderType = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppTestSchools", x => x.Id);
},
comment: "");
migrationBuilder.CreateTable(
name: "AppTestStudentDetails",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MasterId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
StudentName = table.Column<string>(type: "nvarchar(max)", nullable: false),
OrderType = table.Column<int>(type: "int", nullable: false),
TestSchoolId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppTestStudentDetails", x => x.Id);
table.ForeignKey(
name: "FK_AppTestStudentDetails_AppTestSchools_TestSchoolId",
column: x => x.TestSchoolId,
principalTable: "AppTestSchools",
principalColumn: "Id");
},
comment: "");
migrationBuilder.CreateIndex(
name: "IX_AppTestSchools_SchoolName_OrderType",
table: "AppTestSchools",
columns: new[] { "SchoolName", "OrderType" });
migrationBuilder.CreateIndex(
name: "IX_AppTestStudentDetails_TestSchoolId",
table: "AppTestStudentDetails",
column: "TestSchoolId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppTestStudentDetails");
migrationBuilder.DropTable(
name: "AppTestSchools");
}
}
}

114
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/WininDbContextModelSnapshot.cs

@ -24,6 +24,108 @@ namespace Faster.Zheng.Winin.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Faster.Zheng.Winin.AppBusiness.TestSchool.TestSchool", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<int>("OrderType")
.HasColumnType("int");
b.Property<string>("SchoolName")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("SchoolName", "OrderType");
b.ToTable("AppTestSchools", null, t =>
{
t.HasComment("");
});
});
modelBuilder.Entity("Faster.Zheng.Winin.AppBusiness.TestSchool.TestStudentDetail", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<Guid>("MasterId")
.HasColumnType("uniqueidentifier");
b.Property<int>("OrderType")
.HasColumnType("int");
b.Property<string>("StudentName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("TestSchoolId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("TestSchoolId");
b.ToTable("AppTestStudentDetails", null, t =>
{
t.HasComment("");
});
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
@ -1680,6 +1782,13 @@ namespace Faster.Zheng.Winin.Migrations
b.ToTable("AbpTenantConnectionStrings", (string)null);
});
modelBuilder.Entity("Faster.Zheng.Winin.AppBusiness.TestSchool.TestStudentDetail", b =>
{
b.HasOne("Faster.Zheng.Winin.AppBusiness.TestSchool.TestSchool", null)
.WithMany("Details")
.HasForeignKey("TestSchoolId");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
@ -1822,6 +1931,11 @@ namespace Faster.Zheng.Winin.Migrations
.IsRequired();
});
modelBuilder.Entity("Faster.Zheng.Winin.AppBusiness.TestSchool.TestSchool", b =>
{
b.Navigation("Details");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");

20
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenuContributor.cs

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Faster.Zheng.Winin.Permissions;
using Faster.Zheng.Winin.Localization;
using Faster.Zheng.Winin.MultiTenancy;
using Volo.Abp.Identity.Web.Navigation;
@ -18,7 +19,7 @@ public class WininMenuContributor : IMenuContributor
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<WininResource>();
@ -46,6 +47,19 @@ public class WininMenuContributor : IMenuContributor
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenuNames.GroupName, 3);
return Task.CompletedTask;
if (await context.IsGrantedAsync(WininPermissions.TestSchool.Default))
{
context.Menu.AddItem(
new ApplicationMenuItem(WininMenus.TestSchool, l["Menu:TestSchool"], "/AppBusiness/TestSchool/TestSchool")
);
}
if (await context.IsGrantedAsync(WininPermissions.TestStudentDetail.Default))
{
context.Menu.AddItem(
new ApplicationMenuItem(WininMenus.TestStudentDetail, l["Menu:TestStudentDetail"], "/AppBusiness/TestSchool/TestStudentDetail")
);
}
//return Task.CompletedTask;
}
}

4
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenus.cs

@ -1,4 +1,4 @@
namespace Faster.Zheng.Winin.Web.Menus;
namespace Faster.Zheng.Winin.Web.Menus;
public class WininMenus
{
@ -7,4 +7,6 @@ public class WininMenus
//Add your menu items here...
public const string TestSchool = Prefix + ".TestSchool";
public const string TestStudentDetail = Prefix + ".TestStudentDetail";
}

18
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/CreateModal.cshtml

@ -0,0 +1,18 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal;
@using Faster.Zheng.Winin.Localization
@inject IHtmlLocalizer<WininResource> L
@model Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.CreateModalModel
@{
Layout = null;
}
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal">
<abp-modal>
<abp-modal-header title="@L["CreateTestSchool"].Value"></abp-modal-header>
<abp-modal-body>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</abp-dynamic-form>

27
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/CreateModal.cshtml.cs

@ -0,0 +1,27 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.ViewModels;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool;
public class CreateModalModel : WininPageModel
{
[BindProperty]
public CreateEditTestSchoolViewModel ViewModel { get; set; }
private readonly ITestSchoolAppService _service;
public CreateModalModel(ITestSchoolAppService service)
{
_service = service;
}
public virtual async Task<IActionResult> OnPostAsync()
{
var dto = ObjectMapper.Map<CreateEditTestSchoolViewModel, CreateUpdateTestSchoolDto>(ViewModel);
await _service.CreateAsync(dto);
return NoContent();
}
}

19
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/EditModal.cshtml

@ -0,0 +1,19 @@
@page
@using Faster.Zheng.Winin.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal;
@inject IHtmlLocalizer<WininResource> L
@model Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.EditModalModel
@{
Layout = null;
}
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal">
<abp-modal>
<abp-modal-header title="@L["EditTestSchool"].Value"></abp-modal-header>
<abp-modal-body>
<abp-input asp-for="Id" />
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</abp-dynamic-form>

38
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/EditModal.cshtml.cs

@ -0,0 +1,38 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.ViewModels;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool;
public class EditModalModel : WininPageModel
{
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid Id { get; set; }
[BindProperty]
public CreateEditTestSchoolViewModel ViewModel { get; set; }
private readonly ITestSchoolAppService _service;
public EditModalModel(ITestSchoolAppService service)
{
_service = service;
}
public virtual async Task OnGetAsync()
{
var dto = await _service.GetAsync(Id);
ViewModel = ObjectMapper.Map<TestSchoolDto, CreateEditTestSchoolViewModel>(dto);
}
public virtual async Task<IActionResult> OnPostAsync()
{
var dto = ObjectMapper.Map<CreateEditTestSchoolViewModel, CreateUpdateTestSchoolDto>(ViewModel);
await _service.UpdateAsync(Id, dto);
return NoContent();
}
}

48
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/Index.cshtml

@ -0,0 +1,48 @@
@page
@using Faster.Zheng.Winin.Permissions
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool
@using Faster.Zheng.Winin.Localization
@using Faster.Zheng.Winin.Web.Menus
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<WininResource> L
@inject IAuthorizationService Authorization
@{
PageLayout.Content.Title = L["TestSchool"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:TestSchool"].Value);
PageLayout.Content.MenuItemName = WininMenus.TestSchool;
}
@section scripts
{
<abp-script src="/Pages/AppBusiness/TestSchool/TestSchool/index.js" />
}
@section styles
{
<abp-style src="/Pages/AppBusiness/TestSchool/TestSchool/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["TestSchool"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-end">
@if (await Authorization.IsGrantedAsync(WininPermissions.TestSchool.Create))
{
<abp-button id="NewTestSchoolButton"
text="@L["CreateTestSchool"].Value"
icon="plus"
button-type="Primary" />
}
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="TestSchoolTable" class="nowrap"/>
</abp-card-body>
</abp-card>

14
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/Index.cshtml.cs

@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool;
public class IndexModel : WininPageModel
{
public virtual async Task OnGetAsync()
{
await Task.CompletedTask;
}
}

18
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/ViewModels/CreateEditTestSchoolViewModel.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Faster.Zheng.Winin.Enums;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.ViewModels;
public class CreateEditTestSchoolViewModel
{
[Display(Name = "TestSchoolSchoolName")]
public string SchoolName { get; set; }
[Display(Name = "TestSchoolOrderType")]
public SchoolType OrderType { get; set; }
[Display(Name = "TestSchoolDetails")]
public List<Winin.AppBusiness.TestSchool.TestStudentDetail> Details { get; set; }
}

0
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/index.css

70
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestSchool/index.js

@ -0,0 +1,70 @@
$(function () {
var l = abp.localization.getResource('Winin');
var service = faster.zheng.winin.appBusiness.testSchool.testSchool;
var createModal = new abp.ModalManager(abp.appPath + 'AppBusiness/TestSchool/TestSchool/CreateModal');
var editModal = new abp.ModalManager(abp.appPath + 'AppBusiness/TestSchool/TestSchool/EditModal');
var dataTable = $('#TestSchoolTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[0, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Edit'),
visible: abp.auth.isGranted('Winin.TestSchool.Update'),
action: function (data) {
editModal.open({ id: data.record.id });
}
},
{
text: l('Delete'),
visible: abp.auth.isGranted('Winin.TestSchool.Delete'),
confirmMessage: function (data) {
return l('TestSchoolDeletionConfirmationMessage', data.record.id);
},
action: function (data) {
service.delete(data.record.id)
.then(function () {
abp.notify.info(l('SuccessfullyDeleted'));
dataTable.ajax.reload();
});
}
}
]
}
},
{
title: l('TestSchoolSchoolName'),
data: "schoolName"
},
{
title: l('TestSchoolOrderType'),
data: "orderType"
},
]
}));
createModal.onResult(function () {
dataTable.ajax.reload();
});
editModal.onResult(function () {
dataTable.ajax.reload();
});
$('#NewTestSchoolButton').click(function (e) {
e.preventDefault();
createModal.open();
});
});

18
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/CreateModal.cshtml

@ -0,0 +1,18 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal;
@using Faster.Zheng.Winin.Localization
@inject IHtmlLocalizer<WininResource> L
@model Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.CreateModalModel
@{
Layout = null;
}
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal">
<abp-modal>
<abp-modal-header title="@L["CreateTestStudentDetail"].Value"></abp-modal-header>
<abp-modal-body>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</abp-dynamic-form>

27
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/CreateModal.cshtml.cs

@ -0,0 +1,27 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.ViewModels;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail;
public class CreateModalModel : WininPageModel
{
[BindProperty]
public CreateEditTestStudentDetailViewModel ViewModel { get; set; }
private readonly ITestStudentDetailAppService _service;
public CreateModalModel(ITestStudentDetailAppService service)
{
_service = service;
}
public virtual async Task<IActionResult> OnPostAsync()
{
var dto = ObjectMapper.Map<CreateEditTestStudentDetailViewModel, CreateUpdateTestStudentDetailDto>(ViewModel);
await _service.CreateAsync(dto);
return NoContent();
}
}

19
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/EditModal.cshtml

@ -0,0 +1,19 @@
@page
@using Faster.Zheng.Winin.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal;
@inject IHtmlLocalizer<WininResource> L
@model Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.EditModalModel
@{
Layout = null;
}
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal">
<abp-modal>
<abp-modal-header title="@L["EditTestStudentDetail"].Value"></abp-modal-header>
<abp-modal-body>
<abp-input asp-for="Id" />
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</abp-dynamic-form>

38
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/EditModal.cshtml.cs

@ -0,0 +1,38 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Faster.Zheng.Winin.AppBusiness.TestSchool;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.ViewModels;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail;
public class EditModalModel : WininPageModel
{
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid Id { get; set; }
[BindProperty]
public CreateEditTestStudentDetailViewModel ViewModel { get; set; }
private readonly ITestStudentDetailAppService _service;
public EditModalModel(ITestStudentDetailAppService service)
{
_service = service;
}
public virtual async Task OnGetAsync()
{
var dto = await _service.GetAsync(Id);
ViewModel = ObjectMapper.Map<TestStudentDetailDto, CreateEditTestStudentDetailViewModel>(dto);
}
public virtual async Task<IActionResult> OnPostAsync()
{
var dto = ObjectMapper.Map<CreateEditTestStudentDetailViewModel, CreateUpdateTestStudentDetailDto>(ViewModel);
await _service.UpdateAsync(Id, dto);
return NoContent();
}
}

48
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/Index.cshtml

@ -0,0 +1,48 @@
@page
@using Faster.Zheng.Winin.Permissions
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail
@using Faster.Zheng.Winin.Localization
@using Faster.Zheng.Winin.Web.Menus
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<WininResource> L
@inject IAuthorizationService Authorization
@{
PageLayout.Content.Title = L["TestStudentDetail"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:TestStudentDetail"].Value);
PageLayout.Content.MenuItemName = WininMenus.TestStudentDetail;
}
@section scripts
{
<abp-script src="/Pages/AppBusiness/TestSchool/TestStudentDetail/index.js" />
}
@section styles
{
<abp-style src="/Pages/AppBusiness/TestSchool/TestStudentDetail/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["TestStudentDetail"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-end">
@if (await Authorization.IsGrantedAsync(WininPermissions.TestStudentDetail.Create))
{
<abp-button id="NewTestStudentDetailButton"
text="@L["CreateTestStudentDetail"].Value"
icon="plus"
button-type="Primary" />
}
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="TestStudentDetailTable" class="nowrap"/>
</abp-card-body>
</abp-card>

14
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/Index.cshtml.cs

@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail;
public class IndexModel : WininPageModel
{
public virtual async Task OnGetAsync()
{
await Task.CompletedTask;
}
}

17
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/ViewModels/CreateEditTestStudentDetailViewModel.cs

@ -0,0 +1,17 @@
using System;
using System.ComponentModel.DataAnnotations;
using Faster.Zheng.Winin.Enums;
namespace Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.ViewModels;
public class CreateEditTestStudentDetailViewModel
{
[Display(Name = "TestStudentDetailMasterId")]
public Guid MasterId { get; set; }
[Display(Name = "TestStudentDetailStudentName")]
public string StudentName { get; set; }
[Display(Name = "TestStudentDetailOrderType")]
public StudentType OrderType { get; set; }
}

0
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/index.css

74
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/AppBusiness/TestSchool/TestStudentDetail/index.js

@ -0,0 +1,74 @@
$(function () {
var l = abp.localization.getResource('Winin');
var service = faster.zheng.winin.appBusiness.testSchool.testStudentDetail;
var createModal = new abp.ModalManager(abp.appPath + 'AppBusiness/TestSchool/TestStudentDetail/CreateModal');
var editModal = new abp.ModalManager(abp.appPath + 'AppBusiness/TestSchool/TestStudentDetail/EditModal');
var dataTable = $('#TestStudentDetailTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[0, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Edit'),
visible: abp.auth.isGranted('Winin.TestStudentDetail.Update'),
action: function (data) {
editModal.open({ id: data.record.id });
}
},
{
text: l('Delete'),
visible: abp.auth.isGranted('Winin.TestStudentDetail.Delete'),
confirmMessage: function (data) {
return l('TestStudentDetailDeletionConfirmationMessage', data.record.id);
},
action: function (data) {
service.delete(data.record.id)
.then(function () {
abp.notify.info(l('SuccessfullyDeleted'));
dataTable.ajax.reload();
});
}
}
]
}
},
{
title: l('TestStudentDetailMasterId'),
data: "masterId"
},
{
title: l('TestStudentDetailStudentName'),
data: "studentName"
},
{
title: l('TestStudentDetailOrderType'),
data: "orderType"
},
]
}));
createModal.onResult(function () {
dataTable.ajax.reload();
});
editModal.onResult(function () {
dataTable.ajax.reload();
});
$('#NewTestStudentDetailButton').click(function (e) {
e.preventDefault();
createModal.open();
});
});

10
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebAutoMapperProfile.cs

@ -1,4 +1,8 @@
using AutoMapper;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestSchool.ViewModels;
using Faster.Zheng.Winin.AppBusiness.TestSchool.Dtos;
using Faster.Zheng.Winin.Web.Pages.AppBusiness.TestSchool.TestStudentDetail.ViewModels;
using AutoMapper;
namespace Faster.Zheng.Winin.Web;
@ -7,5 +11,9 @@ public class WininWebAutoMapperProfile : Profile
public WininWebAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Web project.
CreateMap<TestSchoolDto, CreateEditTestSchoolViewModel>();
CreateMap<CreateEditTestSchoolViewModel, CreateUpdateTestSchoolDto>();
CreateMap<TestStudentDetailDto, CreateEditTestStudentDetailViewModel>();
CreateMap<CreateEditTestStudentDetailViewModel, CreateUpdateTestStudentDetailDto>();
}
}

Loading…
Cancel
Save