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.

85 lines
2.4 KiB

using OnDoc.Klassen;
using Database;
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.Web.UI.WebControls;
using System.Windows.Forms;
namespace OnDoc.UICintrols
{
public partial class Vorlagenauswahl : UserControl
{
public int dokumenttypnr { get; set; } = 0;
public Vorlagenauswahl()
{
InitializeComponent();
}
private void txtSearch_KeyDown(object sender, KeyEventArgs e)
{
}
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void Vorlagenauswahl_Load(object sender, EventArgs e)
{
}
public void load_standard(string filter)
{
string where = "";
if (filter != "")
{
where = "and bezeichnungondoconbase like '%" + filter.Replace(" ", "%") + "%'";
}
DB db = new DB(AppParams.connectionstring);
db.Get_Tabledata("Select distinct dokumenttypnr as id, bezeichnung, bezeichnung ondoconbase from dokumenttyp where aktiv=1 "+where+" order by bezeichnung",false,true);
sfListView1.DataSource = db.dsdaten.Tables[0];
sfListView1.DisplayMember = "bezeichnungondoconbase";
sfListView1.ValueMember = "id";
}
private void ribbonButton1_Click(object sender, EventArgs e)
{
dokumenttypnr = 0;
this.ParentForm.Close();
}
private void RibbonTextSearch_TextBoxKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter) {
load_standard(RibbonTextSearch.TextBoxText);
}
}
private void RibbonButtonSearch_Click(object sender, EventArgs e)
{
if (RibbonTextSearch.TextBoxText.Trim().Length > 0) {
load_standard(RibbonTextSearch.TextBoxText);
}
}
private void sfListView1_DoubleClick(object sender, EventArgs e)
{
foreach (DataRowView item in sfListView1.SelectedItems)
{
dokumenttypnr = Convert.ToInt32(item.Row[0].ToString());
this.ParentForm.Close();
}
}
}
}