mirror of https://github.com/abpframework/eventhub
24 changed files with 5611 additions and 22 deletions
@ -0,0 +1,10 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace EventHub.Events |
||||
|
{ |
||||
|
public class CountryLookupDto : EntityDto<Guid> |
||||
|
{ |
||||
|
public string Name { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace EventHub.Countries |
||||
|
{ |
||||
|
public static class CountryConsts |
||||
|
{ |
||||
|
public const int MaxNameLength = 32; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
|
namespace EventHub.Countries |
||||
|
{ |
||||
|
public class Country : Entity<Guid> |
||||
|
{ |
||||
|
public string Name { get; private set; } |
||||
|
|
||||
|
private Country() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
internal Country( |
||||
|
Guid id, |
||||
|
string name) |
||||
|
: base(id) |
||||
|
{ |
||||
|
Name = Check.NotNullOrWhiteSpace(name, nameof(name), CountryConsts.MaxNameLength); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,64 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace EventHub.Migrations |
||||
|
{ |
||||
|
public partial class Added_Countries : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<Guid>( |
||||
|
name: "CountryId", |
||||
|
table: "AppEvents", |
||||
|
type: "uniqueidentifier", |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AppCountries", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AppCountries", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AppEvents_CountryId", |
||||
|
table: "AppEvents", |
||||
|
column: "CountryId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AppCountries_Name", |
||||
|
table: "AppCountries", |
||||
|
column: "Name"); |
||||
|
|
||||
|
migrationBuilder.AddForeignKey( |
||||
|
name: "FK_AppEvents_AppCountries_CountryId", |
||||
|
table: "AppEvents", |
||||
|
column: "CountryId", |
||||
|
principalTable: "AppCountries", |
||||
|
principalColumn: "Id"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropForeignKey( |
||||
|
name: "FK_AppEvents_AppCountries_CountryId", |
||||
|
table: "AppEvents"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AppCountries"); |
||||
|
|
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_AppEvents_CountryId", |
||||
|
table: "AppEvents"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "CountryId", |
||||
|
table: "AppEvents"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,24 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace EventHub.Migrations |
||||
|
{ |
||||
|
public partial class Added_City_To_Event : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "City", |
||||
|
table: "AppEvents", |
||||
|
type: "nvarchar(32)", |
||||
|
maxLength: 32, |
||||
|
nullable: true); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "City", |
||||
|
table: "AppEvents"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,9 +1,13 @@ |
|||||
$(function () { |
$(function () { |
||||
|
$("#Event_CountryId").prepend("<option value='' selected='selected'></option>"); |
||||
|
|
||||
$('#Event_IsOnline').click(function() { |
$('#Event_IsOnline').click(function() { |
||||
if ($(this).is(':checked')) { |
if ($(this).is(':checked')) { |
||||
$("#event-link-form").show(); |
$("#event-link-group").show(); |
||||
|
$("#event-location-group").hide(); |
||||
}else{ |
}else{ |
||||
$("#event-link-form").hide(); |
$("#event-link-group").hide(); |
||||
|
$("#event-location-group").show(); |
||||
} |
} |
||||
}); |
}); |
||||
}); |
}); |
||||
Loading…
Reference in new issue