public string ValidateField(Fields.Field field) { DocumentCreator creator = new DocumentCreator(view); Wniosek document = creator.Create(); Serializer <Wniosek> serializer = new Serializer <Wniosek>(); XmlDocument xml = serializer.loadToXML(document); Validator validator = new Validator(); string message = validator.ValidNode(field, xml); return(message); }
public void ValidateAndSaveDocument() { DocumentCreator creator = new DocumentCreator(view); Wniosek document = creator.Create(); Serializer <Wniosek> serializer = new Serializer <Wniosek>(); XmlDocument xml = serializer.loadToXML(document); Validator validator = new Validator(); bool isCorrect = validator.Validate(xml); if (isCorrect) { if (SaveXML(xml, document)) { System.Windows.Forms.MessageBox.Show("Zapisano"); } } ; }
public void GeneratePDF() { DocumentCreator creator = new DocumentCreator(view); Wniosek document = creator.Create(); Serializer <Wniosek> serializer = new Serializer <Wniosek>(); XmlDocument xml = serializer.loadToXML(document); Validator validator = new Validator(); bool isCorrect = validator.Validate(xml); if (isCorrect) { if (view.SaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { PDFGenerator generator = new PDFGenerator(document); generator.GeneratePDF(view.SaveFileDialog.FileName); } } ; }