Example #1
0
 public DwaPrinter(VugraphLin vugraph_, VugraphLin vu2_)
 {
     vugraph1 = vugraph_;
     vugraph2 = vu2_;
     document = new Document();
     SetProperties();
 }
Example #2
0
        private void buttonprinttest_Click(object sender, RoutedEventArgs e)
        {
            bool vu = false;

            try
            {
                vugraph = NowyTrening();
                vu      = true;
            }
            catch
            {
                MessageBox.Show("cos zle z plikiem z vugraphu");
            }
//
            if (vu)
            {
                PrinterVu print    = new PrinterVu(vugraph);
                Document  document = print.CreateTreningDOC();

                Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
                dialog.FileName = vugraph.tytul;
                dialog.Filter   = "doc|.doc";
                dialog.ShowDialog();


                string nazwa_pliku = dialog.FileName;


                RtfDocumentRenderer renderer = new RtfDocumentRenderer();
                renderer.Render(document, nazwa_pliku, null);
                Process.Start(nazwa_pliku);
            }
        }
Example #3
0
 public DwaMeczePrinter(VugraphLin vugraph_, VugraphLin game_)
 {
     vugraph1 = vugraph_;
     vugraph2 = game_;
     document = new Document();
     SetProperties();
 }
Example #4
0
 public Printer(VugraphLin vugraph_, BBOGameReader game_)
 {
     vugraph  = vugraph_;
     game     = game_;
     document = new Document();
     SetProperties();
 }
Example #5
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            bool vu = false;
            bool ga = false;

            if (checkDF.IsChecked == true)
            {
                Ustawienia.deepfin = true;
            }

            try
            {
                vugraph = NowyTrening();
                vu      = true;
            }
            catch
            {
                MessageBox.Show("cos nie tak z plikiem z vugraphu");
            }

            try
            {
                game = NowyTrening2();

                ga = true;
            }

            catch
            {
                MessageBox.Show("cos nie tak z plikiem treningowym");
            }

            if (ga && vu)
            {
                Printer  print    = new Printer(vugraph, game);
                Document document = print.CreateTreningDOC();

                Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
                dialog.FileName = vugraph.tytul;
                dialog.Filter   = "doc|.doc";
                dialog.ShowDialog();



                string nazwa_pliku = dialog.FileName;


                RtfDocumentRenderer renderer = new RtfDocumentRenderer();
                renderer.Render(document, nazwa_pliku, null);
                Process.Start(nazwa_pliku);
            }
        }
Example #6
0
        /*   void MakeTable22()
         * {
         *     Table table = new Table();
         *     for (int i = 0; i < 14; i++)
         *     {
         *         table.AddColumn(Unit.FromCentimeter(wyniki_szerokosc_kolum[i]));
         *     }
         *
         *     int[] imp = wyliczimpy(game.ContractList, vugraph.Vu_ContractList_Closed);
         *
         *
         *     string s1 = "NS : " + game.nazwiska_[2] + " - " + game.nazwiska_[0];
         *     string s2 = "EW : " + game.nazwiska_[3] + " - " + game.nazwiska_[1];
         *     string s3 = "NS : " + vugraph.nazwiska_[6] + " - " + vugraph.nazwiska_[4];
         *     string s4 = "EW : " + vugraph.nazwiska_[7] + " - " + vugraph.nazwiska_[5];
         *     string s5 = "Mecz treningowy";
         *     string napis1 = "Pokój zamknięty";
         *
         *     MakeTableRow1(table, s1, s2, s3, s4);
         *
         *     string inicjaly1 = game.nazwiska_[2][0] + "/" + game.nazwiska_[0][0] + " + ";
         *     inicjaly1 += vugraph.nazwiska_[7][0] + "/" + vugraph.nazwiska_[5][0];
         *
         *     string inicjaly2 = game.nazwiska_[3][0] + "/" + game.nazwiska_[1][0] + " + ";
         *     inicjaly2 += vugraph.nazwiska_[6][0] + "/" + vugraph.nazwiska_[4][0];
         *
         *     MakeTableRow2(table, napis1, inicjaly1, inicjaly2, s5);
         *
         *     MakeTableRow3(table);
         *
         *     for (int i = 0; i < Ustawienia.ilosc_rozdan; i++)
         *     {
         *         table = MakeScoresGame(table, i, game.ContractList[i], vugraph.Vu_ContractList_Closed[i]);
         *         AddImp(ref table, imp, i);
         *     }
         *     TableProperties(ref table);
         *     table.SetEdge(0, 2, 14, 17, Edge.Box, BorderStyle.Single, 1.0, Colors.Black);
         *
         *     string team1 = game.nazwiska_[0] + " - " + game.nazwiska_[2] + " - " + vugraph.nazwiska_[5] + " - " + vugraph.nazwiska_[7];
         *     string team2 = game.nazwiska_[1] + " - " + game.nazwiska_[3] + " - " + vugraph.nazwiska_[4] + " - " + vugraph.nazwiska_[6];
         *     int nr_meczu = 2;
         *
         *     WstawOstatniaLinie(table, imp);
         *
         *     document.AddSection();
         *     document.LastSection.Add(WriteTableTitle(team1, team2, nr_meczu));
         *     document.LastSection.Add(table);
         * }
         *
         * void WstawOstatniaLinie(Table table, int[] imp)
         * {
         *     Row row2 = table.AddRow();
         *     int impsns = 0;
         *     int impsew = 0;
         *     for (int i = 0; i < Ustawienia.ilosc_rozdan; i++)
         *     {
         *         if (imp[i] > 0)
         *             impsns += imp[i];
         *         else
         *             impsew -= imp[i];
         *     }
         *     row2.Borders.Left.Width = 0;
         *     row2.Borders.Right.Width = 0;
         *     row2.Borders.Bottom.Width = 0;
         *     row2[11].Borders.Left.Width = 1.0;
         *     row2[11].Borders.Right.Width = 1.0;
         *     row2[11].Borders.Bottom.Width = 1.0;
         *     row2[12].Borders = row2[11].Borders.Clone();
         *     row2.Format.Alignment = ParagraphAlignment.Center;
         *     row2.Cells[11].AddParagraph(impsns.ToString());
         *     row2.Cells[12].AddParagraph(impsew.ToString());
         * }
         *
         * void MakeTable11()
         * {
         *     Table table = new Table();
         *     for (int i = 0; i < 14; i++)
         *     {
         *         table.AddColumn(Unit.FromCentimeter(wyniki_szerokosc_kolum[i]));
         *     }
         *
         *     int[] imp = wyliczimpy(game.ContractList, vugraph.Vu_ContractList_Open);
         *
         *
         *     string s1 = "NS : " + game.nazwiska_[2] + " - " + game.nazwiska_[0];
         *     string s2 = "EW : " + game.nazwiska_[3] + " - " + game.nazwiska_[1];
         *     string s3 = "NS : " + vugraph.nazwiska_[2] + " - " + vugraph.nazwiska_[0];
         *     string s4 = "EW : " + vugraph.nazwiska_[3] + " - " + vugraph.nazwiska_[1];
         *     string napis1 = "Pokój otwarty";
         *
         *
         *     MakeTableRow1(table, s1, s2, s3, s4);
         *
         *     string inicjaly1 = game.nazwiska_[2][0] + "/" + game.nazwiska_[0][0] + " + ";
         *     inicjaly1 += vugraph.nazwiska_[3][0] + "/" + vugraph.nazwiska_[1][0];
         *
         *     string inicjaly2 = game.nazwiska_[3][0] + "/" + game.nazwiska_[1][0] + " + ";
         *     inicjaly2 += vugraph.nazwiska_[2][0] + "/" + vugraph.nazwiska_[0][0];
         *
         *     MakeTableRow2(table, napis1, inicjaly1, inicjaly2, "Mecz treningowy");
         *
         *     MakeTableRow3(table);
         *
         *     for (int i = 0; i < Ustawienia.ilosc_rozdan; i++)
         *     {
         *         table = MakeScoresGame(table, i, game.ContractList[i], vugraph.Vu_ContractList_Closed[i]);
         *         AddImp(ref table, imp, i);
         *     }
         *     TableProperties(ref table);
         *     table.SetEdge(0, 2, 14, 17, Edge.Box, BorderStyle.Single, 1.0, Colors.Black);
         *
         *     string team1 = game.nazwiska_[0] + " - " + game.nazwiska_[2] + " - " + vugraph.nazwiska_[1] + " - " + vugraph.nazwiska_[3];
         *     string team2 = game.nazwiska_[1] + " - " + game.nazwiska_[3] + " - " + vugraph.nazwiska_[0] + " - " + vugraph.nazwiska_[2];
         *     int nr_meczu = 1;
         *
         *     WstawOstatniaLinie(table, imp);
         *
         *     document.AddSection();
         *
         *     document.LastSection.Add(WriteTableTitle(team1, team2, nr_meczu));
         *     document.LastSection.Add(table);
         * }
         */
        void MakeTable33(VugraphLin vu)
        {
            Table table = new Table();

            for (int i = 0; i < 14; i++)
            {
                table.AddColumn(Unit.FromCentimeter(wyniki_szerokosc_kolum[i]));
            }

            int[] imp = wyliczimpy(vu.Vu_ContractList_Open, vu.Vu_ContractList_Closed);


            string s1     = "NS : " + vu.nazwiska_[2] + " - " + vu.nazwiska_[0];
            string s2     = "EW : " + vu.nazwiska_[3] + " - " + vu.nazwiska_[1];
            string s3     = "NS : " + vu.nazwiska_[6] + " - " + vu.nazwiska_[4];
            string s4     = "EW : " + vu.nazwiska_[7] + " - " + vu.nazwiska_[5];
            string napis1 = "Pokój otwarty";


            MakeTableRow1(table, s1, s2, s3, s4);

            string inicjaly1 = vu.nazwiska_[2][0] + "/" + vu.nazwiska_[0][0] + " + ";

            inicjaly1 += vu.nazwiska_[7][0] + "/" + vu.nazwiska_[5][0];

            string inicjaly2 = vu.nazwiska_[3][0] + "/" + vu.nazwiska_[1][0] + " + ";

            inicjaly2 += vu.nazwiska_[6][0] + "/" + vu.nazwiska_[4][0];

            MakeTableRow2(table, napis1, inicjaly1, inicjaly2, "Mecz treningowy");

            MakeTableRow3(table);

            for (int i = 0; i < Ustawienia.ilosc_rozdan; i++)
            {
                table = MakeScoresGame(table, i, vu.Vu_ContractList_Open[i], vu.Vu_ContractList_Closed[i]);
                AddImp(ref table, imp, i);
            }
            TableProperties(ref table);
            table.SetEdge(0, 0, 14, 2, Edge.Box, BorderStyle.Single, 1.0, Colors.Black);

            string team1    = vu.nazwiska_[0] + " - " + vu.nazwiska_[2] + " - " + vu.nazwiska_[5] + " - " + vu.nazwiska_[7];
            string team2    = vu.nazwiska_[1] + " - " + vu.nazwiska_[3] + " - " + vu.nazwiska_[4] + " - " + vu.nazwiska_[6];
            int    nr_meczu = 1;

            //WstawOstatniaLinie(table, imp);
            document.AddSection();
            document.LastSection.Add(WriteTableTitle(team1, team2, nr_meczu));
            document.LastSection.Add(table);
        }
Example #7
0
        private Row CreateBidding_Surname(Row row, VugraphLin vugraph)
        {
            row.Format.Font.Size = 7;

            //wydruk nazwisk pokoj otwarty

            row.Cells[0].AddParagraph(vugraph.nazwiska_[0]);
            row.Cells[1].AddParagraph(vugraph.nazwiska_[1]);
            row.Cells[2].AddParagraph(vugraph.nazwiska_[2]);
            row.Cells[3].AddParagraph(vugraph.nazwiska_[3]);

            //wydrik nazwisk pokoj zamkniety
            row.Cells[6].AddParagraph(vugraph.nazwiska_[4].ToString());
            row.Cells[7].AddParagraph(vugraph.nazwiska_[5].ToString());
            row.Cells[8].AddParagraph(vugraph.nazwiska_[6].ToString());
            row.Cells[9].AddParagraph(vugraph.nazwiska_[7].ToString());

            return(row);
        }
Example #8
0
        public VugraphLin ReadLinVugraph(string calosc)
        {
            VugraphLin vugraph_ = new VugraphLin();

            string[] tab = calosc.Split('|');

            DeleteComment(tab);
            int idx = ReadScores();

            ReadSurnames(idx);
            ReadLeads();
            ReadTitle();
            licytacja = new string[2 * Ustawienia.ilosc_rozdan + 3, 40];
            FindBidding();
            licytacja_closed = new List <string[]>();
            licytacja_open   = new List <string[]>();
            if (Ustawienia.linoc)
            {
                licytacja_open   = ReadBiddingOpenRoom();
                licytacja_closed = ReadBiddingClosedRoom();
            }
            else
            {
                licytacja_closed = ReadBiddingOpenRoom();
                licytacja_open   = ReadBiddingClosedRoom();
            }
            boardstring = new string[Ustawienia.ilosc_rozdan + 3];

            FindBoards();
            ReadBoards();

            MakeBoards();



            return(vugraph_);
        }
Example #9
0
        VugraphLin NowyTrening()
        {
            Microsoft.Win32.OpenFileDialog lin = new Microsoft.Win32.OpenFileDialog();

            lin.Title = "Zaladuj lina z vugrapha";
            lin.ShowDialog();
            VugraphLin vugraph_ = new VugraphLin();


            FileStream   plik1  = File.OpenRead(lin.FileName);
            StreamReader reader = new StreamReader(plik1);

            string calosc = "";

            while (!reader.EndOfStream)
            {
                calosc += reader.ReadLine();
            }
            reader.Close();
            plik1.Close();
            vugraph_.ReadLinVugraph(calosc);

            return(vugraph_);
        }
Example #10
0
        private void CreateBidding(int nr, VugraphLin vugraph)
        {
            Section   section = document.LastSection;
            Paragraph tp      = section.AddParagraph();

            tp.AddLineBreak();
            tp.AddLineBreak();
            string naglowek = "Licytacja z meczu " + vugraph.team1Name + " przeciwko " + vugraph.team2Name;

            tp.AddFormattedText(naglowek, font_tytuly);
            tp.AddLineBreak();
            tp.AddLineBreak();

            Table table = new Table();

            table.Format.Font.Name = "Cambria";
            table.Format.Font.Size = 8;
            table.Format.Alignment = ParagraphAlignment.Center;


            for (int i = 0; i < 10; i++)
            {
                Column col = table.AddColumn(Unit.FromCentimeter(bidding_szerokosckolumny));
                col.Borders.Width = szerokosc_krawedzi;
                if ((i == 4 || i == 5))
                {
                    col.Borders.Width = 0;
                }
            }
            Row row = table.AddRow();

            row = CreateBidding_FirstRow(row);
            row = table.AddRow();
            row = CreateBidding_Surname(row, vugraph);

            row = table.AddRow();

            int idx = 1;

            while (vugraph.licytacja_open[nr][idx] != null)
            {
                if ((idx - 1 + nr) % 4 == 0)
                {
                    if (idx != 1)
                    {
                        row = table.AddRow();
                    }
                    Paragraph p = row.Cells[(idx - 1 + nr) % 4].AddParagraph();
                    p = WriteOdzywka(p, vugraph.licytacja_open[nr][idx]);
                }

                else
                {
                    Paragraph p = row.Cells[(idx - 1 + nr) % 4].AddParagraph();

                    p = WriteOdzywka(p, vugraph.licytacja_open[nr][idx]);
                }
                idx++;
            }

            //licytacja zamkniety
            idx = 1;
            int wiersz;

            wiersz = 1;
            while (vugraph.licytacja_closed[nr][idx] != null)
            {
                int tmp = (idx - 1 + nr) / 4 + 3;
                if ((idx - 1 + nr) % 4 == 0 || idx == 1)
                {
                    wiersz++;
                }
                if (wiersz >= table.Rows.Count)
                {
                    row = table.AddRow();
                }

                row = table.Rows[wiersz];
                Paragraph p = row[((idx - 1 + nr) % 4) + 6].AddParagraph();
                p = WriteOdzywka(p, vugraph.licytacja_closed[nr][idx]);

                idx++;
            }

            table.Rows.Height            = Unit.FromCentimeter(0.6);
            table.Rows.VerticalAlignment = VerticalAlignment.Center;

            table.SetEdge(0, 0, 10, 1, Edge.Box, BorderStyle.Single, 1.0, Colors.Black);

            table[0, 4].Borders.Bottom.Width = 0;
            table[0, 5].Borders.Bottom.Width = 0;
            table[0, 4].Borders.Top.Width    = 0;
            table[0, 5].Borders.Top.Width    = 0;
            table[0, 4].Borders.Right.Width  = 0;
            table[0, 4].Shading.Color        = Colors.White;
            table[0, 5].Shading.Color        = Colors.White;

            document.LastSection.Add(table);
        }
Example #11
0
 public PrinterVu(VugraphLin vugraph_)
 {
     vugraph  = vugraph_;
     document = new Document();
     SetProperties();
 }