Ejemplo n.º 1
0
        //compila D2
        private void button4_Click(object sender, RoutedEventArgs e)
        {



            try
            {
                validateInputTexBoxes();
                if (team.Athlete_list == null)
                {
                    fileSelect();
                }
                int i;
                openXML moduloD2 = new openXML(file_moduloD, file_moduloD2, Output_path);
                for (i = 1; i < team.Athlete_list.Length; i++)
                {
                    moduloD2.fillD2(team, i);
                }
                string message;
                if (i == 1)
                {
                    message = "1 modulo D2 esportato";
                }
                else
                {
                    message = i + " moduli D2 esportati";

                }
                DialogBox.write(caption, message, MessageBoxImage.Information);

            }
            catch (OpenXmlPackageException ex)
            {
                throw new Exception("ER 03: modulo D2 non valido", ex);

            }
            catch (System.IO.IOException ex)
            {
                throw new Exception("ER 04. Chiudere il Modulo D2 e riprovare.", ex);
            }
            catch (Exception ex)
            {
                DialogBox.write(caption, ex.Message, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 2
0
        //compila D
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            // fillModule();

            try
            {
                validateInputTexBoxes();
                if (team.Athlete_list == null)
                {
                    fileSelect();
                }
                openXML moduloD = new openXML(file_moduloD, file_moduloD2, Output_path);
                moduloD.fillD(team);
                DialogBox.write(caption, "Modulo D compilato.", MessageBoxImage.Information);
            }
            catch (OpenXmlPackageException ex)
            {
                DialogBox.write(caption, ex.Message + "\nER 01: modulo D non valido", MessageBoxImage.Error);
            }
            catch (System.IO.IOException ex)
            {
                DialogBox.write(caption, ex.Message + "\nER 02. Chiudere il Modulo D e riprovare.", MessageBoxImage.Error);
            }
            catch (Exception ex)
            {
                DialogBox.write(caption, ex.Message, MessageBoxImage.Error);
            }

        }