44 changed files with 3111 additions and 13 deletions
@ -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; } |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -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> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,8 +1,30 @@ |
|||||
{ |
{ |
||||
"culture": "ar", |
"culture": "ar", |
||||
"texts": { |
"texts": { |
||||
"Menu:Home": "الرئيسية", |
|
||||
"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}?" |
||||
} |
} |
||||
} |
} |
@ -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
|
||||
|
; |
||||
|
} |
||||
|
} |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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
|
||||
|
; |
||||
|
} |
||||
|
} |
@ -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(); |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -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"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -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> |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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> |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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> |
@ -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; |
||||
|
} |
||||
|
} |
||||
|
|
@ -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,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(); |
||||
|
}); |
||||
|
}); |
@ -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> |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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> |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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> |
@ -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; |
||||
|
} |
||||
|
} |
||||
|
|
@ -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,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(); |
||||
|
}); |
||||
|
}); |
Loading…
Reference in new issue