update 20241008
This commit is contained in:
@@ -16,6 +16,11 @@ using Syncfusion.Pdf.Graphics;
|
||||
using Windows.UI.WebUI;
|
||||
using OnDoc.Diverses;
|
||||
using System.Web.Security;
|
||||
using System.Drawing.Text;
|
||||
using BroadcastListener.Classes;
|
||||
using static BroadcastListener.Classes.Factory;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
||||
namespace OnDoc.UIControls
|
||||
{
|
||||
@@ -32,6 +37,11 @@ namespace OnDoc.UIControls
|
||||
|
||||
public string check_error { get; set; } = "";
|
||||
public clsdocgendata docgendata { get; set; }
|
||||
private bool bpperson_error { get; set; }=false;
|
||||
public int bpperson_error_type { get; set; } = 0;
|
||||
public bool personendokument { get; set; } = false;
|
||||
public string uniqid { get; set; } = Guid.NewGuid().ToString();
|
||||
public bool ausDokumentpaket { get; set; } = false;
|
||||
|
||||
|
||||
public UCAllgemeineDokumentParam()
|
||||
@@ -83,6 +93,7 @@ namespace OnDoc.UIControls
|
||||
|
||||
if (dokumenttypnr != 0)
|
||||
{
|
||||
set_personendokument();
|
||||
db.Get_Tabledata("Select * from dokumenttyp where dokumenttypnr=" + dokumenttypnr, false, true);
|
||||
System.Data.DataRow dr = db.dsdaten.Tables[0].Rows[0];
|
||||
this.txtbezeichnung.Text = dr["Bezeichnung"].ToString();
|
||||
@@ -110,6 +121,7 @@ namespace OnDoc.UIControls
|
||||
}
|
||||
catch { interop = false; }
|
||||
barcode = Convert.ToBoolean(dr["Vertrag"])== true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -158,11 +170,64 @@ namespace OnDoc.UIControls
|
||||
gridDokwertlist.Columns.Add(new GridImageColumn() { MappingName = "S", ImageLayout = ImageLayout.Center });
|
||||
gridDokwertlist.Columns["S"].Width = 25;
|
||||
gridDokwertlist.QueryImageCellStyle += gridDokwertlist_QueryImageCellStyle;
|
||||
gridDokwertlist.Columns["userinterface"].FilterPredicates.Add(new Syncfusion.Data.FilterPredicate() { FilterType=Syncfusion.Data.FilterType.Equals,FilterValue=true });
|
||||
|
||||
db = null;
|
||||
Refresh_Team();
|
||||
this.cbboxteam.SelectedIndex = 0;
|
||||
}
|
||||
public bool FilterRecords(object o)
|
||||
{
|
||||
string filterText = "FRANS";
|
||||
var item = o as DataRowView;
|
||||
if (item != null)
|
||||
{
|
||||
//if (item.CustomerID.Equals(filterText))
|
||||
// return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool set_personendokument()
|
||||
{
|
||||
DB db1 = new DB(AppParams.connectionstring);
|
||||
db1.Get_Tabledata("select * from Dokumenttyp_BP_Person_Erstellung where dokumenttypnr=" + this.dokumenttypnr.ToString(), false, true);
|
||||
if (db1.dsdaten.Tables[0].Rows.Count == 0) {
|
||||
personendokument = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (db1.dsdaten.Tables[0].Rows[0][1].ToString() == "2") personendokument=true;
|
||||
if (db1.dsdaten.Tables[0].Rows[0][1].ToString() == "1") personendokument = false;
|
||||
}
|
||||
return personendokument;
|
||||
}
|
||||
public bool check_bp_person()
|
||||
{
|
||||
DB db1 = new DB(AppParams.connectionstring);
|
||||
db1.Get_Tabledata("select * from Dokumenttyp_BP_Person_Erstellung where dokumenttypnr=" + this.dokumenttypnr.ToString(), false, true);
|
||||
bpperson_error_type = 0;
|
||||
if (db1.dsdaten.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
if (db1.dsdaten.Tables[0].Rows[0][1].ToString() == "2" && this.partnernr.ToString().Length < 9)
|
||||
{
|
||||
bpperson_error = true;
|
||||
bpperson_error_type = 1;
|
||||
if (!ausDokumentpaket) MessageBox.Show("Das gewöhlte Dokument muss für eine Person erstellt werden", "BP/Person", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
|
||||
}
|
||||
if (db1.dsdaten.Tables[0].Rows[0][1].ToString() == "1" && this.partnernr.ToString().Length > 8)
|
||||
{
|
||||
bpperson_error = true;
|
||||
bpperson_error_type = 2;
|
||||
if(!ausDokumentpaket) MessageBox.Show("Das gewöhlte Dokument muss für ein BP erstellt werden", "BP/Person", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
public void update_partner()
|
||||
{
|
||||
DB db = new DB(AppParams.connectionstring);
|
||||
@@ -192,7 +257,17 @@ namespace OnDoc.UIControls
|
||||
|
||||
|
||||
db = null;
|
||||
if (check_bp_person() == true)
|
||||
{
|
||||
if (!ausDokumentpaket) Broadcaster().Broadcast("BtnErstellung", new SenderInfo("UIGenDoc", "Enable", uniqid));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ausDokumentpaket) Broadcaster().Broadcast("BtnErstellung", new SenderInfo("UIGenDoc", "Disable", uniqid));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void gridDokwertlist_QueryImageCellStyle(object sender, Syncfusion.WinForms.DataGrid.Events.QueryImageCellStyleEventArgs e)
|
||||
{
|
||||
var rowdata = (DataRowView)e.Record;
|
||||
@@ -210,7 +285,7 @@ namespace OnDoc.UIControls
|
||||
|
||||
try
|
||||
{
|
||||
if (datenherkunft.ToString().Trim() != "")
|
||||
if (datenherkunft.ToString().Trim() != "" && datenherkunft.ToString().Trim()!="&Freitext&")
|
||||
{
|
||||
e.Image = (System.Drawing.Image.FromFile(System.Windows.Forms.Application.StartupPath + @"\images\Search.png"));
|
||||
|
||||
@@ -255,7 +330,9 @@ namespace OnDoc.UIControls
|
||||
var feldwert = dataRowView.Row["feldwert"].ToString().Trim();
|
||||
var bezeichnung = dataRowView.Row["bezeichnung"];
|
||||
if (zwingend==true && feldwert=="")
|
||||
{ check_error = check_error + "- " + bezeichnung + " Feldwert ist zwingend" + "//"; }
|
||||
{
|
||||
if (check_error != "") { check_error=check_error+Environment.NewLine; }
|
||||
check_error = check_error + "- " + bezeichnung + " Feldwert ist zwingend" ; }
|
||||
}
|
||||
}
|
||||
if (check_error == "") { return true; } else { return false; }
|
||||
@@ -282,7 +359,7 @@ namespace OnDoc.UIControls
|
||||
{
|
||||
docgendata.zustaendigmitarbeiter = cbboxzustaendigmitarbeiter.SelectedValue.ToString();
|
||||
}
|
||||
docgendata.status = "-1";
|
||||
docgendata.status = " - 1";
|
||||
docgendata.ersteller = AppParams.CurrentMitarbieter.ToString();
|
||||
docgendata.dokumentdatum = DateDokumentDatum.DateTimeText.ToString();
|
||||
docgendata.bezeichnung = txtbezeichnung.Text;
|
||||
@@ -351,6 +428,7 @@ namespace OnDoc.UIControls
|
||||
|
||||
private string data_select(string datenherkunft, string feldtyp)
|
||||
{
|
||||
if (datenherkunft=="" || datenherkunft=="&Freitext&") { return ""; }
|
||||
switch (feldtyp.ToUpper())
|
||||
{
|
||||
case "DATUMSHORT":
|
||||
@@ -381,7 +459,7 @@ namespace OnDoc.UIControls
|
||||
break;
|
||||
case "TEXT":
|
||||
if (datenherkunft.Substring(0, 1) != "&") { return ""; }
|
||||
if (datenherkunft.Substring(0, 8).ToUpper() == "&PARTNER")
|
||||
if (datenherkunft.Length >= 8 && datenherkunft.Substring(0, 8).ToUpper() == "&PARTNER")
|
||||
{
|
||||
Partnersuche p = new Partnersuche();
|
||||
p.ShowDialog();
|
||||
@@ -455,6 +533,9 @@ namespace OnDoc.UIControls
|
||||
|
||||
private void gridDokwertlist_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (e.DataColumn.Index == 15)
|
||||
{
|
||||
var selectedItem = e.DataRow;
|
||||
@@ -466,6 +547,9 @@ namespace OnDoc.UIControls
|
||||
dataRow["feldwert"] = data_select(datenherkunft, feldtyp);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user