Nach Update Syncfusion / Anpassungen Nativ
This commit is contained in:
76
Client/Backup/UIControls/Administrator/TableEditor.cs
Normal file
76
Client/Backup/UIControls/Administrator/TableEditor.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user