Ejemplo n.º 1
0
        public void SaveDb()
        {
            if (string.IsNullOrEmpty(Document.Name))
            {
                var form = new InputForm();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    Document.Name = form.DocumentName;
                }
            }

            if (!string.IsNullOrEmpty(Document.Name))
            {
                if (!DataBaseManager.IsDocumentExists(Document.Name) ||
                    MessageBox.Show(Strings.ReplaceInDbText, Strings.ReplaceInDbTitle,
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var document = Document.GetDocument();
                    DataBaseManager.SaveDocument(document);
                    MessageBox.Show(Strings.SuccessSaveToDbText, Strings.ApplicationTitle, MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 2
0
 public void SaveFile(string fileName, FileExtensionType type)
 {
     FileManager.Save(fileName, Document.GetDocument(), type);
 }