diff --git a/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedPicture.cs b/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedPicture.cs
index d8a787e0..5f7096d7 100644
--- a/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedPicture.cs
+++ b/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedPicture.cs
@@ -59,5 +59,9 @@ namespace RMuseum.Models.Ganjoor
///
public bool ChosenOne { get; set; }
+ ///
+ /// publication date
+ ///
+ public DateTime PublicationDate { get; set; }
}
}
diff --git a/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedSpecLine.cs b/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedSpecLine.cs
index da0b6d76..3aac32b9 100644
--- a/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedSpecLine.cs
+++ b/RMuseum/Models/Ganjoor/GanjoorPoetSuggestedSpecLine.cs
@@ -48,5 +48,10 @@ namespace RMuseum.Models.Ganjoor
///
public virtual RAppUser SuggestedBy { get; set; }
+ ///
+ /// publication date
+ ///
+ public DateTime PublicationDate { get; set; }
+
}
}
diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml
index dc46f6fa..a4cd4a68 100644
--- a/RMuseum/RMuseum.xml
+++ b/RMuseum/RMuseum.xml
@@ -9997,6 +9997,11 @@
selected
+
+
+ publication date
+
+
Ganjoor Poet Specification
@@ -10042,6 +10047,11 @@
suggested by
+
+
+ publication date
+
+
related poem to a poem
diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs
index e708d36d..60375a1b 100644
--- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs
+++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-PhotosProject.cs
@@ -209,6 +209,10 @@ namespace RMuseum.Services.Implementation
var dbModel = await _context.GanjoorPoetSuggestedSpecLines.Where(s => s.Id == model.Id).SingleAsync();
bool publishIsChanged = model.Published != dbModel.Published;
+ if (publishIsChanged)
+ {
+ dbModel.PublicationDate = DateTime.Now;
+ }
dbModel.LineOrder = model.LineOrder;
dbModel.Contents = model.Contents;
dbModel.Published = model.Published;
diff --git a/RMuseum/Services/Implementation/PoetPhotoSuggestionService.cs b/RMuseum/Services/Implementation/PoetPhotoSuggestionService.cs
index 5aef182b..a3796fe6 100644
--- a/RMuseum/Services/Implementation/PoetPhotoSuggestionService.cs
+++ b/RMuseum/Services/Implementation/PoetPhotoSuggestionService.cs
@@ -270,6 +270,10 @@ namespace RMuseum.Services.Implementation
}
bool publishIsChanged = model.Published != dbModel.Published;
+ if(publishIsChanged)
+ {
+ dbModel.PublicationDate = DateTime.Now;
+ }
bool newlyChosenOne = model.ChosenOne && !dbModel.ChosenOne;
if (newlyChosenOne)
dbModel.PicOrder = 1;