ganahrhr 3 yıl önce
ebeveyn
işleme
0ccc625c0b

+ 6 - 1
MySQLConnector.cs

@@ -12,10 +12,15 @@ namespace HyperCube
         private MySQLConnector(){ }
 
         private readonly string Server = "dmatter.net";
-        private readonly string DatabaseName = "documents";
         private readonly string UserName = "promsystem";
         private readonly string Password = "PrmSystem212";
 
+#if DEBUG
+        private readonly string DatabaseName = "documents"; ///сделать тестовое зеркало бд
+#else
+        private readonly string DatabaseName = "documents";
+#endif
+
         MySqlCommand SQLcom;
 
         public MySqlConnection Connection { get; set; }

+ 11 - 11
Pages/Desktop.razor.cs

@@ -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)
             {

+ 1 - 1
Pages/ModalAssets.razor

@@ -85,7 +85,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 1 - 1
Pages/ModalCompetency.razor

@@ -112,7 +112,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 1 - 1
Pages/ModalFiles.razor

@@ -24,7 +24,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 1 - 1
Pages/ModalInfo.razor

@@ -16,7 +16,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 2 - 2
Pages/ModalLoading.razor

@@ -136,13 +136,13 @@
 
     public void Open()
     {
-        JsRuntime.InvokeVoidAsync("BodyScroll", false);
+        //JsRuntime.InvokeVoidAsync("BodyScroll", false);
         modalDisplay = "block;";
     }
 
     public void Close()
     {
-        JsRuntime.InvokeVoidAsync("BodyScroll", true);
+        //JsRuntime.InvokeVoidAsync("BodyScroll", true);
         modalDisplay = "none";
     }
 }

+ 1 - 1
Pages/ModalProfile.razor

@@ -48,7 +48,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 1 - 1
Pages/ModalRating.razor

@@ -28,7 +28,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>
 

+ 1 - 1
Pages/ModalRules.razor

@@ -21,7 +21,7 @@
                 </div>
             </div>
         </div>
-        <a class="modal_close" @onclick="@Close">&#10006;</a>
+        <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
     </div>
 </div>