updfate 20250919
This commit is contained in:
@@ -1083,9 +1083,49 @@ namespace OnDoc.UICintrols
|
||||
DB db1 = new DB(AppParams.connectionstring);
|
||||
db1.Get_Tabledata("Select isnull(uri,'') from dokumenttyp where dokumenttypnr=" + dokumenttypnr.ToString(), false, true);
|
||||
if (db1.dsdaten.Tables[0].Rows[0][0].ToString() != "")
|
||||
|
||||
{
|
||||
Process.Start(db1.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
string uri = db1.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
bool personendokument = false;
|
||||
bool bpdokument = false;
|
||||
db1.Get_Tabledata("select * from Dokumenttyp_BP_Person_Erstellung where dokumenttypnr=" + dokumenttypnr.ToString(), false, true);
|
||||
if (db1.dsdaten.Tables[0].Rows.Count == 0)
|
||||
{
|
||||
personendokument = false;
|
||||
bpdokument = true;
|
||||
}
|
||||
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;
|
||||
if (personendokument) { bpdokument = false; }
|
||||
}
|
||||
db1 = null;
|
||||
if (uri.Contains("&partnernr&"))
|
||||
{
|
||||
if (partnernr < 1)
|
||||
{
|
||||
Partnersuche ps = new Partnersuche(personendokument, true, bpdokument, dokumenttypnr);
|
||||
ps.ShowDialog();
|
||||
if (ps.DialogResult == DialogResult.OK)
|
||||
{
|
||||
uri = uri.Replace("&partnernr&", ps.partnernr.ToString());
|
||||
Process.Start(uri);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uri = uri.Replace("&partnernr&", partnernr.ToString());
|
||||
Process.Start(uri);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Process.Start(uri);
|
||||
|
||||
return;
|
||||
}
|
||||
db1 = null;
|
||||
@@ -1299,7 +1339,7 @@ namespace OnDoc.UICintrols
|
||||
private void RibbonButtonNewDoc_Click(object sender, EventArgs e)
|
||||
{
|
||||
createnewdoc(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void hide_panels()
|
||||
{
|
||||
@@ -3261,6 +3301,94 @@ namespace OnDoc.UICintrols
|
||||
Admin_Taableeditor at = new Admin_Taableeditor();
|
||||
at.Show();
|
||||
}
|
||||
|
||||
private void dokumenteZuAndermKundeUmteilenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var records = sfDataGrid1.View.GetSelectedRecords();
|
||||
if (records.Count < 1) { return; }
|
||||
if (MessageBox.Show("Gewählte Dokumente zu einem anderen Kunden umteilen?", "Dokument umteilen", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; }
|
||||
int i = 0;
|
||||
int firstpartner = 0;
|
||||
string firstverantwortlich = "";
|
||||
int haserror = 0;
|
||||
PartnerUmteilung pu = new PartnerUmteilung();
|
||||
foreach (var record in records)
|
||||
{
|
||||
|
||||
var datarow = record as DataRowView;
|
||||
string documentid = datarow["dokumentid"].ToString();
|
||||
string partner = datarow["Partner-Nr"].ToString();
|
||||
string bezeichnung = datarow["DokTyp"].ToString();
|
||||
PartnerUmteilung.dokument pudok = new PartnerUmteilung.dokument();
|
||||
if (i == 0)
|
||||
{
|
||||
firstpartner = Convert.ToInt32(partner);
|
||||
firstverantwortlich = datarow["Verantwortlich"].ToString();
|
||||
pudok.partnernr = partner;
|
||||
pudok.dokumenttyp = bezeichnung;
|
||||
pudok.dokumentid = documentid;
|
||||
pu.doks.Add(pudok);
|
||||
i = 1;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
pudok.partnernr = partner;
|
||||
pudok.dokumenttyp = bezeichnung;
|
||||
pudok.dokumentid = documentid;
|
||||
pu.doks.Add(pudok);
|
||||
}
|
||||
|
||||
if (Convert.ToInt32(partner) != firstpartner) { haserror = 1; }
|
||||
if (firstverantwortlich != datarow["Verantwortlich"].ToString()) { haserror = 2; }
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
if (haserror==1)
|
||||
{
|
||||
pu = null;
|
||||
MessageBox.Show("Nicht alle Dokumente stammen vom gleichen Kunden. Umteilung nicht möglich.", "Kunde umteilen", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
if (haserror == 2)
|
||||
{
|
||||
pu = null;
|
||||
MessageBox.Show("Dokumente haben unterschiedliche Verantwortlichkeiten. Umteilung nicht möglich", "Kunde umteilen", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
pu.ShowDialog();
|
||||
refresh_dokumente();
|
||||
|
||||
//dokument_loeschen(documentid);
|
||||
}
|
||||
|
||||
private void dokumentMetaDatenBearbeitenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!row_selected()) return;
|
||||
var records = sfDataGrid1.View.GetSelectedRecords();
|
||||
if (records.Count > 1)
|
||||
{
|
||||
if (MessageBox.Show("Für mehrere Dokumente die Metadaten bearbeiten?", "Dokument bearbeiten", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; }
|
||||
|
||||
}
|
||||
foreach (var record in records)
|
||||
{
|
||||
var datarow = record as DataRowView;
|
||||
string documentid = datarow["dokumentid"].ToString();
|
||||
EditDokMetaData ed = new EditDokMetaData(datarow["dokumentid"].ToString());
|
||||
ed.ShowDialog();
|
||||
ed = null;
|
||||
|
||||
}
|
||||
refresh_dokumente();
|
||||
}
|
||||
catch (Exception ex) { MessageBox.Show(ex.Message);
|
||||
refresh_dokumente();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user