示例#1
0
        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);
        }
示例#2
0
        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");
                }
            }
            ;
        }
示例#3
0
        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);
                }
            }
            ;
        }