Entwicklung_BLAZOR/InterneDLLs/LambertzPortalODAL/BestellungsDrucker.cs
2025-08-23 19:30:21 +02:00

1481 lines
64 KiB
C#

using iTextSharp.text.pdf;
using System;
using System.Drawing;
using System.IO;
using System.Text;
namespace De.Lambertz.ODAL
{
public class BestellungsDrucker : BestellungsDruckerBasis
{
private const float SMALL_FONT = 9f;
private const float NORMAL_FONT = 10f;
private const float MIDDLE_FONT = 11f;
private const float LARGE_FONT = 14f;
private const int MITTEL_ZELLE = 0;
private const int LINKE_ZELLE = 1;
private const int SUMMENTEXT_ZELLE = 6;
private const int SUMMEN_ZELLE = 7;
private const int LETZTE_ZELLE = 8;
private const int RECHTE_ZELLE = 9;
private float seitenGröße = 0;
private ODALUser besteller = null;
private ODALBestellung bestellung;
private string fileName = null;
private bool vorschau = false;
private bool mitUnterschriftFeld = false;
//private BaseFont bf;
private BaseFont font;
private Font smallFontNormal;
private Font normalFontNormal;
private Font middleFontNormal;
private Font largeFontNormal;
private Font smallFontBold;
private Font normalFontBold;
private Font middleFontBold;
private Font largeFontBold;
private Font smallFontBoldUnderlined;
//
private String wkz = "€";
public BestellungsDrucker(ODALBestellung bestellung)
{
this.bestellung = bestellung;
UserSingelton us = UserSingelton.GetInstance();
if (us != null)
{
this.besteller = us.GetInfoTo(bestellung.Besteller);
}
else
{
//PseudoMode
this.besteller = new ODALUser();
this.besteller.Name = "SYSTEM";
}
//
this.wkz = WährungsSingelton.GetInstance().DruckZeichenFür(bestellung.Wkz);
//
//string sylfaenpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\sylfaen.ttf";
string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\arial.ttf";
//string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\tahoma.ttf";
//string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\verdana.ttf";
font = BaseFont.CreateFont(fontpath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
smallFontNormal = new Font(font, SMALL_FONT);
normalFontNormal = new Font(font, NORMAL_FONT);
middleFontNormal = new Font(font, MIDDLE_FONT);
largeFontNormal = new Font(font, LARGE_FONT);
smallFontBold = new Font(font, SMALL_FONT, Font.BOLD);
normalFontBold = new Font(font, NORMAL_FONT, Font.BOLD);
middleFontBold = new Font(font, MIDDLE_FONT, Font.BOLD);
largeFontBold = new Font(font, LARGE_FONT, Font.BOLD);
smallFontBoldUnderlined = new Font(font, SMALL_FONT, Font.UNDERLINE | Font.BOLD);
this.wkz = bestellung.Wdz;
}
public BestellungsDrucker(ODALBestellung bestellung, bool vorschau): this(bestellung)
{
this.vorschau = vorschau;
}
public bool PDFErstellen(bool druckProtokollieren)
{
return this.PDFErstellen(null, druckProtokollieren);
}
public String AttachmentErstellen(bool druckProtokollieren)
{
this.erstellen(true, druckProtokollieren);
return fileName;
}
public bool PDFDrucken(bool druckProtokollieren)
{
return PDFErstellen("PRINT", druckProtokollieren);
}
public bool PDFErstellen(string saveName, bool druckProtokollieren)
{
bool result = true;
if(!vorschau)
{
result = bestellung.InBearbeitungMarkierungSetzten();
}
if (result)
{
result = false;
FrmDownload download = new FrmDownload();
download.Show();
download.Update();
this.erstellen(true, druckProtokollieren);
result = true;
download.Close();
download = null;
if (saveName == "PRINT")
{
PDFDrucker drucker = new PDFDrucker();
drucker.SilentMode = true;
drucker.Print(fileName);
}
else
{
if (String.IsNullOrEmpty(saveName))
{
//System.Diagnostics.Process.Start(fileName);
PortalTools.StartFile(fileName);
}
else
{
if (fileName != saveName)
{
File.Copy(fileName, saveName, true);
try
{
File.Delete(fileName);
}
catch (Exception)
{
//Dann eben später
}
}
}
}
if (!vorschau)
{
bestellung.InBearbeitungMarkierungEntfernen();
}
}
return result;
}
public string PDFInReiheErstellen(bool mitUnterschriftenFeld, bool druckProtokollieren)
{
string result = null;
FrmDownload download = new FrmDownload();
download.Show();
download.Update();
this.mitUnterschriftFeld = mitUnterschriftenFeld;
this.erstellen(false, druckProtokollieren);
result = this.fileName;
download.Close();
download = null;
return result;
}
private string getBasePath(bool alteDateienAufräumen)
{
StringBuilder basePath = new StringBuilder(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
basePath.Append("\\LambertzPortal\\Bestellungen");
DirectoryInfo bp = new DirectoryInfo(basePath.ToString());
if (!bp.Exists)
{
bp.Create();
}
else
{
if (alteDateienAufräumen)
{
//Aufräumen
foreach (FileInfo fi in bp.GetFiles("ODAL_*.pdf"))
{
try
{
fi.Delete();
}
catch (Exception)
{
//Konnte nicht gelöscht werden (weil z.B.: noch offen)
//wird beim nächsten mal gelöscht.
}
}
}
}
return basePath.ToString();
}
private void erstellen(bool alteDateienAufräumen, bool druckProtokollieren)
{
StringBuilder fn = new StringBuilder();
fn.Append(getBasePath(alteDateienAufräumen));
fn.Append("\\ODAL_");
fn.Append(bestellung.Nummer.ToString());
fn.Append(".pdf");
this.fileName = PortalTools.CheckFileName(fn.ToString());
Document doc = new Document(PageSize.A4, 25, 25, 25, 25);
// this.bf = BaseFont.CreateFont(@"c:\Windows\fonts\arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(this.fileName, FileMode.Create));
writer.PageEvent = new BestellungsDruckerEvents();
//Header-Informationen
doc.AddTitle("Bestellung Nr:" + bestellung.Nummer);
doc.AddAuthor(bestellung.Besteller);
doc.AddKeywords("Bestellung, Lambertz, " + bestellung.Besteller);
UserSingelton us = UserSingelton.GetInstance();
if (us != null)
{
doc.AddCreator(us.Name);
}
else
{
doc.AddCreator("Lambertz");
}
doc.AddCreationDate();
doc.AddSubject("Bestellung");
doc.SetMargins(25, 25, 25, 25);
doc.Open();
//START-Zusammenbau
this.setLogo(writer, doc);
seitenGröße = this.createHead1(doc); //Nur erste Zeile
seitenGröße = seitenGröße + this.createHead2(doc); //EmpfängerAdressen
seitenGröße = seitenGröße + this.createHead3(doc); //Lieferanten-Adresse und Hinweis1
//doc.Add(this.createBetreff(doc)); //Betreff
//this.createHead4(doc); //Bestellung....
//seitenGröße = seitenGröße + this.createHead5(doc); //Seitenzahl
//
seitenGröße = seitenGröße + this.createBody1(doc); //Rest
//ENDE-Zusammenbau
doc.Close();
writer.Close();
if (druckProtokollieren)
{
DruckProtokollieren(bestellung.Nummer);
}
}
private void setLogo(PdfWriter writer, Document doc)
{
Image logo = null;
//FileInfo fi = new FileInfo(Application.StartupPath + "\\ODAL\\" + bestellung.FirmenNr.ToString() + ".jpg")
switch (bestellung.FirmenNr)
{
case 1:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._1, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 3:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._3, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 5:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._5, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 8:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._8, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 11:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._11, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 12:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._12, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 30:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._30, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 32:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._32, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
case 39:
logo = Image.GetInstance(De.Lambertz.ODAL.Properties.Resources._39, System.Drawing.Imaging.ImageFormat.Jpeg);
break;
default:
logo = null;
break;
}
if (logo!=null)
{
//logo = Image.GetInstance(fi.FullName);
int max = Convert.ToInt32(doc.PageSize.Width) * 4 / 25;
RatioCalculator rc = new RatioCalculator(max, 1000, logo.ScaledWidth, logo.ScaledHeight);
double newHoehe = rc.getNewHeigth();
double newBreite = rc.getNewWidth();
logo.ScaleAbsolute((float)newBreite, (float)newHoehe);
}
if (logo != null)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
float[] widths = { 1 };
PdfPTable table = new PdfPTable(widths);
table.TotalWidth = 100f;
cell = new PdfPCell(logo);
cell.HorizontalAlignment = PdfCell.ALIGN_CENTER;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
PdfContentByte cb = writer.DirectContent;
table.WriteSelectedRows(0, -1, (doc.PageSize.Width / 2)-(logo.ScaledWidth/2), doc.PageSize.Height-20f, cb);
}
}
private float createHead1(Document doc)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
float[] widths = { 1f, 2f, 1f };
PdfPTable table = new PdfPTable(widths);
table.WidthPercentage = 100;
if (String.IsNullOrEmpty(bestellung.KdNr))
{
p = new Paragraph("", normalFontBold);
}
else
{
p = new Paragraph(ml.Txt(ML.DRK_KUNDEN_NR_KURZ) + " " + bestellung.KdNr, normalFontBold);
}
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph("", normalFontNormal);
//p.Font.Size = NORMAL_FONT;
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_CENTER;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph(bestellung.Datum.ToString("d", PortalTools.GermanCultureInfo), normalFontBold);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_RIGHT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
table.SpacingBefore = 10f;
doc.Add(table);
return table.TotalHeight;
}
private float createHead2(Document doc)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
string lAdresse;
string rAdresse;
string lÜeb;
string rÜeb;
lÜeb = ml.Txt(ML.DRK_LEISTUNGSEMPFÄNGER);
if (ml.Txt(ML.XXX_SPRACHE) == "3")
{
lAdresse = bestellung.GetLeistungsempfängerAdresse();
rAdresse = "";
rÜeb ="";
}
else
{
lAdresse = bestellung.GetLeistungsempfängerAdresse();
rAdresse = bestellung.GetRechnungsAdresse();
rÜeb = ml.Txt(ML.DRK_RECHNUNGSEMPFÄNGER);
}
float[] widths = { 0.8f, 0.5f, 0.7f };
PdfPTable table = new PdfPTable(widths);
table.WidthPercentage = 100;
p = new Paragraph(lÜeb, normalFontBold);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph("", normalFontNormal);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph(rÜeb, normalFontBold);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
//neue Zeile
p = new Paragraph(lAdresse, normalFontNormal);
//p.Font = new Font(bf);
//p.Font.Size = NORMAL_FONT;
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
if (bestellung.FirmenNr == 23 || bestellung.FirmenNr == 34)
{
p = new Paragraph("NIP: 677-20-01-646\nTel.: 0048 32608 90 56-58\nFax.: 0048 32608 90 85\ne-mail:zakupy@lambertz.com.pl", smallFontNormal);
}
else
{
p = new Paragraph("", normalFontBold);
}
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_BOTTOM;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph(rAdresse, normalFontNormal);
//p.Font.Size = NORMAL_FONT;
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
table.SpacingAfter = 10f;
doc.Add(table);
return table.TotalHeight;
}
private float createHead3(Document doc)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
//float[] widths = { 0.1f, 1.1f, 0.8f };
float[] widths = { 0.1f, 1.9f};
PdfPTable table = new PdfPTable(widths);
table.WidthPercentage = 100;
p = new Paragraph("", normalFontNormal);
//p.Font.Size = NORMAL_FONT;
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
p = new Paragraph(bestellung.LieferantenAndresse, normalFontBold);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
table.AddCell(cell);
table.SpacingAfter = 10f;
doc.Add(table);
return table.TotalHeight;
}
private PdfPTable createHead4(Document doc)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
PdfPTable table = new PdfPTable(1);
table.WidthPercentage = 100;
//
float[] widths = { 0.5f, 0.5f, 1f, 1f };
PdfPTable tableNested = new PdfPTable(widths);
PdfPCell cellNested;
p = new Paragraph(ml.TxtLbl(ML.DRK_BESTELLNUMMER), normalFontBold);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
tableNested.AddCell(cell);
p = new Paragraph(bestellung.Nummer.ToString(), largeFontBold);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
tableNested.AddCell(cell);
if (bestellung.IstFreigegeben() && !vorschau)
{
if (bestellung.IstNachträglichGeändert() && !bestellung.IstOriginal)
{
p = new Paragraph("ANGEPASST AN RECHNUNG!", largeFontBold);
}
else
{
p = new Paragraph(ml.Txt(ML.DRK_B_E_S_T_E_L_L_U_N_G), largeFontBold);
}
}
else
{
p = new Paragraph(ml.Txt(ML.DRK_V_O_R_S_C_H_A_U), largeFontBold);
}
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_CENTER;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
tableNested.AddCell(cell);
table.SpacingAfter = 10f;
string telefonNr = "";
if (besteller != null)
{
telefonNr = besteller.Telefon;
if (!String.IsNullOrEmpty(telefonNr))
{
telefonNr = "\n" + telefonNr;
}
table.SpacingAfter = 5f;
}
p = new Paragraph(ml.Txt(ML.DRK_BESTELLT_DURCH_P1, bestellung.Besteller + telefonNr), normalFontBold);
//p.Font.Size = NORMAL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_RIGHT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
tableNested.AddCell(cell);
//
if(!String.IsNullOrEmpty(bestellung.Betreff)) {
cell = new PdfPCell(createBetreff(doc));
cell.Border = PdfCell.NO_BORDER;
cell.Colspan = 4;
cell.PaddingTop = 4f;
tableNested.AddCell(cell);
}
//
cellNested = new PdfPCell(tableNested);
cellNested.Border = PdfCell.BOX;
if (String.IsNullOrEmpty(bestellung.Betreff))
{
cellNested.PaddingTop = 4f;
cellNested.PaddingBottom = 4f;
}
table.AddCell(cellNested);
return table;
}
private PdfPTable createBetreff(Document doc)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
PdfPTable table = new PdfPTable(1);
table.WidthPercentage = 100;
p = new Paragraph(ml.Txt(ML.DRK_BETREFF_P1, bestellung.Betreff), normalFontBold);
cell = new PdfPCell(p);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.BOX;
table.AddCell(cell);
return table;
}
private PdfPCell positionsZelle(string text, int ausrichtung, int zellenFormat)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
//p.Font.Size = SMALL_FONT;
if (zellenFormat == SUMMEN_ZELLE || zellenFormat == SUMMENTEXT_ZELLE)
{
p = new Paragraph(text, smallFontBold);
}
else
{
p = new Paragraph(text, smallFontNormal);
}
cell = new PdfPCell(p);
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
switch (zellenFormat)
{
case 1:
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0f;
cell.BorderWidthTop = 0f;
break;
case 7:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
case 8:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
case 9:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
case 11:
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0f;
cell.BorderWidthTop = 0.1f;
cell.BorderColorTop = Color.LIGHT_GRAY;
break;
case 17:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0.1f;
cell.BorderColorTop = Color.LIGHT_GRAY;
break;
case 18:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0.1f;
cell.BorderColorTop = Color.LIGHT_GRAY;
break;
case 19:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0.1f;
cell.BorderColorTop = Color.LIGHT_GRAY;
break;
case 10:
cell.BorderWidthLeft = 0f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0f;
cell.BorderWidthTop = 0.1f;
cell.BorderColorTop = Color.LIGHT_GRAY;
break;
default:
cell.Border = PdfCell.NO_BORDER;
break;
}
return cell;
}
private PdfPCell positionsÜberschriftZelle(string text, int ausrichtung)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
p = new Paragraph(text, smallFontBold);
//p.Font.Size = SMALL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.PaddingTop = 4f;
cell.PaddingBottom = 5f;
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.BOX;
return cell;
}
private PdfPCell fussZelle(string text, int ausrichtung, int zellenFormat)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
p = new Paragraph(text, smallFontBold);
//p.Font.Size = SMALL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.BOX;
switch (zellenFormat)
{
case 1:
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0.1f;
break;
case 2:
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
case 3:
//p.Font.Size = MIDDLE_FONT;
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0.1f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
case 4:
//p.Font.Size = MIDDLE_FONT;
cell.BorderWidthLeft = 0.1f;
cell.BorderWidthBottom = 0f;
cell.BorderWidthRight = 0.1f;
cell.BorderWidthTop = 0f;
break;
default:
cell.Border = PdfCell.NO_BORDER;
break;
}
return cell;
}
private PdfPCell infoZelle(string text, int ausrichtung, int zellenFormat, bool oben)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
//p.Font.Size = SMALL_FONT;
if (oben)
{
p = new Paragraph(text, smallFontBold);
}
else
{
p = new Paragraph(text, smallFontNormal);
}
cell = new PdfPCell(p);
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
return cell;
}
private PdfPCell infoZelleUnderlined(string text, int ausrichtung, int zellenFormat)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
p = new Paragraph(text, smallFontBoldUnderlined);
cell = new PdfPCell(p);
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
return cell;
}
private PdfPCell infoZelle(string text, int ausrichtung, int zellenFormat, bool oben, float fontSize)
{
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p = null; //Standard Paragraph, nur Dekleration
if (oben)
{
if (fontSize == SMALL_FONT)
{
p = new Paragraph(text, smallFontBold);
}
else if (fontSize == NORMAL_FONT)
{
p = new Paragraph(text, normalFontBold);
}
else if (fontSize == LARGE_FONT)
{
p = new Paragraph(text, largeFontBold);
}
else if (fontSize == MIDDLE_FONT)
{
p = new Paragraph(text, middleFontBold);
}
}
else
{
if (fontSize == SMALL_FONT)
{
p = new Paragraph(text, smallFontNormal);
}
else if (fontSize == NORMAL_FONT)
{
p = new Paragraph(text, normalFontNormal);
}
else if (fontSize == LARGE_FONT)
{
p = new Paragraph(text, largeFontNormal);
}
else if (fontSize == MIDDLE_FONT)
{
p = new Paragraph(text, middleFontNormal);
}
}
cell = new PdfPCell(p);
cell.HorizontalAlignment = ausrichtung;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
return cell;
}
private float createBody1(Document doc)
{
//PdfPTable outerTable = new PdfPTable(1);
//outerTable.WidthPercentage = 100;
//float[] widths = { 0.2f, 0.3f, 0.2f, 0.3f, 0.25f, 1.5f, 0.5f, 0.3f, 0.5f }; //original breiten
float[] widths = { 0.2f, 0.3f, 0.3f, 0.3f, 0.25f, 1.5f, 0.45f, 0.35f, 0.5f };
PdfPTable table = new PdfPTable(widths);
table.WidthPercentage = 100;
PdfPCell innerCell = new PdfPCell(createHead4(doc));
innerCell.Border = PdfCell.NO_BORDER;
innerCell.Colspan = 9;
table.AddCell(innerCell);
innerCell = new PdfPCell(new Paragraph(""));
innerCell.Border = PdfCell.NO_BORDER;
innerCell.Colspan = 9;
table.AddCell(innerCell);
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_POSITION), PdfCell.ALIGN_RIGHT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_MENGE), PdfCell.ALIGN_RIGHT));
table.AddCell(positionsÜberschriftZelle("", PdfCell.ALIGN_MIDDLE));
//table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_KOST_ST), PdfCell.ALIGN_LEFT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_KOST_UND_KONTO), PdfCell.ALIGN_LEFT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_EXP), PdfCell.ALIGN_LEFT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_ARTIKEL), PdfCell.ALIGN_LEFT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_EINZELPREIS_EUR) + " " + this.wkz , PdfCell.ALIGN_RIGHT));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_RABATT), PdfCell.ALIGN_CENTER));
table.AddCell(positionsÜberschriftZelle(ml.Txt(ML.DRK_SUMME_EUR) + " " + this.wkz, PdfCell.ALIGN_RIGHT));
int fr = 0;
if (mitUnterschriftFeld)
{
float[] widthsU = { 1f, 1f, 0.1f };
PdfPTable tableU = new PdfPTable(widthsU);
tableU.WidthPercentage = 100;
Paragraph p = new Paragraph("", smallFontBold);
//p.Font.Size = SMALL_FONT;
//p.Font.SetStyle(Font.BOLD);
PdfPCell cell = new PdfPCell(p);
cell.PaddingTop = 4f;
cell.PaddingBottom = 5f;
cell.HorizontalAlignment = PdfCell.ALIGN_RIGHT;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.LEFT_BORDER;
tableU.AddCell(cell);
p = new Paragraph("Datum, Unterschrift\n", largeFontBold);
//p.Font.Size = LARGE_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.PaddingTop = 4f;
cell.PaddingBottom = 5f;
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.TOP_BORDER;
tableU.AddCell(cell);
p = new Paragraph("", smallFontBold);
//p.Font.Size = SMALL_FONT;
//p.Font.SetStyle(Font.BOLD);
cell = new PdfPCell(p);
cell.PaddingTop = 4f;
cell.PaddingBottom = 5f;
cell.HorizontalAlignment = PdfCell.ALIGN_RIGHT;
cell.VerticalAlignment = PdfCell.ALIGN_MIDDLE;
cell.Border = PdfCell.RIGHT_BORDER;
tableU.AddCell(cell);
innerCell = new PdfPCell(tableU);
innerCell.Border = PdfCell.NO_BORDER;
innerCell.Colspan = 9;
table.AddCell(innerCell);
fr = 1;
}
float[] widths2 = { 0.75f, 0.75f, 0.75f, 0.75f, 0.5f };
PdfPTable table2 = new PdfPTable(widths2);
table2.WidthPercentage = 100;
table2.AddCell(fussZelle(ml.Txt(ML.DRK_LIEFERART), PdfCell.ALIGN_LEFT,1));
table2.AddCell(fussZelle(ml.Txt(ML.DRK_ZAHLUNGSBEDINGUNG), PdfCell.ALIGN_LEFT, 1));
table2.AddCell(fussZelle(ml.Txt(ML.DRK_WARENEMPFÄNGER), PdfCell.ALIGN_LEFT, 1));
table2.AddCell(fussZelle(ml.Txt(ML.DRK_PROJEKTNUMMER), PdfCell.ALIGN_LEFT, 1));
table2.AddCell(fussZelle("", PdfCell.ALIGN_RIGHT,1));
//
table2.AddCell(fussZelle(bestellung.LieferArt, PdfCell.ALIGN_LEFT, 2));
table2.AddCell(fussZelle(bestellung.ZahlungsBedingung, PdfCell.ALIGN_LEFT, 2));
table2.AddCell(fussZelle(bestellung.WarenEmpfänger, PdfCell.ALIGN_LEFT, 2));
table2.AddCell(fussZelle(bestellung.ProjektNr, PdfCell.ALIGN_LEFT, 3));
table2.AddCell(fussZelle("", PdfCell.ALIGN_RIGHT,2));
//
innerCell = new PdfPCell(table2);
innerCell.Border = PdfCell.NO_BORDER;
innerCell.Colspan = 9;
table.AddCell(innerCell);
table.HeaderRows = 4 + fr;
table.FooterRows = 1 + fr;
int z = 0;
string kostenstelleSave = "";
string kontoSave = "";
foreach (ODALBestellungsPosition pos in bestellung.Positionen)
{
String[] lines = pos.Artikel.Split("\n".ToCharArray());
int zz = 0;
foreach (String line in lines)
{
zz++;
if (zz == 1)
{
z++;
int vesatz = 10;
if (pos.Position == 1)
{
vesatz = 0;
}
table.AddCell(positionsZelle(pos.Position.ToString("#,##0"), PdfCell.ALIGN_RIGHT, LINKE_ZELLE + vesatz));
table.AddCell(positionsZelle(pos.Menge.ToString("#,##0.00"), PdfCell.ALIGN_RIGHT, MITTEL_ZELLE + vesatz));
String me = pos.MengenEinheit;
if (ml.Txt(ML.XXX_SPRACHE) != "1")
{
me = ÜbersetzerSingelton.GetInstance().GetMengenEinheitenÜbersetzung(me);
}
table.AddCell(positionsZelle(me, PdfCell.ALIGN_MIDDLE, MITTEL_ZELLE + vesatz));
//table.AddCell(positionsZelle(pos.Kostenstelle, PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
if (kostenstelleSave != pos.Kostenstelle || kontoSave != pos.Konto)
{
if (lines.Length == 1)
{
table.AddCell(positionsZelle(pos.Kostenstelle + "\n" + pos.Konto, PdfCell.ALIGN_LEFT, MITTEL_ZELLE + vesatz));
}
else
{
table.AddCell(positionsZelle(pos.Kostenstelle, PdfCell.ALIGN_LEFT, MITTEL_ZELLE + vesatz));
}
}
else
{
table.AddCell(positionsZelle("\"", PdfCell.ALIGN_CENTER, MITTEL_ZELLE + vesatz));
}
table.AddCell(positionsZelle(pos.ExpArtikel, PdfCell.ALIGN_LEFT, MITTEL_ZELLE + vesatz));
//table.AddCell(positionsZelle(pos.Artikel, PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle(line.Replace("\r", ""), PdfCell.ALIGN_LEFT, MITTEL_ZELLE + vesatz));
table.AddCell(positionsZelle(pos.EinzelPreis.ToString("#,##0.00"), PdfCell.ALIGN_RIGHT, MITTEL_ZELLE + vesatz));
if (!String.IsNullOrEmpty(pos.Rabatt) && pos.Rabatt.IndexOf('%') == -1 && pos.Rabatt.IndexOf('p') == -1)
{
if (this.wkz.Length == 1)
{
table.AddCell(positionsZelle(pos.Rabatt + " " + wkz, PdfCell.ALIGN_CENTER, MITTEL_ZELLE + vesatz));
}
else
{
table.AddCell(positionsZelle(pos.Rabatt, PdfCell.ALIGN_CENTER, MITTEL_ZELLE + vesatz));
}
}
else
{
table.AddCell(positionsZelle(pos.Rabatt, PdfCell.ALIGN_CENTER, MITTEL_ZELLE + vesatz));
}
if (z >= bestellung.Positionen.Count && zz >= lines.Length)
{
table.AddCell(positionsZelle(pos.Summe.ToString("#,##0.00"), PdfCell.ALIGN_RIGHT, LETZTE_ZELLE + vesatz));
}
else
{
table.AddCell(positionsZelle(pos.Summe.ToString("#,##0.00"), PdfCell.ALIGN_RIGHT, RECHTE_ZELLE + vesatz));
}
}
else
{
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, LINKE_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_MIDDLE, MITTEL_ZELLE));
if (zz == 2)
{
table.AddCell(positionsZelle(pos.Konto, PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
}
else
{
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
}
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle(line.Replace("\r","") + " " , PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_CENTER, MITTEL_ZELLE));
if (z >= bestellung.Positionen.Count && zz >= lines.Length)
{
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, LETZTE_ZELLE));
}
else
{
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, RECHTE_ZELLE));
}
}
}
kostenstelleSave = pos.Kostenstelle;
kontoSave = pos.Konto;
}
//Summe
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, LINKE_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_MIDDLE, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle(ml.Txt(ML.DRK_GESAMT_SUMME), PdfCell.ALIGN_LEFT, SUMMENTEXT_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_CENTER, MITTEL_ZELLE));
table.AddCell(positionsZelle(bestellung.BestellWert.ToString("#,##0.00"), PdfCell.ALIGN_RIGHT, SUMMEN_ZELLE));
//LEERZEILE
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, LINKE_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_MIDDLE, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_LEFT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_CENTER, MITTEL_ZELLE));
table.AddCell(positionsZelle("", PdfCell.ALIGN_RIGHT, RECHTE_ZELLE));
//Lieferadresse!
float[] widths3 = { 1f, 1f};
table2 = new PdfPTable(widths3);
table2.WidthPercentage = 100;
if (!String.IsNullOrEmpty(bestellung.GetLieferAdresse()))
{
table2.AddCell(infoZelle(ml.Txt(ML.DRK_LIEFERADRESSE_BEACHTEN), PdfCell.ALIGN_LEFT, 3,true));
}
else
{
//table2.AddCell(infoZelle(ml.Txt(ML.DRK_AUF_RECHNUNG_ANGEBEN) + "\n" +, PdfCell.ALIGN_LEFT, 3, false));
PdfPCell cell; //Standard Zelle, nur Dekleration
Paragraph p; //Standard Paragraph, nur Dekleration
cell = new PdfPCell();
string[] felder = ml.Txt(ML.DRK_AUF_RECHNUNG_ANGEBEN).Split("\n".ToCharArray());
foreach (string t in felder)
{
//p = new Paragraph(ml.Txt(ML.DRK_AUF_RECHNUNG_ANGEBEN));
p = new Paragraph(t, smallFontNormal);
//p.Font.Size = SMALL_FONT;
p.SpacingAfter = -4;
cell.AddElement(p);
}
Paragraph p2 = new Paragraph(ml.Txt(ML.DRK_LIEFER_IST_LEISTUNGSADRESSE), normalFontBold);
//p2.Font.Size = NORMAL_FONT;
//p2.Font.SetStyle(Font.BOLD);
cell.AddElement(p2);
cell.HorizontalAlignment = PdfCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfCell.ALIGN_TOP;
cell.Border = PdfCell.NO_BORDER;
table2.AddCell(cell);
}
if ((!bestellung.LieferTermin.Equals(bestellung.Datum) || bestellung.SofortAndrucken) && bestellung.LieferTermin.Year!=1)
{
table2.AddCell(infoZelle(ml.Txt(ML.DRK_GEWÜNSCHTER_LIEFERTERMIN) + "\n" + bestellung.LieferTermin.ToString("d", PortalTools.GermanCultureInfo), PdfCell.ALIGN_LEFT, 3, true));
}
else
{
table2.AddCell(infoZelle("", PdfCell.ALIGN_LEFT, 3,true));
}
//
if (!String.IsNullOrEmpty(bestellung.LAdresse))
{
table2.AddCell(infoZelle(bestellung.GetLieferAdresse(), PdfCell.ALIGN_LEFT, 3, false));
}
else
{
table2.AddCell(infoZelle("", PdfCell.ALIGN_LEFT, 3,false));
}
table2.AddCell(infoZelle("", PdfCell.ALIGN_LEFT, 3, false));
if (this.bestellung.TerminserienID != 0)
{
Terminserie ts = new Terminserie();
ts.Laden(this.bestellung.TerminserienID);
table2.AddCell(infoZelle("Terminserie: " + ts.ToString(), PdfCell.ALIGN_LEFT, 3, false));
table2.AddCell(infoZelle("", PdfCell.ALIGN_LEFT, 3, false));
}
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
table.AddCell(innerCell);
float[] widths4 = { 1f };
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(ml.Txt(ML.DRK_WARENEMPFÄNGER_BEACHTEN_A ), PdfCell.ALIGN_LEFT, 3, true, NORMAL_FONT));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = 5;
table.AddCell(innerCell);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(ml.Txt(ML.DRK_WARENEMPFÄNGER_BEACHTEN_C), PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
//float[] widths5 = { 1f };
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(ml.Txt(ML.DRK_WARENEMPFÄNGER_BEACHTEN_B), PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
FachBereich bereich = UserSingelton.GetInstance().GetBereichFürID(bestellung.Bereich) as FachBereich;
if (bereich != null)
{
//Zusatztext für technische Bereiche
if (bereich.KennungZusatzTextAufBestellung == 1)
{
String text;
if (bestellung.IstAnfrage || bestellung.LieferantenAndresse.StartsWith("ANFRAGE"))
{
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE1);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE2);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE3);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE4);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE5);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE6);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE7);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE8);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE9);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_ANFRAGE10);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
}
else
{
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG1);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG2);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG3);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG4);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG5);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG6);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = "\n\n" + ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG7);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelleUnderlined(text, PdfCell.ALIGN_LEFT, 3));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
text = ml.Txt(ML.XXX_ZUSATZTEXT1_BESTELLUNG8);
table2 = new PdfPTable(widths4);
table2.WidthPercentage = 100;
table2.AddCell(infoZelle(text, PdfCell.ALIGN_LEFT, 3, false));
innerCell = new PdfPCell(table2);
//innerCell.Border = PdfCell.NO_BORDER;
innerCell.BorderWidthLeft = 0.1f;
innerCell.BorderWidthBottom = 0f;
innerCell.BorderWidthRight = 0.1f;
innerCell.BorderWidthTop = 0f;
innerCell.Colspan = 9;
innerCell.PaddingTop = -3;
table.AddCell(innerCell);
}
}
}
table.ExtendLastRow = true;
doc.Add(table);
return table.TotalHeight;
}
public bool MitUnterschriftFeld
{
get { return mitUnterschriftFeld; }
set { mitUnterschriftFeld = value; }
}
}
}