Added query

This commit is contained in:
Stefan
2019-12-04 14:04:02 +01:00
parent ac04ee1369
commit 714ed16af8
25 changed files with 707 additions and 46 deletions
+1
View File
@@ -85,6 +85,7 @@
this.Kontolabel2.Size = new System.Drawing.Size(100, 23);
this.Kontolabel2.TabIndex = 5;
this.Kontolabel2.Text = "Kontoname";
this.Kontolabel2.Click += new System.EventHandler(this.Kontolabel2_Click);
//
// Addentrie
//
+7 -2
View File
@@ -20,12 +20,12 @@ namespace Superbuchhaltung
private void Bestätigungsbutton_Click(object sender, EventArgs e)
{
string[] write = { Kontonummerbox.Text + ";" +Kontonamebox.Text};
string[] write = { Kontonummerbox.Text + ";" +Kontonamebox.Text + '\n'};
if (!Directory.Exists(@"C:\Users\Public\TestFolder\")) {
Directory.CreateDirectory(@"C:\Users\Public\TestFolder");
}
string fi = File.ReadAllText(@"C:\Users\Public\TestFolder\" + Kontonummerbox.Text.Substring(0, 1) + @".txt");
if (fi.IndexOf(Kontonummerbox.Text) != 0) {
if (fi.Contains(Kontonummerbox.Text)) {
if (MessageBox.Show("Der Kontonummer Existiert bereits!\nWollen sie diese überschreiben?", "Konto existiert bereits",MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.No) goto goback;
int index = fi.IndexOf(Kontonummerbox.Text);
@@ -61,5 +61,10 @@ namespace Superbuchhaltung
{
}
private void Kontolabel2_Click(object sender, EventArgs e)
{
}
}
}
+9 -1
View File
@@ -28,10 +28,18 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.SuspendLayout();
//
// Modify
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Name = "Modify";
this.Text = "Modify";
this.Load += new System.EventHandler(this.Modify_Load);
this.ResumeLayout(false);
}
#endregion
+5
View File
@@ -16,5 +16,10 @@ namespace Superbuchhaltung.Forms.Prompts
{
InitializeComponent();
}
private void Modify_Load(object sender, EventArgs e)
{
}
}
}
+120
View 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>
+121
View File
@@ -0,0 +1,121 @@
namespace Superbuchhaltung.Forms.Prompts
{
partial class Query
{
/// <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.Suchebtn = new System.Windows.Forms.Button();
this.Suchen = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.KUHL = new System.Windows.Forms.DataGridView();
this.Kontoname = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KontoNummer = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.KUHL)).BeginInit();
this.SuspendLayout();
//
// Suchebtn
//
this.Suchebtn.Location = new System.Drawing.Point(132, 30);
this.Suchebtn.Name = "Suchebtn";
this.Suchebtn.Size = new System.Drawing.Size(75, 23);
this.Suchebtn.TabIndex = 0;
this.Suchebtn.Text = "button1";
this.Suchebtn.UseVisualStyleBackColor = true;
this.Suchebtn.Click += new System.EventHandler(this.Suchebtn_Click);
//
// Suchen
//
this.Suchen.Location = new System.Drawing.Point(11, 31);
this.Suchen.Name = "Suchen";
this.Suchen.Size = new System.Drawing.Size(100, 22);
this.Suchen.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(8, 11);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 17);
this.label1.TabIndex = 2;
this.label1.Text = "Suchen";
this.label1.Click += new System.EventHandler(this.Label1_Click);
//
// KUHL
//
this.KUHL.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.KUHL.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Kontoname,
this.KontoNummer});
this.KUHL.Location = new System.Drawing.Point(12, 59);
this.KUHL.Name = "KUHL";
this.KUHL.RowHeadersWidth = 51;
this.KUHL.RowTemplate.Height = 24;
this.KUHL.Size = new System.Drawing.Size(1220, 456);
this.KUHL.TabIndex = 3;
//
// Kontoname
//
this.Kontoname.HeaderText = "Kname";
this.Kontoname.MinimumWidth = 6;
this.Kontoname.Name = "Kontoname";
this.Kontoname.Width = 125;
//
// KontoNummer
//
this.KontoNummer.HeaderText = "Kontonummer";
this.KontoNummer.MinimumWidth = 6;
this.KontoNummer.Name = "KontoNummer";
this.KontoNummer.Width = 125;
//
// Query
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1233, 516);
this.Controls.Add(this.KUHL);
this.Controls.Add(this.label1);
this.Controls.Add(this.Suchen);
this.Controls.Add(this.Suchebtn);
this.Name = "Query";
this.Text = "Query";
this.Load += new System.EventHandler(this.Query_Load);
((System.ComponentModel.ISupportInitialize)(this.KUHL)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button Suchebtn;
private System.Windows.Forms.TextBox Suchen;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGridView KUHL;
private System.Windows.Forms.DataGridViewTextBoxColumn Kontoname;
private System.Windows.Forms.DataGridViewTextBoxColumn KontoNummer;
}
}
+63
View File
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace Superbuchhaltung.Forms.Prompts
{
public partial class Query : Form
{
public List<string> result = new List<string>();
public Query()
{
InitializeComponent();
}
private void Label1_Click(object sender, EventArgs e)
{
}
private void Suchebtn_Click(object sender, EventArgs e)
{
result.Clear();
KUHL.Rows.Clear();
if (Suchen.Text.Length != 0)
{
for (int i = 0; i < 10; i++)
{
string[] file = File.ReadAllLines(@"C:\Users\Public\TestFolder\" + i + ".txt");
foreach (string s in file)
{
if (s.Contains(Suchen.Text))
{
result.Add(s);
KUHL.Rows.Add(s.Split(';'));
}
}
}
Console.WriteLine(result.Count());
if (result.Count != 0)
{
Main m = new Main();
//m.Search(result);
}
}
else
{
return;
}
}
private void Query_Load(object sender, EventArgs e)
{
}
}
}
+126
View File
@@ -0,0 +1,126 @@
<?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>
<metadata name="Kontoname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KontoNummer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>