update 20240925
This commit is contained in:
186
BarcodeLib/UI/Barcodekleber.Designer.cs
generated
Normal file
186
BarcodeLib/UI/Barcodekleber.Designer.cs
generated
Normal file
@@ -0,0 +1,186 @@
|
||||
namespace BarcodeLib.UI
|
||||
{
|
||||
partial class Barcodekleber
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblFormat = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.previewControl1 = new FastReport.Preview.PreviewControl();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.cbxreportname = new System.Windows.Forms.ComboBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblFormat
|
||||
//
|
||||
this.lblFormat.AutoSize = true;
|
||||
this.lblFormat.Location = new System.Drawing.Point(6, 16);
|
||||
this.lblFormat.Name = "lblFormat";
|
||||
this.lblFormat.Size = new System.Drawing.Size(87, 13);
|
||||
this.lblFormat.TabIndex = 0;
|
||||
this.lblFormat.Text = "Ettiketten-Format";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(6, 72);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(87, 13);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = "Anzahl Ettiketten";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(6, 88);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(55, 20);
|
||||
this.textBox1.TabIndex = 3;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(6, 114);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 4;
|
||||
this.button1.Text = "Aufbereiten";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(122, 114);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 5;
|
||||
this.button2.Text = "Design";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// previewControl1
|
||||
//
|
||||
this.previewControl1.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
this.previewControl1.Buttons = ((FastReport.PreviewButtons)(((((((((((FastReport.PreviewButtons.Print | FastReport.PreviewButtons.Open)
|
||||
| FastReport.PreviewButtons.Save)
|
||||
| FastReport.PreviewButtons.Email)
|
||||
| FastReport.PreviewButtons.Find)
|
||||
| FastReport.PreviewButtons.Zoom)
|
||||
| FastReport.PreviewButtons.Outline)
|
||||
| FastReport.PreviewButtons.PageSetup)
|
||||
| FastReport.PreviewButtons.Edit)
|
||||
| FastReport.PreviewButtons.Watermark)
|
||||
| FastReport.PreviewButtons.Navigator)));
|
||||
this.previewControl1.Clouds = FastReport.PreviewClouds.None;
|
||||
this.previewControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.previewControl1.Exports = ((FastReport.PreviewExports)((((((((((((((((((((((((FastReport.PreviewExports.PDFExport | FastReport.PreviewExports.RTFExport)
|
||||
| FastReport.PreviewExports.HTMLExport)
|
||||
| FastReport.PreviewExports.MHTExport)
|
||||
| FastReport.PreviewExports.XMLExport)
|
||||
| FastReport.PreviewExports.Excel2007Export)
|
||||
| FastReport.PreviewExports.Excel2003Document)
|
||||
| FastReport.PreviewExports.Word2007Export)
|
||||
| FastReport.PreviewExports.PowerPoint2007Export)
|
||||
| FastReport.PreviewExports.ODSExport)
|
||||
| FastReport.PreviewExports.ODTExport)
|
||||
| FastReport.PreviewExports.XPSExport)
|
||||
| FastReport.PreviewExports.CSVExport)
|
||||
| FastReport.PreviewExports.DBFExport)
|
||||
| FastReport.PreviewExports.TextExport)
|
||||
| FastReport.PreviewExports.ZplExport)
|
||||
| FastReport.PreviewExports.ImageExport)
|
||||
| FastReport.PreviewExports.XAMLExport)
|
||||
| FastReport.PreviewExports.SVGExport)
|
||||
| FastReport.PreviewExports.PPMLExport)
|
||||
| FastReport.PreviewExports.PSExport)
|
||||
| FastReport.PreviewExports.JsonExport)
|
||||
| FastReport.PreviewExports.LaTeXExport)
|
||||
| FastReport.PreviewExports.DxfExport)));
|
||||
this.previewControl1.Font = new System.Drawing.Font("Tahoma", 8F);
|
||||
this.previewControl1.Location = new System.Drawing.Point(215, 0);
|
||||
this.previewControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.previewControl1.Name = "previewControl1";
|
||||
this.previewControl1.PageOffset = new System.Drawing.Point(10, 10);
|
||||
this.previewControl1.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.previewControl1.SaveInitialDirectory = null;
|
||||
this.previewControl1.Size = new System.Drawing.Size(949, 907);
|
||||
this.previewControl1.TabIndex = 26;
|
||||
this.previewControl1.UIStyle = FastReport.Utils.UIStyle.VisualStudio2005;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.cbxreportname);
|
||||
this.groupBox1.Controls.Add(this.lblFormat);
|
||||
this.groupBox1.Controls.Add(this.button2);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Controls.Add(this.button1);
|
||||
this.groupBox1.Controls.Add(this.textBox1);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(215, 907);
|
||||
this.groupBox1.TabIndex = 27;
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// cbxreportname
|
||||
//
|
||||
this.cbxreportname.FormattingEnabled = true;
|
||||
this.cbxreportname.Location = new System.Drawing.Point(9, 33);
|
||||
this.cbxreportname.Name = "cbxreportname";
|
||||
this.cbxreportname.Size = new System.Drawing.Size(188, 21);
|
||||
this.cbxreportname.TabIndex = 6;
|
||||
//
|
||||
// Barcodekleber
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1164, 907);
|
||||
this.Controls.Add(this.previewControl1);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "Barcodekleber";
|
||||
this.Text = "Barcodekleber";
|
||||
this.Load += new System.EventHandler(this.Barcodekleber_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblFormat;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private FastReport.Preview.PreviewControl previewControl1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.ComboBox cbxreportname;
|
||||
}
|
||||
}
|
||||
111
BarcodeLib/UI/Barcodekleber.cs
Normal file
111
BarcodeLib/UI/Barcodekleber.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BarcodeLib.UI
|
||||
{
|
||||
public partial class Barcodekleber : Form
|
||||
{
|
||||
string connecionstring = string.Empty;
|
||||
public Barcodekleber()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Barcodekleber(string connectoinstring)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.connecionstring = connectoinstring;
|
||||
}
|
||||
|
||||
|
||||
private void Barcodekleber_Load(object sender, EventArgs e)
|
||||
{
|
||||
DirectoryInfo d = new DirectoryInfo(Application.StartupPath+ @"\bck"); //Assuming Test is your Folder
|
||||
|
||||
FileInfo[] Files = d.GetFiles("*.frx"); //Getting Text files
|
||||
string str = "";
|
||||
|
||||
foreach (FileInfo file in Files)
|
||||
{
|
||||
this.cbxreportname.Items.Add(file.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
DataSet dataSet = new DataSet();
|
||||
dt.Columns.Add("barcode");
|
||||
for (int i = 0; i < Convert.ToInt32(textBox1.Text); i++)
|
||||
{
|
||||
DataRow dr = dt.NewRow();
|
||||
string s;
|
||||
s = i.ToString();
|
||||
while (s.Length < 8) { s = "0" + s; };
|
||||
dr[0] = "" + s;
|
||||
dt.Rows.Add(dr);
|
||||
}
|
||||
dataSet.Tables.Add(dt);
|
||||
dt.TableName = "Barcodes";
|
||||
FastReport.Report report = new FastReport.Report();
|
||||
if (System.IO.File.Exists(Application.StartupPath + @"\bck\" + cbxreportname.Text) == true)
|
||||
{
|
||||
report.Load(Application.StartupPath + @"\bck\" + cbxreportname.Text);
|
||||
}
|
||||
|
||||
else { }
|
||||
report.RegisterData(dataSet);
|
||||
report.GetDataSource("Barcodes").Enabled = true;
|
||||
report.Preview = previewControl1;
|
||||
report.Prepare();
|
||||
report.Design();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
DataSet dataSet = new DataSet();
|
||||
dt.Columns.Add("barcode");
|
||||
for (int i = 0; i < Convert.ToInt32(textBox1.Text); i++)
|
||||
{
|
||||
DataRow dr = dt.NewRow();
|
||||
Database.DB dB = new Database.DB(connecionstring);
|
||||
string key = dB.get_dbkey("barcodeetikette");
|
||||
|
||||
string s;
|
||||
|
||||
s = key;
|
||||
while (s.Length < 5) { s = "0" + s; };
|
||||
s = DateTime.Now.Year.ToString()+s;
|
||||
s = s+Helper.DivFnkt.modulo10(s).ToString();
|
||||
dr[0] = s;
|
||||
dt.Rows.Add(dr);
|
||||
}
|
||||
dataSet.Tables.Add(dt);
|
||||
dt.TableName = "Barcodes";
|
||||
FastReport.Report report = new FastReport.Report();
|
||||
if (System.IO.File.Exists(Application.StartupPath + @"\bck\" + cbxreportname.Text) == true)
|
||||
{
|
||||
report.Load(Application.StartupPath + @"\bck\" + cbxreportname.Text);
|
||||
}
|
||||
|
||||
else { }
|
||||
report.RegisterData(dataSet);
|
||||
report.GetDataSource("Barcodes").Enabled = true;
|
||||
report.Preview = previewControl1;
|
||||
report.Prepare();
|
||||
report.ShowPrepared();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
BarcodeLib/UI/Barcodekleber.resx
Normal file
120
BarcodeLib/UI/Barcodekleber.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user