浏览代码

修改另存为逻辑显示

gsp 2 年之前
父节点
当前提交
7690a73985
共有 1 个文件被更改,包括 22 次插入19 次删除
  1. 22 19
      OTSPartA_STDEditor/Form_ConstantsEditor2.cs

+ 22 - 19
OTSPartA_STDEditor/Form_ConstantsEditor2.cs

@@ -208,25 +208,28 @@ namespace OTSPartA_STDEditor
 
                             try
                             {
-                                SaveFileDialog saveFile = new SaveFileDialog();
-                                saveFile.Title = "Please select the path which to save the file";
-                                saveFile.Filter = "Database File(*.db)|*.db";
-                                saveFile.OverwritePrompt = true;  //是否覆盖当前文件
-                                saveFile.RestoreDirectory = true;  //还原上次目录
-                                if (saveFile.ShowDialog() == DialogResult.OK)
-                                {
-                                    System.IO.File.Copy(STDDBAddress, saveFile.FileName, true);
-                                    bool result = SaveDictionaryToClassify(saveFile.FileName);
-                                    if (result)
-                                    {
-                                        MessageBox.Show("Export file successful!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                                    }
-                                }
-                                else
-                                {
-                                    return;
-                                }
+                            SaveFileDialog saveFile = new SaveFileDialog();
+                            saveFile.Title = "Please select the path which to save the file";
+                            saveFile.Filter = "Database File(*.db)|*.db";
+                            saveFile.InitialDirectory = Application.StartupPath + "\\Config\\SysData\\";
+                            saveFile.OverwritePrompt = true;  //是否覆盖当前文件
+                                                              //saveFile.RestoreDirectory = true;  //还原上次目录
+                            if (saveFile.ShowDialog() == DialogResult.OK)
+                            {
+                                System.IO.File.Copy(STDDBAddress, saveFile.FileName, true);
+                                bool result = SaveDictionaryToClassify(saveFile.FileName);
+                                STDDBAddress = saveFile.FileName;
+                                this.Text = this.Text.Split(' ')[0] + "   " + saveFile.FileName;
+                                //if (result)
+                                //{
+                                //    MessageBox.Show("Export file successful!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                //}
                             }
+                            else
+                            {
+                                return;
+                            }
+                        }
                             catch (Exception ex)
                             {
                                 MessageBox.Show(ex.Message);
@@ -330,7 +333,7 @@ namespace OTSPartA_STDEditor
                                     STDDictionaryInitial = Clone(STDDictionary) as Dictionary<int, STDdata>;
                                     forWaiting.Close();
                                     IsModified = false;
-                                    MessageBox.Show("Save successful!", "Tip");
+                                    //MessageBox.Show("Save successful!", "Tip");
                                 }
                                 else
                                 {