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); } } }
public void SaveFile(string fileName, FileExtensionType type) { FileManager.Save(fileName, Document.GetDocument(), type); }