update 20241011
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Database;
|
||||
using OnDoc.Klassen;
|
||||
using Syncfusion.Windows.Forms;
|
||||
using Syncfusion.Windows.Forms.Tools;
|
||||
@@ -16,6 +17,8 @@ namespace OnDoc.Diverses
|
||||
public partial class InputDialog : SfForm
|
||||
{
|
||||
public string result = "";
|
||||
public string resulttext = "";
|
||||
private bool isMaDialog = false;
|
||||
public InputDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -31,15 +34,32 @@ namespace OnDoc.Diverses
|
||||
textBox1.Text = defaultvalue;
|
||||
this.Text= caption;
|
||||
this.label1.Text=description;
|
||||
|
||||
this.cbboxMitarbeiter.Visible = false;
|
||||
}
|
||||
|
||||
public InputDialog(bool Mitarbeiter,string description)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.textBox1.Visible = false;
|
||||
this.cbboxMitarbeiter.Visible = true;
|
||||
this.label1.Text = description;
|
||||
isMaDialog = true;
|
||||
}
|
||||
private void btnok_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (isMaDialog)
|
||||
{
|
||||
result = cbboxMitarbeiter.SelectedValue.ToString();
|
||||
DialogResult = DialogResult.OK;
|
||||
resulttext = cbboxMitarbeiter.Text;
|
||||
return;
|
||||
}
|
||||
if (textBox1.Text.Trim() != "")
|
||||
{
|
||||
result = textBox1.Text;
|
||||
result = textBox1.Text;
|
||||
DialogResult = DialogResult.OK;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,15 +73,36 @@ namespace OnDoc.Diverses
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
btnok_Click(sender, e);
|
||||
if (textBox1.Text.Trim().Length>0 ) btnok_Click(sender, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (textBox1.Text.Trim().Length > 0) btnok.Enabled = true; else btnok.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void InputDialog_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.SetDesktopLocation(Cursor.Position.X, Cursor.Position.Y);
|
||||
textBox1.SelectionStart = 0;
|
||||
textBox1.SelectionLength = textBox1.Text.Length;
|
||||
|
||||
if (isMaDialog)
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
db.clear_parameter();
|
||||
db.Get_Tabledata("SP_Dokumentbearbeitung_Mitarbeiter", true, false);
|
||||
cbboxMitarbeiter.DataSource = db.dsdaten.Tables[0];
|
||||
cbboxMitarbeiter.DisplayMember = "name";
|
||||
cbboxMitarbeiter.ValueMember = "mitarbeiternr";
|
||||
db = null;
|
||||
cbboxMitarbeiter.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void cbboxMitarbeiter_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
btnok.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user