update 20241113
This commit is contained in:
@@ -37,11 +37,15 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAll", LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
string SQL = "Select * from Antwortadresse order by bezeichnung";
|
||||
if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
|
||||
if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
|
||||
db.Get_Tabledata(SQL, false, true);
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAll", LogLevelType.Debug);
|
||||
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -69,12 +73,22 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetByID ID:"+ID, LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
string SQL = "Select * from Antwortadresse where id=" + ID;
|
||||
if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
|
||||
if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
|
||||
db.Get_Tabledata(SQL, false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetByID ID:" + ID, LogLevelType.Debug);
|
||||
|
||||
return Ok();
|
||||
} else {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetByID ID:" + ID, LogLevelType.Debug);
|
||||
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -101,12 +115,22 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and tgnummer='" + tgnummer + "' order by bezeichnung ";
|
||||
if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
|
||||
if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
|
||||
db.Get_Tabledata(SQL, false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
|
||||
|
||||
return Ok();
|
||||
} else {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByTGNummer", LogLevelType.Debug);
|
||||
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -132,12 +156,20 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:"+Mitarbeiternr, LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
string SQL = "Select * from AntwortAdresse_Mitarbeiter where aktiv=1 and Mitarbeiternr='" + Mitarbeiternr + "' ";
|
||||
if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
|
||||
if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
|
||||
db.Get_Tabledata(SQL, false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:" + Mitarbeiternr, LogLevelType.Debug);
|
||||
return Ok();
|
||||
} else {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Adresse GetAllMitarbeiterByMitarbeiterNr Ma-Nr:" + Mitarbeiternr, LogLevelType.Debug);
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -166,12 +198,19 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start GetMitarbeiterByID ID: "+ID, LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
string SQL = "Select * from AntwortAdresse_Mitarbeiter where id=" + ID;
|
||||
if (OutFormat == "JSON") { SQL = SQL + " for json path"; }
|
||||
if (OutFormat == "XML") { SQL = SQL + " for xml path"; }
|
||||
db.Get_Tabledata(SQL, false, true);
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) { return Ok(); } else { return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0) {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende GetMitarbeiterByID ID: " + ID, LogLevelType.Debug);
|
||||
return Ok();
|
||||
} else {
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende GetMitarbeiterByID ID: " + ID, LogLevelType.Debug);
|
||||
return Ok(db.dsdaten.Tables[0].Rows[0][0].ToString()); };
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -197,6 +236,8 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
|
||||
|
||||
Database.DB db = new Database.DB(connectionstring);
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@tgnummer", TGNummer);
|
||||
@@ -204,10 +245,12 @@ namespace API_NetFramework.Controllers
|
||||
db.Get_Tabledata("sp_get_gas_einzeilig", true, false);
|
||||
if (db.dsdaten.Tables[0].Rows.Count == 0)
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.NotFound, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende GetGASAdressen_Einzeilig TGNummer: " + TGNummer, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.OK, db.dsdaten.Tables[0].Rows[0][0].ToString());
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user