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.

109 lines
3.1 KiB

using Database;
using OnDoc.Diverses;
using OnDoc.Klassen;
using Syncfusion.WinForms.DataGrid.Enums;
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;
namespace OnDoc.UIControls
{
public partial class Dokwerte : UserControl
{
private string dokumentid { get; set; }
public Dokwerte()
{
InitializeComponent();
}
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
public void clear_details()
{
sfDataGrid1.DataSource = null;
}
public void set_panelheight(int height, Color background)
{
panel1.Height = height;
panel1.BackColor = background;
}
public void Update_Werte(string dokumentid)
{
if (dokumentid == "")
{
sfDataGrid1.DataSource = null;
return;
}
this.dokumentid = dokumentid;
DB db = new DB(AppParams.connectionstring);
db.clear_parameter();
db.add_parameter("@dokumentid", dokumentid);
db.Get_Tabledata("sp_ondoc_get_dokumentdetails", true, false);
this.sfDataGrid1.DataSource = db.dsdaten.Tables[0];
sfDataGrid1.Columns[0].Width = 120;
sfDataGrid1.Columns[1].Width = 170;
db.Get_Tabledata("Select * from dokumentbewilligung where aktiv=1 and dokumentid='" + dokumentid + "'", false, true);
if (db.dsdaten.Tables[0].Rows.Count > 0)
{
this.grppruefung.Height = this.Height = 150;
sfdatagridpruefung.DataSource=db.dsdaten.Tables[0];
for (int i = 3; i < sfdatagridpruefung.ColumnCount; i++)
{
sfdatagridpruefung.Columns[i].Visible = false;
}
sfdatagridpruefung.Columns[2].Width = 80;
sfdatagridpruefung.Columns[1].Width = 80;
sfdatagridpruefung.Columns[0].Width = sfdatagridpruefung.Width - 170;
}
else
{
this.grppruefung.Height = 0;
}
db = null;
}
private void sfDataGrid1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
}
}
private void sfDataGrid1_CopyCellContent(object sender, Syncfusion.WinForms.DataGrid.Events.CellCutCopyPasteEventArgs e)
{
//MessageBox.Show(e.ClipboardValue.ToString());
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
}
private void notizHistoryToolStripMenuItem_Click(object sender, EventArgs e)
{
ApprovalNotes an = new ApprovalNotes(this.dokumentid);
an.Show();
}
}
}