#493 GanjoorUserPrePoemVisitViewModel
This commit is contained in:
parent
09f80394ed
commit
2ba0056b44
@ -6,5 +6,6 @@ namespace RMuseum.Models.Ganjoor.ViewModels
|
||||
{
|
||||
public DateTime? LastVisit { get; set; }
|
||||
public int TotalVisits { get; set; }
|
||||
public bool KeepTrack { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -4555,6 +4555,18 @@
|
||||
<member name="M:RMuseum.Migrations.RemTrans.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Migrations.UsrHstryCntr">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.UsrHstryCntr.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.UsrHstryCntr.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.UsrHstryCntr.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Accounting.DonationExpenditure">
|
||||
<summary>
|
||||
donation expenditures
|
||||
|
||||
@ -30,7 +30,12 @@ namespace RMuseum.Services.Implementation
|
||||
if (!string.IsNullOrEmpty(kRes.Result))
|
||||
bool.TryParse(kRes.Result, out keepHistory);
|
||||
if (!keepHistory)
|
||||
return new RServiceResult<GanjoorUserPrePoemVisitViewModel>(null);
|
||||
return new RServiceResult<GanjoorUserPrePoemVisitViewModel>(new GanjoorUserPrePoemVisitViewModel()
|
||||
{
|
||||
LastVisit = null,
|
||||
TotalVisits = 0,
|
||||
KeepTrack = keepHistory,
|
||||
});
|
||||
|
||||
|
||||
var oldTracks = await _context.GanjoorUserPoemVisits.Where(v => v.PoemId == poemId && v.UserId == userId).ToArrayAsync();
|
||||
@ -58,6 +63,7 @@ namespace RMuseum.Services.Implementation
|
||||
{
|
||||
LastVisit = preVisit,
|
||||
TotalVisits = count,
|
||||
KeepTrack= keepHistory,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user