CB: Translation eingebaut

This commit is contained in:
Christian
2017-11-06 10:30:25 +01:00
parent 169b0583e4
commit f7e7b69eab
85 changed files with 3022 additions and 616 deletions

View File

@@ -861,9 +861,20 @@ namespace BeWo.Service.ServiceImplementations
public long InsertNewCustomer(CustomerDC pCustomerDC)
{
try
var bsi = PluginLoader.FindClass<SaveInterceptor>();
if (bsi != null)
{
if (!bsi.AllowSaveCustomer(pCustomerDC))
{
throw new FaultException<BeWoFault>(new BeWoFault("Klient konnte nicht gespeichert werden.", BeWoFaultType.CustomWithoutDetails));
}
}
try
{
Customer lCustomer = MapperFactory.CustomerDC_Customer.MapToNewEntity(pCustomerDC);
Customer lCustomer = MapperFactory.CustomerDC_Customer.MapToNewEntity(pCustomerDC);
DAOFactory.GenericDAO.Insert(lCustomer);
var lOriginal = DAOFactory.GenericDAO.LoadByID<Customer>(lCustomer.Oid.Value);
@@ -1075,9 +1086,20 @@ namespace BeWo.Service.ServiceImplementations
public long UpdateCustomer(CustomerDC pCustomerDC)
{
try
var bsi = PluginLoader.FindClass<SaveInterceptor>();
if (bsi != null)
{
if (!bsi.AllowSaveCustomer(pCustomerDC))
{
throw new FaultException<BeWoFault>(new BeWoFault("Klient konnte nicht gespeichert werden.", BeWoFaultType.CustomWithoutDetails));
}
}
try
{
var lOriginal = DAOFactory.GenericDAO.LoadByID<Customer>(pCustomerDC.CustomerOid.Value);
var lOriginal = DAOFactory.GenericDAO.LoadByID<Customer>(pCustomerDC.CustomerOid.Value);
object[] Lists = GetFromNHibernateDecoupledCustomerRelatedLists(lOriginal);
@@ -3692,24 +3714,24 @@ namespace BeWo.Service.ServiceImplementations
{
foreach (var appcode in cusappcode)
{
if (!benutzerName.Equals("") && appcode.BenutzerName != null &&
!appcode.BenutzerName.Equals(benutzerName))
{
//if (!benutzerName.Equals("") && appcode.BenutzerName != null &&
// !appcode.BenutzerName.Equals(benutzerName))
//{
appcode.BenutzerName = benutzerName;
}
//}
if (!passwort.Equals("") && appcode.Passwort != null && !appcode.Passwort.Equals(passwort))
{
//if (!passwort.Equals("") && appcode.Passwort != null && !appcode.Passwort.Equals(passwort))
//{
appcode.Passwort = passwort;
string salt = BCrypt.GenerateSalt();
appcode.BCryptPassword = BCrypt.HashPassword(passwort, salt);
}
//}
}
if (!benutzerName.Equals("") || !passwort.Equals("")) {
//if (!benutzerName.Equals("") || !passwort.Equals("")) {
DAOFactory.GenericDAO.Update(cusappcode);
}
//}
}
else
{
@@ -3719,13 +3741,17 @@ namespace BeWo.Service.ServiceImplementations
cusApp.Benutzername = benutzerName;
cusApp.Passwort = passwort;
cusApp.CustomerOid = pCustomerOid;
var yx = MapperFactory.CustomerAPPCodeDC_CustomerAPPCode.MapToNewEntity(cusApp);
//if (!benutzerName.Equals("") || !passwort.Equals(""))
//{
string salt = BCrypt.GenerateSalt();
yx.BCryptPassword = BCrypt.HashPassword(passwort, salt);
if (!benutzerName.Equals("") || !passwort.Equals(""))
{
DAOFactory.GenericDAO.Insert(yx);
}
//}
}
}

View File

@@ -3256,34 +3256,46 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
#if DEBUG
kundennummer = "5473568546";
apikey = "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97";
#endif
//TODO Abfragen erweitern
DeletZufallsCode(apikey, kundennummer, "C" + userOid);
CustomerAPPCode newCode = new CustomerAPPCode();
//abfangeritis starten
string zufallscode = ErzeugeZufallsCode(apikey, kundennummer, "C" + userOid);
if (zufallscode != null)
{
newCode.CustomerCode = zufallscode; //bei C noch die UserID mitgeben
newCode.CustomerOid = customerOid;
newCode.CustomerCodeGenDate = DateTime.Now;
var x = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid);
int ischatAktive = 0;
foreach (var item in x)
var appcodes = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid).ToList();
CustomerAPPCode newCode = null;
if (appcodes.Count > 0)
{
ischatAktive = item.IsChatAktiv;
break;
newCode = appcodes[0];
}
else
{
newCode = new CustomerAPPCode();
//var code = x.Last().CustomerCode;
newCode.CustomerCode = zufallscode; //bei C noch die UserID mitgeben
newCode.CustomerOid = customerOid;
}
newCode.CustomerCodeGenDate = DateTime.Now;
newCode.IsChatAktiv = 1;
//int ischatAktive = 0;
newCode.IsChatAktiv = ischatAktive;
//foreach (var item in x)
//{
// ischatAktive = item.IsChatAktiv;
// break;
//}
//newCode.IsChatAktiv = ischatAktive;
DAOFactory.GenericDAO.Insert(newCode);
@@ -4770,6 +4782,17 @@ namespace BeWo.Service.ServiceImplementations
}
}
public Dictionary<String, String> GetTranslationDictionary()
{
var td = PluginLoader.FindClass<TranslationDictionary>();
if (td != null)
{
return td.GetTranslationDictionary();
}
return null;
}
#endregion
}
}