|
@@ -320,7 +320,7 @@ namespace HyperCube.Pages
|
|
|
_modalLoading.Close();
|
|
|
}
|
|
|
|
|
|
- private async Task SaveDocument(int action_type = 1)
|
|
|
+ async Task SaveDocument(int action_type = 1)
|
|
|
{
|
|
|
Console.WriteLine($"SaveDocument. DocID: {DocID}, article: {_article.ID}, Status: {_article.Status}");
|
|
|
|
|
@@ -328,7 +328,7 @@ namespace HyperCube.Pages
|
|
|
|
|
|
/// all is fine, continue
|
|
|
MySQLConnector dbCon = MySQLConnector.Instance();
|
|
|
- long id;
|
|
|
+ long id = 0;
|
|
|
string stringSQL;
|
|
|
|
|
|
if (_article.Status != ArticleStatus.New && _article.Status != ArticleStatus.AwatingVerify)
|
|
@@ -355,14 +355,10 @@ namespace HyperCube.Pages
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Console.WriteLine($"SaveDocument, wrong status. DocID: {DocID}, article: {_article.ID}, Status: {_article.Status}");
|
|
|
- _modalInfo_error.Open($"Документ не будет сохранен из-за более позднего статуса.<br>DocID: {DocID}, article: {_article.ID}, Status: {GetDisplayName(_article.Status)}");
|
|
|
+ Console.WriteLine($"SaveDocument, wrong status. DocID: {DocID}, article: {_article.ID}, Status: {_article.Status}");
|
|
|
id = 0;
|
|
|
}
|
|
|
|
|
|
- /// tmp
|
|
|
- //int action_type = 1; //DocID > 0 ? 3 : 1;
|
|
|
-
|
|
|
if (id != 0)
|
|
|
{
|
|
|
stringSQL = $"INSERT INTO actions_history (article_id, action_type, acc_id) " +
|
|
@@ -427,13 +423,17 @@ namespace HyperCube.Pages
|
|
|
|
|
|
/// reloading articles
|
|
|
await AppData.LoadArticles();
|
|
|
+ }
|
|
|
|
|
|
- _modalLoading.Close();
|
|
|
+ _modalLoading.Close();
|
|
|
+
|
|
|
+ if (id == 0)
|
|
|
+ _modalInfo_error.Open($"Документ не будет сохранен из-за более позднего статуса.<br>DocID: {DocID}, article: {_article.ID}, Status: {GetDisplayName(_article.Status)}");
|
|
|
+ else
|
|
|
_modalInfo_error.Open("Документ успешно сохранен.");
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- private async Task LoadDocument(int docid)
|
|
|
+ async Task LoadDocument(int docid)
|
|
|
{
|
|
|
Console.WriteLine($"LoadDocument, docid: {docid}.");
|
|
|
_modalLoading.Open();
|
|
@@ -467,7 +467,7 @@ namespace HyperCube.Pages
|
|
|
_modalLoading.Close();
|
|
|
}
|
|
|
|
|
|
- private async Task SendToVerify()
|
|
|
+ async Task SendToVerify()
|
|
|
{
|
|
|
if (_article.Status == ArticleStatus.New || _article.Status == ArticleStatus.Saved)
|
|
|
{
|