refactor(user-representation.component): Aktualisiert, um als unbegrenzt zu speichern.
This commit is contained in:
parent
7e05123fbf
commit
ff6ebf300c
@ -71,18 +71,20 @@ export class RepCreateFormComponent implements OnInit {
|
|||||||
const validFrom = this.range.value.start;
|
const validFrom = this.range.value.start;
|
||||||
const validTo = this.range.value.end;
|
const validTo = this.range.value.end;
|
||||||
|
|
||||||
if (!validFrom || !validTo) {
|
if ((!validFrom || !validTo) && !this.termless) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: "error",
|
icon: "error",
|
||||||
title: "Oops...",
|
title: "Oops...",
|
||||||
text: "Bitte geben Sie einen gültigen Datumsbereich ein!",
|
text: "Bitte geben Sie einen gültigen Datumsbereich ein oder wählen Sie unbefristet!",
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.userRep.validFrom = validFrom!;
|
if (!this.termless) {
|
||||||
this.userRep.validTo = validTo!;
|
this.userRep.validFrom = validFrom!;
|
||||||
|
this.userRep.validTo = validTo!;
|
||||||
|
}
|
||||||
|
|
||||||
this.userRepService.create(this.userRep).subscribe({
|
this.userRepService.create(this.userRep).subscribe({
|
||||||
next: (res) => {
|
next: (res) => {
|
||||||
@ -94,4 +96,4 @@ export class RepCreateFormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,9 +103,7 @@ export class UserRepresentationComponent extends BasePageComponent implements Af
|
|||||||
var newUserRep: UserRep = {
|
var newUserRep: UserRep = {
|
||||||
userId: this.slUserId,
|
userId: this.slUserId,
|
||||||
groupId: this.slGroupId,
|
groupId: this.slGroupId,
|
||||||
repUserId: this.slRepUserId,
|
repUserId: this.slRepUserId
|
||||||
validFrom: new Date(),
|
|
||||||
validTo: new Date(new Date().setDate(new Date().getDate() + 7))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.openCreateSheet(newUserRep, res => {
|
this.openCreateSheet(newUserRep, res => {
|
||||||
|
|||||||
@ -31,7 +31,6 @@ namespace DigitalData.UserManager.Application.Services
|
|||||||
//date range control
|
//date range control
|
||||||
: (createDto.ValidFrom > createDto.ValidTo)
|
: (createDto.ValidFrom > createDto.ValidTo)
|
||||||
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer[Key.InvalidDateRange])
|
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer[Key.InvalidDateRange])
|
||||||
: await base.CreateAsync(createDto);
|
: await base.CreateAsync(createDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,13 +18,11 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
[Column("REPR_USER")]
|
[Column("REPR_USER")]
|
||||||
public int? RepUserId { get; set; }
|
public int? RepUserId { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
[Column("VALID_FROM")]
|
[Column("VALID_FROM")]
|
||||||
public required DateTime? ValidFrom { get; set; }
|
public DateTime? ValidFrom { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
[Column("VALID_TO")]
|
[Column("VALID_TO")]
|
||||||
public required DateTime? ValidTo { get; set; }
|
public DateTime? ValidTo { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public virtual User? User { get; set; }
|
public virtual User? User { get; set; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user