Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

This commit is contained in:
Christian
2019-11-14 16:16:57 +01:00
6 changed files with 14651 additions and 119 deletions

View File

@@ -14,6 +14,7 @@ using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.ICD10;
using BeWo.Data.ICF;
using BeWo.Service.Configuration;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
@@ -5801,57 +5802,56 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
string key = "2BT%eGprU\"E$!\"5Flq@l^^KZaYa\"u/icq@MMSWsy$XFo@#q3Arbnx@Plzv7s\\+$a";
//string key = "2BT%eGprU\"E$!\"5Flq@l^^KZaYa\"u/icq@MMSWsy$XFo@#q3Arbnx@Plzv7s\\+$a";
string url = "https://support.bewoplaner.de/api/geticf.php?k=[TENANT]";
//string url = "https://support.bewoplaner.de/api/geticf.php?k=[TENANT]";
if (MultitenancyOperationContextExt.Current != null)
{
url = url.Replace("[TENANT]", MultitenancyOperationContextExt.Current.Tenant);
}
else
{
url = url.Replace("[TENANT]", SessionFacade.Tenant);
}
//if (MultitenancyOperationContextExt.Current != null)
//{
// url = url.Replace("[TENANT]", MultitenancyOperationContextExt.Current.Tenant);
//}
//else
//{
// url = url.Replace("[TENANT]", SessionFacade.Tenant);
//}
String json = "";
//String json = "";
using (var client = new WebClient())
{
byte[] response = client.UploadValues(url, "POST", new NameValueCollection()
{
{"API-KEY", key}
});
//using (var client = new WebClient())
//{
// byte[] response = client.UploadValues(url, "POST", new NameValueCollection()
// {
// {"API-KEY", key}
// });
json = System.Text.Encoding.ASCII.GetString(response);
// json = System.Text.Encoding.ASCII.GetString(response);
}
//}
//[{"Oid":"1","Code":"","Bezeichnung":"Kapitel 1: Lernen und Wissensanwendung","Beschreibung":"","ParentOID":""}
//var icfentry = new { Oid = 0, Code = "", Bezeichnung = "", Beschreibung = "", ParentOid = 0 };
var icfList = JsonConvert.DeserializeObject<List<Icf>>(json);
//var icfList = JsonConvert.DeserializeObject<List<Icf>>(json);
//var rawList = DAOFactory.GenericDAO.GetAll<Icf>().ToList();
////var rawList = DAOFactory.GenericDAO.GetAll<Icf>().ToList();
var icfs = new List<ValueListEntryDC>
{
new ValueListEntryDC() {ParentOid = -1, TypeDescription = "ICF"}
};
//var icfs = new List<ValueListEntryDC>
//{
// new ValueListEntryDC() {ParentOid = -1, TypeDescription = "ICF"}
//};
icfs.AddRange(icfList.Select(x => new ValueListEntryDC()
{
ValueListEntryOid = x.Oid,
ParentOid = x.ParentOID,
TypeDescription = x.Bezeichnung,
Abbreviation = x.Code,
Notice = x.Beschreibung
}));
return icfs;
//icfs.AddRange(icfList.Select(x => new ValueListEntryDC()
//{
// ValueListEntryOid = x.Oid,
// ParentOid = x.ParentOID,
// TypeDescription = x.Bezeichnung,
// Abbreviation = x.Code,
// Notice = x.Beschreibung
//}));
return ICFDAO.GetIcf();
}
catch (Exception e)
{