You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.1 KiB
77 lines
2.1 KiB
using Microsoft.Office.Interop.Word;
|
|
using OnDoc.Klassen;
|
|
using Syncfusion.WinForms.DataGrid;
|
|
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 Syncfusion.Windows.Forms.Tools;
|
|
using Syncfusion.WinForms.Controls;
|
|
using Microsoft.Toolkit.Uwp.Notifications;
|
|
|
|
namespace OnDoc.UIControls.Administrator
|
|
{
|
|
public partial class TableEditor : SfForm
|
|
{
|
|
|
|
public string TableName { get; set; } = "";
|
|
Database.DB db = new Database.DB(AppParams.connectionstring);
|
|
|
|
|
|
public TableEditor()
|
|
{
|
|
InitializeComponent();
|
|
this.Style.TitleBar.BackColor = Theaming.Titelbar();
|
|
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
|
|
}
|
|
|
|
public TableEditor(string tablename)
|
|
{
|
|
InitializeComponent();
|
|
this.Style.TitleBar.BackColor = Theaming.Titelbar();
|
|
this.Style.TitleBar.ForeColor = Theaming.TitelFontColor();
|
|
TableName = tablename;
|
|
this.Text = tablename;
|
|
}
|
|
private void TableEditor_Load(object sender, EventArgs e)
|
|
{
|
|
update_data();
|
|
}
|
|
|
|
private void update_data()
|
|
{
|
|
db.Get_Tabledata_for_Update("Select * from "+ TableName,false,true);
|
|
sfDataGrid1.DataSource = db.daten.Tables[0];
|
|
}
|
|
|
|
private void toolStripButton2_Click(object sender, EventArgs e)
|
|
{
|
|
db.Update_Data();
|
|
ToastMessage.ShowToast("Speichern", "Daten erfolgreich gespeichert");
|
|
|
|
|
|
}
|
|
|
|
private void sfDataGrid1_AddNewRowInitiating(object sender, Syncfusion.WinForms.DataGrid.Events.AddNewRowInitiatingEventArgs e)
|
|
{
|
|
|
|
var data = e.NewObject as dynamic;
|
|
data["aktiv"] = true;
|
|
data["erstellt_am"] = DateTime.Now;
|
|
data["mutiert_am"] = DateTime.Now;
|
|
data["mutierer"]=AppParams.CurrentMitarbieter;
|
|
}
|
|
|
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
}
|