public static IEnumerable Usuniete(String nazwaTabeli) { ArrayList ZbiorDanychKolumn = (ArrayList)UsunieteEtap2(nazwaTabeli); ArrayList zbiorWyjsciowy = new ArrayList(); foreach (DaneKolumn DaneKolumn in ZbiorDanychKolumn) { String zawartoscHeksKolumny = (String)DaneKolumn.zawartoscHeksKolumny; String zawartoscKolumny = Konwersja.heksNaTyp(zawartoscHeksKolumny, DaneKolumn.typKolumny); zbiorWyjsciowy.Add(new ZawartoscKolumn( DaneKolumn.id, DaneKolumn.nazwaKolumny, zawartoscKolumny, zawartoscHeksKolumny )); } return(zbiorWyjsciowy); }
void Create_Table() { string dec_format = "##,##0.00"; Paragraph para = section.AddParagraph(); para.Format.SpaceAfter = 30; // Create the item table this.table = section.AddTable(); this.table.Style = "Table"; this.table.Borders.Width = 0.25; this.table.Borders.Left.Width = 0.5; this.table.Borders.Right.Width = 0.5; this.table.Rows.LeftIndent = 0; // Before you can add a row, you must define the columns Column column = this.table.AddColumn("0.8cm"); column.Format.Alignment = ParagraphAlignment.Left; column = this.table.AddColumn("5.8cm"); column.Format.Alignment = ParagraphAlignment.Center; column = this.table.AddColumn("1.9cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("0.8cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("0.8cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1.9cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1.6cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1.2cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1.6cm"); column.Format.Alignment = ParagraphAlignment.Right; column = this.table.AddColumn("1.6cm"); column.Format.Alignment = ParagraphAlignment.Right; // Create the header of the table Row row = table.AddRow(); row.HeadingFormat = true; row.Format.Alignment = ParagraphAlignment.Center; row.VerticalAlignment = VerticalAlignment.Top; row.Format.Font.Bold = false; row.TopPadding = 1.5; row.BottomPadding = 1; row.Style = "TNR9"; //////////////////////////// row.Cells[0].AddParagraph("Lp"); row.Cells[1].AddParagraph("Nazwa towaru/usługi"); row.Cells[2].AddParagraph("Symbol PPKWiU/ PKOB"); row.Cells[3].AddParagraph("Jm"); row.Cells[4].AddParagraph("Ilość"); row.Cells[5].AddParagraph("Cena jednostkowa netto"); row.Cells[6].AddParagraph("Wartość netto"); row.Cells[7].AddParagraph("Stawka VAT [%]"); row.Cells[8].AddParagraph("Kwota VAT"); row.Cells[9].AddParagraph("Wartość brutto"); Double ilosc, kwota; //rabat Double[] ilosc_tab = new Double[6] { Convert.ToDouble(Metody_bazy.ilosc_p_1), Convert.ToDouble(Metody_bazy.ilosc_p_2), Convert.ToDouble(Metody_bazy.ilosc_p_3), Convert.ToDouble(Metody_bazy.ilosc_p_4), Convert.ToDouble(Metody_bazy.ilosc_p_5), Convert.ToDouble(Metody_bazy.ilosc_p_6) }; Double[] rabat_tab = new Double[6] { Convert.ToDouble(Metody_bazy.rabat_p_1), Convert.ToDouble(Metody_bazy.rabat_p_2), Convert.ToDouble(Metody_bazy.rabat_p_3), Convert.ToDouble(Metody_bazy.rabat_p_4), Convert.ToDouble(Metody_bazy.rabat_p_5), Convert.ToDouble(Metody_bazy.rabat_p_6) }; Double[] kwota_tab = new Double[6] { Convert.ToDouble(Metody_bazy.kwota_p_1), Convert.ToDouble(Metody_bazy.kwota_p_2), Convert.ToDouble(Metody_bazy.kwota_p_3), Convert.ToDouble(Metody_bazy.kwota_p_4), Convert.ToDouble(Metody_bazy.kwota_p_5), Convert.ToDouble(Metody_bazy.kwota_p_6) }; Double suma_netto, suma_vat, suma_brutto; suma_netto = suma_brutto = suma_vat = 0; int lp = 0; for (int i = 0; i < Convert.ToInt16(Metody_bazy.ilosc_produktow_combo); i++) { lp = i + 1; ilosc = ilosc_tab[i]; //rabat = rabat_tab[i]; kwota = kwota_tab[i] - (kwota_tab[i] * (rabat_tab[i] / 100)); row = table.AddRow(); row.Format.Alignment = ParagraphAlignment.Center; row.VerticalAlignment = VerticalAlignment.Top; row.Format.Font.Bold = false; row.TopPadding = 6; row.BottomPadding = 6; row.Style = "TNR9"; row.Cells[0].AddParagraph((i + 1).ToString()); row.Cells[1].AddParagraph(Metody_bazy.zamowienia_tablica[i]); row.Cells[1].Format.Alignment = ParagraphAlignment.Left; row.Cells[2].AddParagraph(" "); row.Cells[3].AddParagraph("szt"); row.Cells[4].AddParagraph(ilosc.ToString()); row.Cells[5].AddParagraph(((kwota * 100) / 123).ToString(dec_format)); row.Cells[5].Format.Alignment = ParagraphAlignment.Right; row.Cells[6].AddParagraph((((kwota * 100) / 123) * ilosc).ToString(dec_format)); suma_netto += ((kwota * 100) / 123) * ilosc; row.Cells[6].Format.Alignment = ParagraphAlignment.Right; row.Cells[7].AddParagraph("23"); row.Cells[8].AddParagraph(((kwota * ilosc) - (((kwota * 100) / 123) * ilosc)).ToString(dec_format)); row.Cells[8].Format.Alignment = ParagraphAlignment.Right; suma_vat += (kwota * ilosc) - (((kwota * 100) / 123) * ilosc); row.Cells[9].AddParagraph((kwota * ilosc).ToString(dec_format)); row.Cells[9].Format.Alignment = ParagraphAlignment.Right; suma_brutto += kwota * ilosc; } if (Metody_bazy.gratis != 0) { Metody_bazy.Wczytanie_gratisu_o_id(Metody_bazy.gratis); ilosc = 1; //rabat = rabat_tab[i]; kwota = 1; row = table.AddRow(); row.Format.Alignment = ParagraphAlignment.Center; row.VerticalAlignment = VerticalAlignment.Top; row.Format.Font.Bold = false; row.TopPadding = 6; row.BottomPadding = 6; row.Style = "TNR9"; row.Cells[0].AddParagraph((lp + 1).ToString()); row.Cells[1].AddParagraph(Metody_bazy.nazwa_gratisu); row.Cells[1].Format.Alignment = ParagraphAlignment.Left; row.Cells[2].AddParagraph(" "); row.Cells[3].AddParagraph("szt"); row.Cells[4].AddParagraph(ilosc.ToString()); row.Cells[5].AddParagraph(((kwota * 100) / 123).ToString(dec_format)); row.Cells[5].Format.Alignment = ParagraphAlignment.Right; row.Cells[6].AddParagraph((((kwota * 100) / 123) * ilosc).ToString(dec_format)); suma_netto += ((kwota * 100) / 123) * ilosc; suma_vat += (kwota * ilosc) - (((kwota * 100) / 123) * ilosc); suma_brutto += kwota * ilosc; row.Cells[6].Format.Alignment = ParagraphAlignment.Right; row.Cells[7].AddParagraph("23"); row.Cells[8].AddParagraph(((kwota * ilosc) - (((kwota * 100) / 123) * ilosc)).ToString(dec_format)); row.Cells[8].Format.Alignment = ParagraphAlignment.Right; row.Cells[9].AddParagraph((kwota * ilosc).ToString(dec_format)); row.Cells[9].Format.Alignment = ParagraphAlignment.Right; } row = table.AddRow(); row.Borders.Visible = false; row = table.AddRow(); row.TopPadding = 4; row.BottomPadding = 4; row.Cells[0].MergeRight = 5; row.Cells[0].Borders.Visible = false; row.Cells[0].AddParagraph("Razem przed korektą "); row.Cells[0].Format.Alignment = ParagraphAlignment.Right; //// row.Cells[6].AddParagraph(suma_netto.ToString(dec_format)); row.Cells[6].Format.Alignment = ParagraphAlignment.Right; row.Cells[7].AddParagraph("X"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph(suma_vat.ToString(dec_format)); row.Cells[8].Format.Alignment = ParagraphAlignment.Right; row.Cells[9].AddParagraph(suma_brutto.ToString(dec_format)); row.Cells[9].Format.Alignment = ParagraphAlignment.Right; ////////////////// row = table.AddRow(); row.TopPadding = 4; row.Style = "TNR7"; row.Format.Alignment = ParagraphAlignment.Right; row.Cells[0].MergeRight = 5; row.Cells[0].Borders.Visible = false; row.Cells[0].AddParagraph("w tym "); row.Cells[0].VerticalAlignment = VerticalAlignment.Top; //// 23 row.Cells[6].AddParagraph(suma_netto.ToString(dec_format)); row.Cells[7].AddParagraph("23"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph(suma_vat.ToString(dec_format)); row.Cells[9].AddParagraph(suma_brutto.ToString(dec_format)); //// 7 row.Cells[6].AddParagraph("0.00"); row.Cells[7].AddParagraph("7"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph("0.00"); row.Cells[9].AddParagraph("0.00"); //// 3 row.Cells[6].AddParagraph("0.00"); row.Cells[7].AddParagraph("3"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph("0.00"); row.Cells[9].AddParagraph("0.00"); //// 0 row.Cells[6].AddParagraph("0.00"); row.Cells[7].AddParagraph("0"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph("0.00"); row.Cells[9].AddParagraph("0.00"); //// zw row.Cells[6].AddParagraph("0.00"); row.Cells[7].AddParagraph("zw"); row.Cells[7].Format.Alignment = ParagraphAlignment.Center; row.Cells[8].AddParagraph("0.00"); row.Cells[9].AddParagraph("0.00"); Paragraph paragraph = section.AddParagraph(); paragraph.AddText("Razem do zapłaty/do zwrotu*: " + suma_brutto.ToString("##,##0.00") + " zł"); paragraph.Style = "TNR9"; paragraph.Format.SpaceBefore = 5; paragraph = section.AddParagraph(); paragraph.AddText("Słownie: " + Konwersja.Kwotana_na_slowa(suma_brutto)); paragraph.Style = "TNR9"; paragraph.Format.SpaceAfter = 45; paragraph = section.AddParagraph(); paragraph.AddText("................................................."); paragraph.Style = "Reference"; paragraph.AddTab(); paragraph.AddText("................................................."); paragraph = section.AddParagraph(); paragraph.AddText("data i podpis odbiorcy faktury"); paragraph.Format.SpaceBefore = 0; paragraph.Style = "Reference"; paragraph.AddTab(); paragraph.AddText("podpis wystawcy faktury"); paragraph = section.AddParagraph(); paragraph.AddText("*) niepotrzebne skreślić"); paragraph.Style = "TNR9"; paragraph.Format.SpaceBefore = 8; paragraph.Format.SpaceAfter = 35; }
private static int wezWartoscZTablicyWymiarow(String tablicaWymiarow, int przesuniecieKolumny) { przesuniecieKolumny += 1; return(Konwersja.heksNaLiczbe(String.Concat(tablicaWymiarow.Skip((2 * (Math.Abs(przesuniecieKolumny)) - 1) * 2).Take(2 * 2)), 2)); }
public int wezNKolumnZnakowych(String kontent, int przesuniecie, int dlugoscTablicyPustych) { return(Konwersja.heksNaLiczbe(String.Concat(kontent.Skip((przesuniecie + 3) * 2 + dlugoscTablicyPustych * 2).Take(2 * 2)), 2)); }
public int wezNKolumn(String kontent, int przesuniecie) { return(Konwersja.heksNaLiczbe(String.Concat(kontent.Skip((przesuniecie + 1) * 2).Take(2 * 2)), 2)); }
public int wezPrzesuniecie(String kontent) { return(Konwersja.heksNaLiczbe(String.Concat(kontent.Skip(3 * 2).Take(2 * 2)), 2)); }