Auftraggeber wird in protokoll mit abgebildet

This commit is contained in:
Husky
2018-07-30 12:54:39 +02:00
parent f79d8985f0
commit 3b6b3a9080
11 changed files with 61 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
using System;
using SanShared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -9,7 +10,7 @@ namespace KlassenBIB
/// <summary>
///
/// </summary>
public class Auftraggeber
public class Auftraggeber :IAuftraggeber
{
/// <summary>
///

View File

@@ -56,9 +56,9 @@ namespace KlassenBIB
///
/// </summary>
/// <param name="destinationPath"></param>
/// <param name="projekt">Projekt</param>
/// <returns></returns>
public Hashtable MakeProtokoll(string destinationPath)
public Hashtable MakeProtokoll(string destinationPath, IProjekt projekt)
{
Hashtable grunddaten = new Hashtable()
{
@@ -101,14 +101,14 @@ namespace KlassenBIB
};
double LaengeGesamt = this.Inspektionsobjekt.Haltungslaenge + this.Inspektionsobjekt.Schachtlaenge;
grunddaten["AG_Vorname"] = "";
grunddaten["AG_Vorname"] = projekt.Auftraggeber.Name;
grunddaten["KLP_Nummer"] = "";
grunddaten["KLP_Datum"] = DateTime.Now.ToShortDateString();
grunddaten["AG_Ort"] = "";
grunddaten["AG_Strasse"] = "";
grunddaten["AG_Ansprechpartner"] = "";
grunddaten["AG_Ort"] = projekt.Auftraggeber.Ort;
grunddaten["AG_Strasse"] = projekt.Auftraggeber.Strasse;
grunddaten["AG_Ansprechpartner"] = projekt.Auftraggeber.Ansprechpartner;
grunddaten["BM_Ort"] = Inspektionsobjekt.OrtName;
grunddaten["BM_Strasse"] = Inspektionsobjekt.StrasseName;
grunddaten["BM_Schacht_von"] = Inspektionsobjekt.VonPunkt;

View File

@@ -1,4 +1,5 @@
using System;
using SanShared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -12,7 +13,7 @@ namespace KlassenBIB
///
/// </summary>
[ContentProperty("Objekte")]
public class Projekt
public class Projekt :IProjekt
{
/// <summary>
///
@@ -25,7 +26,7 @@ namespace KlassenBIB
/// <summary>
///
/// </summary>
public Auftraggeber Auftraggeber { get; set; }
public IAuftraggeber Auftraggeber { get; set; }
/// <summary>
///
/// </summary>

View File

@@ -0,0 +1,25 @@
namespace SanShared
{
/// <summary>
///
/// </summary>
public interface IAuftraggeber
{
/// <summary>
///
/// </summary>
string Name { get; set; }
/// <summary>
///
/// </summary>
string Strasse { get; set; }
/// <summary>
///
/// </summary>
string Ort { get; set; }
/// <summary>
///
/// </summary>
string Ansprechpartner { get; set; }
}
}

View File

@@ -16,7 +16,8 @@ namespace SanShared
///
/// </summary>
/// <param name="destinationPath"></param>
/// <param name="projekt">Projekt</param>
/// <returns></returns>
Hashtable MakeProtokoll(string destinationPath);
Hashtable MakeProtokoll(string destinationPath, IProjekt projekt);
}
}

13
SanShared/IProjekt.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace SanShared
{
/// <summary>
///
/// </summary>
public interface IProjekt
{
/// <summary>
///
/// </summary>
IAuftraggeber Auftraggeber { get; set; }
}
}

View File

@@ -43,8 +43,10 @@
<ItemGroup>
<Compile Include="BilderObject.cs" />
<Compile Include="Exceptions\LangNotFoundException.cs" />
<Compile Include="IAuftraggeber.cs" />
<Compile Include="ILanguage.cs" />
<Compile Include="IMakeProtokol.cs" />
<Compile Include="IProjekt.cs" />
<Compile Include="ITemperature.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UVcsvStrukture.cs" />

View File

@@ -1,4 +1,5 @@
using KlassenBIB;
using SanShared;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -19,7 +20,7 @@ namespace SanSystem
/// <summary>
///
/// </summary>
public FrmAuftraggeberEdit(Auftraggeber auftraggeber)
public FrmAuftraggeberEdit(IAuftraggeber auftraggeber)
{
InitializeComponent();
txt_name.DataBindings.Add("Text", auftraggeber, "Name");

View File

@@ -32,7 +32,7 @@ namespace SanSystem
void BuildBericht(List<Inspektionsobjekt> list)
{
Hashtable grundDaten = MakeProtokoll("");
Hashtable grundDaten = MakeProtokoll("",null);
DataTable inliner = getMassenTableInliner();
@@ -95,7 +95,7 @@ namespace SanSystem
frmOptions.ShowDialog();
}
public Hashtable MakeProtokoll(string destinationPath)
public Hashtable MakeProtokoll(string destinationPath, IProjekt projekt)
{
Hashtable grundDaten = new Hashtable()
{

View File

@@ -307,7 +307,7 @@ namespace SanSystem
{
MessageBox.Show("Warnung, es wurden keine Daten von der Anlage geladen, Grafik konnte nicht erstellt werden");
}
Hashtable hashtable = inliner.MakeProtokoll(destinationPath);
Hashtable hashtable = inliner.MakeProtokoll(destinationPath,Database.Datenbank.Instance.loadedProjekt);
DirectoryInfo directory = Directory.GetParent(destinationPath);
string speicherpfad = directory.FullName;
BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbau.docx", speicherpfad,inliner.Inspektionsobjekt.Objektbezeichnung, hashtable, new List<BilderObject>());