Added Functionality

This commit is contained in:
Kuro 2025-03-22 00:33:45 +01:00
parent 4a4a022c81
commit 8bf12dce08
8 changed files with 526 additions and 6 deletions

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TimeTable.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TimeTable.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

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>

View File

@ -14,5 +14,19 @@
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" /> <PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project> </Project>

View File

@ -156,5 +156,16 @@ namespace TimeTable.controll {
sqliteCmd.ExecuteNonQuery(); sqliteCmd.ExecuteNonQuery();
con.Close(); con.Close();
} }
public static void DeleteTableRow(string uid, string sqlConnection) {
SqliteConnection con = new SqliteConnection(sqlConnection);
con.Open();
SqliteCommand sqliteCmd = con.CreateCommand();
sqliteCmd.CommandText = @"Delete FROM timetable WHERE uid='" + uid + "';";
con.Open();
sqliteCmd.ExecuteNonQuery();
con.Close();
}
} }
} }

109
TimeTable/view/Decide.Designer.cs generated Normal file
View File

@ -0,0 +1,109 @@
using System.Drawing;
namespace TimeTable.view {
partial class decide {
/// <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() {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(decide));
stopBtn = new Button();
resumeBtn = new Button();
cancelBtn = new Button();
pictureBox1 = new PictureBox();
label1 = new Label();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout();
//
// stopBtn
//
stopBtn.Location = new Point(130, 81);
stopBtn.Name = "stopBtn";
stopBtn.Size = new Size(94, 29);
stopBtn.TabIndex = 0;
stopBtn.Text = "Stop";
stopBtn.UseVisualStyleBackColor = true;
//
// resumeBtn
//
resumeBtn.Location = new Point(230, 81);
resumeBtn.Name = "resumeBtn";
resumeBtn.Size = new Size(94, 29);
resumeBtn.TabIndex = 1;
resumeBtn.Text = "Resume";
resumeBtn.UseVisualStyleBackColor = true;
//
// cancelBtn
//
cancelBtn.Location = new Point(330, 81);
cancelBtn.Name = "cancelBtn";
cancelBtn.Size = new Size(94, 29);
cancelBtn.TabIndex = 2;
cancelBtn.Text = "Cancel";
cancelBtn.UseVisualStyleBackColor = true;
//
// pictureBox1
//
pictureBox1.Image = (Image)resources.GetObject("pictureBox1.Image");
pictureBox1.Location = new Point(19, 20);
pictureBox1.Margin = new Padding(10, 0, 0, 0);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(61, 57);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.TabIndex = 3;
pictureBox1.TabStop = false;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(130, 38);
label1.Name = "label1";
label1.Size = new Size(267, 20);
label1.TabIndex = 4;
label1.Text = "What should happen to the Time Item?";
//
// decide
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(439, 122);
Controls.Add(label1);
Controls.Add(pictureBox1);
Controls.Add(cancelBtn);
Controls.Add(resumeBtn);
Controls.Add(stopBtn);
Name = "decide";
Text = "What to do?";
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button stopBtn;
private Button resumeBtn;
private Button cancelBtn;
private PictureBox pictureBox1;
private Label label1;
}
}

8
TimeTable/view/Decide.cs Normal file
View File

@ -0,0 +1,8 @@
namespace TimeTable.view {
public partial class decide : Form {
public decide() {
InitializeComponent();
}
}
}

177
TimeTable/view/Decide.resx Normal file
View File

@ -0,0 +1,177 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAS
cwAAEnMBjCK5BwAAC61JREFUWEftmHlU1OUax9l3EVNSLFOQRdnUtGOuiQiGqVcxwOOSmiRWrmGYy+1e
j1YmpmJiKJusIjvMMAMzMAsMzLBvCkKiIg6boCIMLjDfc5/fDNbpHG91S/P+0XPO5/x+83u3L8/7Ps/7
vmj8bX/b7zBHZyfDj/z8PLZt23Zw7dq1q6dOnTaaPmuqS1+yWVtbawQFBc1JTU2TZWfn9MXGxt1YudJz
IxWZqmu8ZHNychoXGXkhlcQN8vkFEAgEym+/Dayi725UrKeu9ZLM2NhY59y5c/7p6awBLjcFkoIdyM1N
QUZG1sDmzb7Rw4YNs6ZqL2+qFy9ebB0TE9PEZvOUefwAdHUaoFi6ASxWzuDZsyE3Z8yYsUFTU9N4qPpf
b6GhofFsNncwMzMaTY0zMfBIEz1dr4HLCUYWJ3dw3/79efr6+vZUVVvd4i+0Xbt2rYyLi+8VCITIF32M
/gdmGFBo4kmvNhqvLAaPz1HGX0zoX7JkSQBVH6Fu9RfZli1bjM+fP3+5pKQMXG4Ebt90wpN+LTzu1cXj
BwZovzkaRZJgiMVSZXDw2U4dHZ1p1Exf3foF24gRI3T8/f33ZWay7hUWFqNAuIFEGZPn9EigAR73GOPR
PVNcKfdAiUyE5OTUxx9+uDmMRL5GzbXUvbxAc3Nzmx4bG1taXl6jZGUEo6PFBn3dBnhwx5AwVtHbZYL2
a6+hTBqIyspanDkT3DplypTV1NxE3csLMgsLC9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MI94gmK3G9jlh8xswY/03JhLjCEbX/7Np
aPwHx1g7vs5VsDQAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@ -36,6 +36,7 @@ namespace TimeTable {
bindingSource = new BindingSource(components); bindingSource = new BindingSource(components);
con = new SQLiteConnection(); con = new SQLiteConnection();
dataAdapter = new SQLiteDataAdapter(); dataAdapter = new SQLiteDataAdapter();
btnDelete = new Button();
btnPanel.SuspendLayout(); btnPanel.SuspendLayout();
tableView.SuspendLayout(); tableView.SuspendLayout();
((System.ComponentModel.ISupportInitialize)taskTimeGridView).BeginInit(); ((System.ComponentModel.ISupportInitialize)taskTimeGridView).BeginInit();
@ -45,6 +46,7 @@ namespace TimeTable {
// btnPanel // btnPanel
// //
btnPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; btnPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
btnPanel.Controls.Add(btnDelete);
btnPanel.Controls.Add(btnTaskStop); btnPanel.Controls.Add(btnTaskStop);
btnPanel.Controls.Add(btnTaskStart); btnPanel.Controls.Add(btnTaskStart);
btnPanel.Controls.Add(btnStopResume); btnPanel.Controls.Add(btnStopResume);
@ -102,7 +104,6 @@ namespace TimeTable {
tableView.Name = "tableView"; tableView.Name = "tableView";
tableView.Size = new Size(631, 378); tableView.Size = new Size(631, 378);
tableView.TabIndex = 1; tableView.TabIndex = 1;
// //
// taskTimeGridView // taskTimeGridView
// //
@ -110,18 +111,17 @@ namespace TimeTable {
taskTimeGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; taskTimeGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
taskTimeGridView.DataSource = bindingSource; taskTimeGridView.DataSource = bindingSource;
taskTimeGridView.Dock = DockStyle.Fill; taskTimeGridView.Dock = DockStyle.Fill;
taskTimeGridView.EditMode = DataGridViewEditMode.EditProgrammatically;
taskTimeGridView.Location = new Point(0, 0); taskTimeGridView.Location = new Point(0, 0);
taskTimeGridView.Name = "taskTimeGridView"; taskTimeGridView.Name = "taskTimeGridView";
taskTimeGridView.RowHeadersWidth = 51; taskTimeGridView.RowHeadersWidth = 51;
taskTimeGridView.Size = new Size(631, 378); taskTimeGridView.Size = new Size(631, 378);
taskTimeGridView.TabIndex = 0; taskTimeGridView.TabIndex = 0;
taskTimeGridView.EditMode = DataGridViewEditMode.EditProgrammatically; taskTimeGridView.CellContentDoubleClick += TimetableEditDoubleClick;
taskTimeGridView.CellContentDoubleClick += timetableEditDoubleClick;
// //
// con // con
// //
con.BusyTimeout = 0; con.BusyTimeout = 0;
//con.ConnectionString = sqlConnectionString;
con.ConnectionString = sqlConnectionString; con.ConnectionString = sqlConnectionString;
con.DefaultDbType = null; con.DefaultDbType = null;
con.DefaultMaximumSleepTime = 150; con.DefaultMaximumSleepTime = 150;
@ -137,9 +137,18 @@ namespace TimeTable {
con.TraceFlags = SQLiteTraceFlags.SQLITE_TRACE_NONE; con.TraceFlags = SQLiteTraceFlags.SQLITE_TRACE_NONE;
con.VfsName = null; con.VfsName = null;
con.WaitTimeout = 30000; con.WaitTimeout = 30000;
// bindingSource.DataSource = createDataTable();
bindingSource.DataSource = createDataTable(); bindingSource.DataSource = createDataTable();
// //
// btnDelete
//
btnDelete.Location = new Point(8, 78);
btnDelete.Name = "btnDelete";
btnDelete.Size = new Size(94, 26);
btnDelete.TabIndex = 4;
btnDelete.Text = "Delete";
btnDelete.UseVisualStyleBackColor = true;
btnDelete.Click += DeleteRow;
//
// Main // Main
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
@ -165,7 +174,14 @@ namespace TimeTable {
return table; return table;
} }
private void timetableEditDoubleClick(object sender, DataGridViewCellEventArgs e) { private void DeleteRow(object sender, EventArgs e) {
DataGridViewRow row = taskTimeGridView.Rows[0];
string currentId = row.Cells[0].Value.ToString();
SqliteCommands.DeleteTableRow(currentId, sqlConnectionString);
bindingSource.DataSource = createDataTable();
}
private void TimetableEditDoubleClick(object sender, DataGridViewCellEventArgs e) {
DataGridViewRow row = taskTimeGridView.Rows[0]; DataGridViewRow row = taskTimeGridView.Rows[0];
string uid = row.Cells[0].Value.ToString(); string uid = row.Cells[0].Value.ToString();
string start = row.Cells[1].Value.ToString(); string start = row.Cells[1].Value.ToString();
@ -184,6 +200,7 @@ namespace TimeTable {
con.Open(); con.Open();
sqliteCmd.ExecuteNonQuery(); sqliteCmd.ExecuteNonQuery();
con.Close(); con.Close();
bindingSource.DataSource = createDataTable();
} }
@ -224,5 +241,6 @@ namespace TimeTable {
private SQLiteConnection con; private SQLiteConnection con;
private SQLiteDataAdapter dataAdapter; private SQLiteDataAdapter dataAdapter;
private System.ComponentModel.IContainer components; private System.ComponentModel.IContainer components;
private Button btnDelete;
} }
} }