Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
Ein Arsch voll Konflikte.
This commit is contained in:
@@ -57,8 +57,10 @@ namespace BeWo.Service.Configuration
|
||||
|
||||
public bool SortServiceDescriptionAlphabetically { get; set; }
|
||||
|
||||
|
||||
public static AppSettings CreateSettings()
|
||||
public bool ShowChat { get; set; }
|
||||
|
||||
|
||||
public static AppSettings CreateSettings()
|
||||
{
|
||||
AppSettings settings = new AppSettings();
|
||||
|
||||
@@ -212,6 +214,12 @@ namespace BeWo.Service.Configuration
|
||||
showRtfTextfeld = true;
|
||||
}
|
||||
|
||||
val = GetSettingValue(mandator.Settings, "ShowChat");
|
||||
if (val != null && val.Equals("1"))
|
||||
{
|
||||
settings.ShowChat = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,12 @@ namespace BeWo.Service.Core
|
||||
|
||||
public static bool IsValidEmail(string email)
|
||||
{
|
||||
return Regex.IsMatch(email, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
|
||||
//return Regex.IsMatch(email, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
|
||||
|
||||
return Regex.IsMatch(email,
|
||||
@"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
|
||||
@"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-0-9a-z]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$",
|
||||
RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250));
|
||||
}
|
||||
|
||||
public static bool SendErrorMail(string subject, string body)
|
||||
@@ -115,7 +120,7 @@ namespace BeWo.Service.Core
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!IsValidEmail(to) || !IsValidEmail(fromEMail))
|
||||
if (!IsValidEmail(to) || !IsValidEmail(fromEMail))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.EquityContribution = pEntity.EquityContribution;
|
||||
pDataContract.CustomerAlias = pEntity.CustomerAlias;
|
||||
pDataContract.DebitorNumber = pEntity.DebitorNumber;
|
||||
pDataContract.CostCenter = pEntity.CostCenter;
|
||||
|
||||
if (pEntity.Person.Address != null)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using BeWo.Data.Access;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using System.Linq;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
@@ -28,10 +30,14 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.PersonAdressStadt = pEntity.Person.Address.Town;
|
||||
|
||||
}
|
||||
|
||||
if(pEntity.Arbeitszeiten != null){
|
||||
pDataContract.Arbeitszeit = MapperFactory.ArbeitszeitDC_Arbeitszeit.MapToNewDCs(pEntity.Arbeitszeiten);
|
||||
|
||||
pDataContract.Arbeitszeit = new List<ArbeitszeitDC>();
|
||||
if (pEntity.Arbeitszeiten != null)
|
||||
{
|
||||
|
||||
//pDataContract.Arbeitszeit = MapperFactory.ArbeitszeitDC_Arbeitszeit.MapToNewDCs(pEntity.Arbeitszeiten);
|
||||
}
|
||||
|
||||
|
||||
pDataContract.CompactEmployee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity);
|
||||
|
||||
|
||||
50
Service/DCEntityMapper/DienstDC_Dienst.cs
Normal file
50
Service/DCEntityMapper/DienstDC_Dienst.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using System.Collections.Generic;
|
||||
using BS.Shared.Core;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class DienstDC_Dienst : AbstractIDCEntityMapper<Dienst, DienstDC>
|
||||
{
|
||||
public override DienstDC MergeWithDC(Dienst bEntity, DienstDC bDataContract)
|
||||
{
|
||||
bDataContract.DienstOid = bEntity.Oid;
|
||||
bDataContract.DienstNotice = bEntity.Notice;
|
||||
bDataContract.DienstVersion = bEntity.Version;
|
||||
bDataContract.DienstName = bEntity.DienstName;
|
||||
bDataContract.Kurz = bEntity.Kurz;
|
||||
bDataContract.Farbe = bEntity.Farbe;
|
||||
bDataContract.Start = bEntity.Start;
|
||||
bDataContract.Ende = bEntity.Ende;
|
||||
bDataContract.Pause = bEntity.Pause;
|
||||
|
||||
return bDataContract;
|
||||
}
|
||||
|
||||
public override Dienst MergeWithEntity(DienstDC bDataContract, Dienst bEntity)
|
||||
{
|
||||
this.ConcurrencyCheck(bDataContract.DienstVersion, bEntity);
|
||||
|
||||
bEntity.Oid = bDataContract.DienstOid;
|
||||
bEntity.Notice = bDataContract.DienstNotice;
|
||||
bEntity.DienstName = bDataContract.DienstName;
|
||||
bEntity.Kurz = bDataContract.Kurz;
|
||||
bEntity.Farbe = bDataContract.Farbe;
|
||||
bEntity.Start = bDataContract.Start;
|
||||
bEntity.Ende = bDataContract.Ende;
|
||||
bEntity.Pause = bDataContract.Pause;
|
||||
|
||||
return bEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(DienstDC bDC, Dienst bEntity)
|
||||
{
|
||||
return bDC.DienstOid != null && bDC.DienstOid == bEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
66
Service/DCEntityMapper/GoalRatingDC_GoalRating.cs
Normal file
66
Service/DCEntityMapper/GoalRatingDC_GoalRating.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class GoalRatingDC_GoalRating : AbstractIDCEntityMapper<GoalRating, GoalRatingDC>
|
||||
{
|
||||
public override GoalRatingDC MergeWithDC(GoalRating pEntity, GoalRatingDC pDataContract)
|
||||
{
|
||||
pDataContract.GoalRatingOid = pEntity.Oid;
|
||||
pDataContract.GoalRatingVersion = pEntity.Version;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
|
||||
if (pEntity.RatingType != null)
|
||||
{
|
||||
pDataContract.RatingType = MapperFactory.RatingTypeDC_RatingType.MapToNewDC(pEntity.RatingType);
|
||||
}
|
||||
if (pEntity.ValueListEntryOid.HasValue)
|
||||
{
|
||||
pDataContract.GoalEntry = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(DAOFactory.GenericDAO.LoadByID<ValueListEntry>(pEntity.ValueListEntryOid.Value));
|
||||
}
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override GoalRating MergeWithEntity(GoalRatingDC pDataContract, GoalRating pEntity)
|
||||
{
|
||||
ConcurrencyCheck(pDataContract.GoalRatingVersion, pEntity);
|
||||
|
||||
pEntity.Oid = pDataContract.GoalRatingOid;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
|
||||
if (pDataContract.RatingType == null)
|
||||
{
|
||||
pEntity.RatingType = null;
|
||||
}
|
||||
else if (pEntity.RatingType == null || pEntity.RatingType.Oid != pDataContract.RatingType.RatingTypeOid)
|
||||
{
|
||||
pEntity.RatingType = DAOFactory.GenericDAO.LoadByID<RatingType>(pDataContract.RatingType.RatingTypeOid.Value);
|
||||
}
|
||||
|
||||
if (pDataContract.GoalEntry == null)
|
||||
{
|
||||
pEntity.ValueListEntryOid = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
pEntity.ValueListEntryOid = pDataContract.GoalEntry.ValueListEntryOid;
|
||||
}
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(GoalRatingDC pDC, GoalRating pEntity)
|
||||
{
|
||||
if (pDC.GoalRatingOid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.GoalRatingOid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.SenderPostCode = pEntity.SenderAddress.PostalCode;
|
||||
pDataContract.SenderAddressVersion = pEntity.SenderAddress.Version;
|
||||
}
|
||||
|
||||
|
||||
if (pEntity.RecipientAddress != null)
|
||||
{
|
||||
pDataContract.RecipientAddressOid = pEntity.RecipientAddress.Oid;
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
pDataContract.AllowSbd = !string.IsNullOrEmpty(pDataContract.ClientId) && pDataContract.ClientId == "SBD";
|
||||
|
||||
#if DEBUG
|
||||
//pDataContract.AllowSbd = true;
|
||||
#endif
|
||||
pDataContract.Apikey = pEntity.Apikey;
|
||||
|
||||
return pDataContract;
|
||||
|
||||
@@ -238,6 +238,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
private static BudgetDC_Budget _BudgetDC_Budget;
|
||||
|
||||
private static DienstDC_Dienst _DienstDC_Dienst;
|
||||
|
||||
private static FlexibleReportLayoutDC_FlexibleReportLayout _FlexibleReportLayoutDC_FlexibleReportLayout;
|
||||
|
||||
private static HomeViewPanelDC_HomeViewPanel _HomeViewPanelDC_HomeViewPanel;
|
||||
@@ -260,6 +262,12 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
private static ReportTemplateDC_ReportTemplate _ReportTemplateDC_ReportTemplate;
|
||||
|
||||
private static RatingDC_Rating _RatingDC_Rating;
|
||||
|
||||
private static RatingTypeDC_RatingType _RatingTypeDC_RatingType;
|
||||
|
||||
private static GoalRatingDC_GoalRating _GoalRatingDC_GoalRating;
|
||||
|
||||
|
||||
public static MedRecordDC_MedRecord MedRecordDC_MedRecord =>
|
||||
_MedRecordDC_MedRecord ?? (_MedRecordDC_MedRecord = new MedRecordDC_MedRecord());
|
||||
@@ -645,6 +653,9 @@ namespace BeWo.Service.DCEntityMapper
|
||||
public static BudgetDC_Budget BudgetDC_Budget =>
|
||||
_BudgetDC_Budget ?? (_BudgetDC_Budget = new BudgetDC_Budget());
|
||||
|
||||
public static DienstDC_Dienst DienstDC_Dienst =>
|
||||
_DienstDC_Dienst ?? (_DienstDC_Dienst = new DienstDC_Dienst());
|
||||
|
||||
public static FlexibleReportLayoutDC_FlexibleReportLayout FlexibleReportLayoutDC_FlexibleReportLayout =>
|
||||
_FlexibleReportLayoutDC_FlexibleReportLayout ?? (_FlexibleReportLayoutDC_FlexibleReportLayout = new FlexibleReportLayoutDC_FlexibleReportLayout());
|
||||
|
||||
@@ -653,5 +664,14 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
public static ReportTemplateDC_ReportTemplate ReportTemplateDC_ReportTemplate =>
|
||||
_ReportTemplateDC_ReportTemplate ?? (_ReportTemplateDC_ReportTemplate = new ReportTemplateDC_ReportTemplate());
|
||||
|
||||
public static RatingDC_Rating RatingDC_Rating =>
|
||||
_RatingDC_Rating ?? (_RatingDC_Rating = new RatingDC_Rating());
|
||||
|
||||
public static GoalRatingDC_GoalRating GoalRatingDC_GoalRating =>
|
||||
_GoalRatingDC_GoalRating ?? (_GoalRatingDC_GoalRating = new GoalRatingDC_GoalRating());
|
||||
|
||||
public static RatingTypeDC_RatingType RatingTypeDC_RatingType =>
|
||||
_RatingTypeDC_RatingType ?? (_RatingTypeDC_RatingType = new RatingTypeDC_RatingType());
|
||||
}
|
||||
}
|
||||
50
Service/DCEntityMapper/RatingDC_Rating.cs
Normal file
50
Service/DCEntityMapper/RatingDC_Rating.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class RatingDC_Rating : AbstractIDCEntityMapper<Rating, RatingDC>
|
||||
{
|
||||
public override RatingDC MergeWithDC(Rating pEntity, RatingDC pDataContract)
|
||||
{
|
||||
pDataContract.RatingOid = pEntity.Oid;
|
||||
pDataContract.RatingVersion = pEntity.Version;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.RTFNotice = pEntity.RTFNotice;
|
||||
pDataContract.DisplayName = pEntity.DisplayName;
|
||||
pDataContract.StartDate = pEntity.StartDate;
|
||||
|
||||
pDataContract.GoalRatingList = MapperFactory.GoalRatingDC_GoalRating.MapToNewDCs(pEntity.GoalRatingList);
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override Rating MergeWithEntity(RatingDC pDataContract, Rating pEntity)
|
||||
{
|
||||
ConcurrencyCheck(pDataContract.RatingVersion, pEntity);
|
||||
|
||||
pEntity.Oid = pDataContract.RatingOid;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.RTFNotice = pDataContract.RTFNotice;
|
||||
pEntity.DisplayName = pDataContract.DisplayName;
|
||||
pEntity.StartDate = pDataContract.StartDate;
|
||||
|
||||
MapperFactory.GoalRatingDC_GoalRating.MergeWithEntitys(pDataContract.GoalRatingList, pEntity.GoalRatingList);
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(RatingDC pDC, Rating pEntity)
|
||||
{
|
||||
if (pDC.RatingOid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.RatingOid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Service/DCEntityMapper/RatingTypeDC_RatingType.cs
Normal file
46
Service/DCEntityMapper/RatingTypeDC_RatingType.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class RatingTypeDC_RatingType : AbstractIDCEntityMapper<RatingType, RatingTypeDC>
|
||||
{
|
||||
public override RatingTypeDC MergeWithDC(RatingType pEntity, RatingTypeDC pDataContract)
|
||||
{
|
||||
pDataContract.RatingTypeOid = pEntity.Oid;
|
||||
pDataContract.RatingTypeVersion = pEntity.Version;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.DisplayName = pEntity.DisplayName;
|
||||
pDataContract.RatingId = pEntity.RatingId;
|
||||
pDataContract.Position = pEntity.Position;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override RatingType MergeWithEntity(RatingTypeDC pDataContract, RatingType pEntity)
|
||||
{
|
||||
ConcurrencyCheck(pDataContract.RatingTypeVersion, pEntity);
|
||||
|
||||
pEntity.Oid = pDataContract.RatingTypeOid;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.DisplayName = pDataContract.DisplayName;
|
||||
pEntity.RatingId = pDataContract.RatingId;
|
||||
pEntity.Position = pDataContract.Position;
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(RatingTypeDC pDC, RatingType pEntity)
|
||||
{
|
||||
if (pDC.RatingTypeOid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.RatingTypeOid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
foreach (var v2o in pEntity.ValueList.FindByTypes(list))
|
||||
{
|
||||
var entryDc = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(v2o.Entry);
|
||||
entryDc.Rating = v2o.Rating;
|
||||
entryDc.RatingTypeOid = v2o.RatingTypeOid;
|
||||
pDataContract.Goals.Add(entryDc);
|
||||
}
|
||||
//pDataContract.Goals = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDCs(pEntity.ValueList.FindByTypes(list).Select(e2o => e2o.Entry));
|
||||
@@ -208,7 +208,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
if (entryDc.ValueListEntryOid.HasValue && entryDc.ValueListEntryOid == v2o.Entry.Oid)
|
||||
{
|
||||
v2o.Rating = entryDc.Rating;
|
||||
v2o.RatingTypeOid = entryDc.RatingTypeOid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
pDataContract.ServiceAccountings = MapperFactory.ServiceAccountingDC_ServiceAccounting.MapToNewDCs(pEntity.ServiceAccountings);
|
||||
|
||||
pDataContract.Ratings = MapperFactory.RatingDC_Rating.MapToNewDCs(pEntity.Ratings);
|
||||
|
||||
IList<VarFieldDef> defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.SupportConcept);
|
||||
pDataContract.VarFields = MapperFactory.VarFieldDC_VarField.VarFieldMapToDCs(defs, pEntity.VarFieldValueList);
|
||||
|
||||
@@ -81,7 +83,9 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MergeWithEntitys(pDataContract.CostBearerRelations, pEntity.CostBearer2SupportConceptList);
|
||||
|
||||
var globalGoalCategories = new List<ValueListEntryDC>();
|
||||
MapperFactory.RatingDC_Rating.MergeWithEntitys(pDataContract.Ratings, pEntity.Ratings);
|
||||
|
||||
var globalGoalCategories = new List<ValueListEntryDC>();
|
||||
var globalGoals = new List<ValueListEntryDC>();
|
||||
var individualGoals = new List<ValueListEntryDC>();
|
||||
var individualGoalCategories = new List<ValueListEntryDC>();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using BeWo.Data.Access;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
@@ -16,6 +17,9 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.Leader = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Leader);
|
||||
pDataContract.Member = MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(pEntity.MemberList);
|
||||
|
||||
IList<VarFieldDef> defs = DAOFactory.SearchDAO.GetVarFieldDefs(TableID.Team);
|
||||
pDataContract.TeamVarFields = MapperFactory.VarFieldDC_VarField.VarFieldMapToDCs(defs, pEntity.VarFieldValueList);
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -34,6 +38,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
MapperFactory.CompactEmployeeDC_Employee.MergeWithEntitys(pDataContract.Member, pEntity.MemberList);
|
||||
|
||||
pEntity.VarFieldValueList = MapperFactory.VarFieldDC_VarField.VarFieldMergeToEntity(pEntity.VarFieldValueList, pDataContract.TeamVarFields, pEntity);
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
v2o.Entry = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewEntity(edc);
|
||||
}
|
||||
|
||||
v2o.Rating = edc.Rating;
|
||||
v2o.RatingTypeOid = edc.RatingTypeOid;
|
||||
return v2o;
|
||||
}));
|
||||
|
||||
|
||||
@@ -586,6 +586,12 @@ namespace BeWo.Service.Invoicing
|
||||
|
||||
public virtual IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList,
|
||||
DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc, bool summaryPerMonth)
|
||||
{
|
||||
return CreateSummaryInvoiceItems(itemList, invoicePeriod, scap, calc, summaryPerMonth, false);
|
||||
}
|
||||
|
||||
public virtual IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList,
|
||||
DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc, bool summaryPerMonth, bool addRateFactorToUnitCount)
|
||||
{
|
||||
//Fasse InvoiceItems mit gleichem Stundensatz zusammen:
|
||||
|
||||
@@ -655,42 +661,42 @@ namespace BeWo.Service.Invoicing
|
||||
}
|
||||
|
||||
|
||||
BerechneSummaryItemsSummen(newlist);
|
||||
BerechneSummaryItemsSummen(newlist, addRateFactorToUnitCount);
|
||||
return newlist;
|
||||
}
|
||||
|
||||
public virtual void BerechneSummaryItemsSummen(List<InvoiceItem> newlist)
|
||||
public virtual void BerechneSummaryItemsSummen(List<InvoiceItem> newlist, bool addRateFactorToUnitCount)
|
||||
{
|
||||
foreach (InvoiceItem invoiceItem in newlist)
|
||||
{
|
||||
if (invoiceItem.AmountPerUnit.HasValue)
|
||||
{
|
||||
invoiceItem.AmountPerUnit = Math.Round(invoiceItem.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
else
|
||||
if (!invoiceItem.AmountPerUnit.HasValue)
|
||||
{
|
||||
invoiceItem.AmountPerUnit = 0;
|
||||
}
|
||||
invoiceItem.AmountPerUnit = Math.Round(invoiceItem.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
if (invoiceItem.UnitCount.HasValue)
|
||||
{
|
||||
invoiceItem.UnitCount = Math.Round(invoiceItem.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
else
|
||||
if (!invoiceItem.UnitCount.HasValue)
|
||||
{
|
||||
invoiceItem.UnitCount = 0;
|
||||
}
|
||||
|
||||
if (addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
|
||||
{
|
||||
invoiceItem.UnitCount = (invoiceItem.UnitCount ?? 0) * ((invoiceItem.RateFactor + 100) / 100);
|
||||
}
|
||||
|
||||
invoiceItem.UnitCount = Math.Round(invoiceItem.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
|
||||
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount;
|
||||
invoiceItem.AmountTotal = Math.Round(invoiceItem.AmountTotal.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
if (invoiceItem.RateFactor.HasValue)
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
|
||||
|
||||
|
||||
if (!addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
|
||||
{
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal * ((invoiceItem.RateFactor + 100) / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
|
||||
invoiceItem.GrossAmountTotal *= ((invoiceItem.RateFactor + 100) / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,15 @@ namespace BeWo.Service.Invoicing
|
||||
//Prüfe 1:
|
||||
var relDC = c2s.MapToNewDC();
|
||||
|
||||
DateTime start = si.AccountingPeriodStart.Value.Date;
|
||||
|
||||
DateTime start = si.AccountingPeriodStart.Value.Date;
|
||||
DateTime end = si.AccountingPeriodEnd.Value.Date;
|
||||
if (end > DateTime.Now)
|
||||
if (c2s.SupportConcept.Customer.TerminationDate.HasValue &&
|
||||
c2s.SupportConcept.Customer.TerminationDate.Value < end)
|
||||
{
|
||||
end = c2s.SupportConcept.Customer.TerminationDate.Value;
|
||||
}
|
||||
if (end > DateTime.Now)
|
||||
{
|
||||
var srList = c2s.ServiceRecords;
|
||||
|
||||
@@ -391,6 +397,11 @@ namespace BeWo.Service.Invoicing
|
||||
{
|
||||
approved = (approved*tolerance)/100m;
|
||||
}
|
||||
|
||||
if (!CheckMaxApprovedHours())
|
||||
{
|
||||
approved = Decimal.MaxValue;
|
||||
}
|
||||
foreach (var iRecord in records)
|
||||
{
|
||||
if (iRecord.ServiceDescription.ServiceCategory.IsBillable && IsServiceRecordBillable(iRecord))
|
||||
@@ -536,6 +547,11 @@ namespace BeWo.Service.Invoicing
|
||||
|
||||
}
|
||||
|
||||
public virtual bool CheckMaxApprovedHours()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool IsServiceRecordBillable(ServiceRecord iRecord)
|
||||
{
|
||||
return true;
|
||||
@@ -546,7 +562,7 @@ namespace BeWo.Service.Invoicing
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void CreateInvoiceDetails(Settlement2DC si, CostBearer2SupportConcept c2s, DateTime? periodStart,
|
||||
public virtual void CreateInvoiceDetails(Settlement2DC si, CostBearer2SupportConcept c2s, DateTime? periodStart,
|
||||
DateTime? periodEnd)
|
||||
{
|
||||
var calc = PluginLoader.FindClass<Calculations>(_SpecificID) ?? Calculations.GetInstance(_SpecificID);
|
||||
@@ -591,7 +607,7 @@ namespace BeWo.Service.Invoicing
|
||||
}
|
||||
}
|
||||
si.InvoiceItems = CreateInvoiceItemsForAccountingPeriods(si, accountingPeriods, relDC.CostBearer.CostRatePeriods, calc);
|
||||
|
||||
|
||||
if (si.ApprovedFLS.HasValue)
|
||||
{
|
||||
CalculateInvoiceItemAmounts(si);
|
||||
|
||||
145
Service/OwnChat/OwnChatHelper.cs
Normal file
145
Service/OwnChat/OwnChatHelper.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BeWo.Service.Configuration;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.Plugins;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BeWo.Service.OwnChat
|
||||
{
|
||||
public class OwnChatHelper
|
||||
{
|
||||
public static void StartOwnChatSync()
|
||||
{
|
||||
//if (AppSettings.CreateSettings().ShowChat)
|
||||
//{
|
||||
var m = AppSettings.GetMandatorEntity();
|
||||
var tenant = PluginLoader.Tenant;
|
||||
|
||||
StartOwnChatSync(m.Apikey, tenant);
|
||||
//}
|
||||
}
|
||||
|
||||
private static void StartOwnChatSync(String apiKey, String tenant)
|
||||
{
|
||||
|
||||
if (!String.IsNullOrEmpty(apiKey))
|
||||
{
|
||||
try
|
||||
{
|
||||
var serverUrl = ErmittleServerURL(tenant);
|
||||
|
||||
if (!String.IsNullOrEmpty(serverUrl))
|
||||
{
|
||||
#if DEBUG
|
||||
var endurl = serverUrl + "/api/ownchat/sync/schedule/" + apiKey + "/5473568546";
|
||||
|
||||
#else
|
||||
var endurl = serverUrl + "/api/ownchat/sync/schedule/" + apiKey + "/" + tenant;
|
||||
#endif
|
||||
WebRequest request = WebRequest.Create(endurl);
|
||||
|
||||
request.Credentials = CredentialCache.DefaultCredentials;
|
||||
|
||||
var response = request.GetResponse();
|
||||
|
||||
response.Close();
|
||||
response.Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// MessageBox.Show("Die Verbindung konnte nicht aufgebaut werden.", "ownChat Fehler ", MessageBoxButton.OK);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ErmittleServerURL(string tenant)
|
||||
{
|
||||
//CB HACK solange App4 nicht geht:
|
||||
return GetUrlFromApp6(tenant);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
string url = "https://dict.ownchat.de/api/server/resolve/1/" + tenant;
|
||||
|
||||
WebRequest request = WebRequest.Create(url);
|
||||
|
||||
request.Credentials = CredentialCache.DefaultCredentials;
|
||||
|
||||
WebResponse response = request.GetResponse();
|
||||
|
||||
string responseFromServer = ReadStreamForChatCode(response);
|
||||
|
||||
var definition = new { status = "", URL = "", SYNCTYPE = "" };
|
||||
|
||||
var jsondaten = JsonConvert.DeserializeAnonymousType(responseFromServer, definition);
|
||||
|
||||
string serverUrl = jsondaten.URL;
|
||||
response.Close();
|
||||
|
||||
return serverUrl;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetUrlFromApp6(string tenant)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string url = "https://app6.bewoplaner.de/mobil/Chat/GetServerUrl?k=" + tenant;
|
||||
|
||||
WebRequest request = WebRequest.Create(url);
|
||||
|
||||
request.Credentials = CredentialCache.DefaultCredentials;
|
||||
|
||||
WebResponse response = request.GetResponse();
|
||||
|
||||
string responseFromServer = ReadStreamForChatCode(response);
|
||||
|
||||
|
||||
return responseFromServer;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static string ReadStreamForChatCode(WebResponse response)
|
||||
{
|
||||
try
|
||||
{
|
||||
Stream dataStream = response.GetResponseStream();
|
||||
|
||||
StreamReader reader = new StreamReader(dataStream);
|
||||
|
||||
string responseFromServer = reader.ReadToEnd();
|
||||
|
||||
dataStream.Dispose();
|
||||
reader.Dispose();
|
||||
|
||||
dataStream.Close();
|
||||
reader.Close();
|
||||
|
||||
return responseFromServer;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,5 +54,13 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
return new List<CompactTeamDC>();
|
||||
}
|
||||
|
||||
//Für Main Navigation View
|
||||
public virtual List<CompactEmployeeDC> GetAllCompactEmployees()
|
||||
{
|
||||
var employees = DAOFactory.GenericDAO.GetAll<Employee>();
|
||||
|
||||
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(employees);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,10 @@ namespace BeWo.Service.Plugins
|
||||
foreach (var sr in group.ServiceRecordList)
|
||||
{
|
||||
sr.RoundedDuration = durationForSingleRecord;
|
||||
sr.GroupRoundedDuration = durationForGroup;
|
||||
}
|
||||
|
||||
group.RoundedDuration = durationForGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -17,7 +18,9 @@ namespace BeWo.Service.Plugins
|
||||
{
|
||||
#if DEBUG
|
||||
var t = "demo";
|
||||
//t = "irgendwaswasesnichtgibt";
|
||||
|
||||
t = "irgendwaswasesnichtgibt";
|
||||
//t = "5473568546"; //Interner Chat
|
||||
//t = "2356097460"; // Lebenshilfe Würzburg
|
||||
//t = "1234567890"; // Präsentationsdatenbank
|
||||
//t = "5687373602"; // LH Duisburg
|
||||
@@ -36,7 +39,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "9098141768"; // Fib e.V. Marburg
|
||||
//t = "1505148718"; // VSD Hamm
|
||||
//t = "5926081834"; // Spektrum
|
||||
//t = "1378137009"; // BeWo Direkt
|
||||
//t = "1378137009"; // BeWo Direkt+
|
||||
//t = "3010479871"; // Aachener Verein
|
||||
//t = "3849764093"; // Club 74
|
||||
//t = "5805202339"; // Wegweiser Betreuungsdienst
|
||||
@@ -199,22 +202,22 @@ namespace BeWo.Service.Plugins
|
||||
//t = "8407321888"; // AWO Wesel
|
||||
//t = "8454426692"; // Mit-Menschen Wuppertal
|
||||
//t = "0629004412"; // BeWo-Colonia Basaran
|
||||
//t = "7668701607"; // Wohnstätten Essen
|
||||
//t = "3833058951"; // Aids Hilfe Duisburg (Self)
|
||||
//t = "9463879250"; // ABW Dziallas und Muhrin
|
||||
//t = "7964339639"; // Lebenshilfe Trier
|
||||
//t = "1477928721"; // ASB Regionalverband Rhein-Erft/Dueren e.V.
|
||||
//t = "6178990609"; // Johannes-Diakonie Mosbach
|
||||
//t = "7185105541"; // Nous GmbH
|
||||
//t = "5022131330"; // Tabula Rasa
|
||||
//t = "4189934785"; // Landshuter Netzwerke
|
||||
//t = "4290816992"; // BeWo Imflow
|
||||
//t = "7584236951"; // Aachener Betreuungsbüro Kirschbaum und Manz GbR
|
||||
//t = "3678599942"; // VKM Rietberg
|
||||
//t = "4069072369"; // BeWo Dreilich&Pastor (Pastor)
|
||||
//t = "7668701607"; // Wohnstätten Essen
|
||||
//t = "3833058951"; // Aids Hilfe Duisburg (Self)
|
||||
//t = "9463879250"; // ABW Dziallas und Muhrin
|
||||
//t = "7964339639"; // Lebenshilfe Trier
|
||||
//t = "1477928721"; // ASB Regionalverband Rhein-Erft/Dueren e.V.
|
||||
//t = "6178990609"; // Johannes-Diakonie Mosbach
|
||||
//t = "7185105541"; // Nous GmbH
|
||||
//t = "5022131330"; // Tabula Rasa
|
||||
//t = "4189934785"; // Landshuter Netzwerke
|
||||
//t = "4290816992"; // BeWo Imflow
|
||||
//t = "7584236951"; // Aachener Betreuungsbüro Kirschbaum und Manz GbR
|
||||
//t = "3678599942"; // VKM Rietberg
|
||||
//t = "4069072369"; // BeWo Dreilich&Pastor (Pastor)
|
||||
//t = "4160851689"; // BeWo Dreilich&Pastor (Dreilich)
|
||||
//t = "9970072066"; // Bussmannshof
|
||||
//t = "2993745954"; // Kollegium für freie Jugendarbeit und Berufsbildung e.V.
|
||||
//t = "9970072066"; // Bussmannshof
|
||||
//t = "2993745954"; // Kollegium für freie Jugendarbeit und Berufsbildung e.V.
|
||||
//t = "5495240031"; // Christian Luft
|
||||
//t = "6922762575"; // BHS Solingen
|
||||
//t = "3472573348"; // ASB Mönchengladbach
|
||||
@@ -223,6 +226,23 @@ namespace BeWo.Service.Plugins
|
||||
//t = "5207911843"; // Pro Balance
|
||||
//t = "8619663355"; // HSH Cologne
|
||||
//t = "1652658918"; // LH Frankfurt Oder
|
||||
//t = "7696927868"; // Kuhring Betreuung
|
||||
//t = "6251348980"; // BeWo Gün
|
||||
//t = "6782533512"; // LH Dorsten
|
||||
//t = "5890882255"; // Fortis Nova
|
||||
//t = "2422863972"; // Diakonisches Werk Mülheim (Therapeutische Wohngemeinschaft)
|
||||
//t = "2141858509"; // INKOMM GmbH
|
||||
//t = "8975059766"; // Quer-Fällt-Ein
|
||||
//t = "8928179244"; // ASB Ruhr e.V. Regionalverband
|
||||
//t = "4423043131"; // Die Perspektive e.V.
|
||||
//t = "5263375280"; // LH Wolfsburg
|
||||
//t = "4900722829"; // Evangelische Kirchengemeinde Bottrop
|
||||
//t = "9853685258"; // Input
|
||||
//t = "7622428090"; // Freie gemeinnützige Beratungsstelle für Psychotherapie e.V. (BfpDus) (Panama)
|
||||
//t = "0206140343"; // Lebenswelt Gabriel
|
||||
//t = "6916712798"; // LH Rodenkirchen Bewo
|
||||
//t = "6255521162"; // KCM GmbH
|
||||
//t = "2697528233"; // Diakonisches Werk Wesel
|
||||
|
||||
return t;
|
||||
#else
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace BeWo.Service.Plugins
|
||||
AddOrReplaceTranslation(dict, "CustomerVarFieldsTitle", "Weitere Eigenschaften");
|
||||
AddOrReplaceTranslation(dict, "EmployeeVarFieldsTitle", "Weitere Eigenschaften");
|
||||
AddOrReplaceTranslation(dict, "SupportConceptVarFieldsTitle", "Weitere Eigenschaften");
|
||||
AddOrReplaceTranslation(dict, "TeamVarFieldsTitle", "Weitere Eigenschaften");
|
||||
|
||||
AddOrReplaceTranslation(dict, "NotizenHeader", "Notizen");
|
||||
AddOrReplaceTranslation(dict, "CustomerNotizen", "Notizen");
|
||||
|
||||
@@ -12,6 +12,7 @@ using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
using DevExpress.XtraRichEdit.Commands;
|
||||
using Employee = BeWo.Data.Entities.Employee;
|
||||
|
||||
namespace BeWo.Service.SBD
|
||||
@@ -27,10 +28,13 @@ namespace BeWo.Service.SBD
|
||||
|
||||
public List<VertretungsItemDC> CreateSubstitutions(DateTime start, DateTime end)
|
||||
{
|
||||
Dictionary<String, bool> employeeIsAbsenceDict = new Dictionary<String, bool>();
|
||||
Dictionary<String, bool> customerIsAbsenceDict = new Dictionary<String, bool>();
|
||||
|
||||
var vertretungsItems = new List<VertretungsItemDC>();
|
||||
|
||||
end = end.Date.AddDays(1).AddTicks(-1);
|
||||
var vertretungen = DAOFactory.SearchDAO.FindVertretungen(start, end).ToList();
|
||||
var vertretungen = DAOFactory.SearchDAO.FindVertretungen(start, end).Where(v => v.VertretenderMitarbeiterOid.HasValue).ToList();
|
||||
var absenceTimes = DAOFactory.SearchDAO.FindAbsenceTimes(start, end).ToList();
|
||||
|
||||
var employeeAbsenceTimes = absenceTimes.Where(absenceTime => absenceTime.EmployeeOid.HasValue).ToList();
|
||||
@@ -89,6 +93,8 @@ namespace BeWo.Service.SBD
|
||||
{
|
||||
if (LiegtImZeitraum(dateTime, absenceTime))
|
||||
{
|
||||
AddToDict(employeeIsAbsenceDict, dateTime, employee.Oid.Value);
|
||||
|
||||
var dateTimeCopy = dateTime;
|
||||
var relevantAssistanceTimeEntries = assistanceTimeEntries.Where(entry => IsAbsenceTimeInAssistanceTime(dateTimeCopy, entry, absenceTime));
|
||||
|
||||
@@ -169,7 +175,7 @@ namespace BeWo.Service.SBD
|
||||
MigriereSubstitutionStatus(customer);
|
||||
|
||||
var assistingEmployees = new List<Employee>();
|
||||
customer.Arbeitszeiten.DoForEach(a => assistingEmployees.AddRangeIfElementsNotIn(a.ArbeitszeitEintraege.Select(s => s.Employee)));
|
||||
customer.Arbeitszeiten.DoForEach(a => assistingEmployees.AddRangeIfElementsNotIn(a.ArbeitszeitEintraege.Where(ae => ae.Employee != null).Select(s => s.Employee)));
|
||||
|
||||
schoolAssistanceTimes.DoForEach(a =>
|
||||
{
|
||||
@@ -220,6 +226,8 @@ namespace BeWo.Service.SBD
|
||||
{
|
||||
if (LiegtImZeitraum(dateTime, absenceTime))
|
||||
{
|
||||
AddToDict(customerIsAbsenceDict, dateTime, customer.Oid.Value);
|
||||
|
||||
var dateTimeCopy = dateTime;
|
||||
var relevantAssistanceTimeEntries = assistanceTimeEntries.Where(entry => IsAbsenceTimeInAssistanceTime(dateTime, entry, absenceTime) && (entry.Employee != null && entry.Employee.Equals(employee) || entry.Employee == null && employee.Equals(hauptbetreuer))).ToList();
|
||||
var vertretungsObjekte = vertretungen.Where(w => w.EmployeeOid.HasValue && w.EmployeeOid.Equals(employee.Oid) && w.CustomerOid.HasValue && w.CustomerOid.Equals(customer.Oid) && w.VertretungsZeitraumVon.Date <= dateTimeCopy && w.VertretungsZeitraumBis.Date >= dateTimeCopy).ToList();
|
||||
@@ -227,18 +235,7 @@ namespace BeWo.Service.SBD
|
||||
var lastSubstitutionDCs = MapperFactory.VertretungDC_Vertretung.MapToNewDCs(lastSubstitutions);
|
||||
var assistanceTimeEntryDCs = MapperFactory.ArbeitszeitEintragDC_ArbeitszeitEintrag.MapToNewDCs(relevantAssistanceTimeEntries);
|
||||
|
||||
// TODO: Hat die vertretungsItemListe Objekte mit dem Klienten im selben Zeitfenster?
|
||||
foreach (var employeeVertretungsItem in employeeVertretungsItems.Where(w => w.Customer.Equals(customerDC)))
|
||||
{
|
||||
if (employeeVertretungsItem.Datum == dateTime)
|
||||
{
|
||||
if (IsAbsenceTimeInAssistanceTime(dateTime, employeeVertretungsItem.AssistanceTime, absenceTime))
|
||||
{
|
||||
employeeVertretungsItemsGuids2Ignore.AddIfNotIn(employeeVertretungsItem.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (var assistanceTimeEntry in relevantAssistanceTimeEntries)
|
||||
{
|
||||
var assistanceTimeEntryDC = MapperFactory.ArbeitszeitEintragDC_ArbeitszeitEintrag.MapToNewDC(assistanceTimeEntry);
|
||||
@@ -283,8 +280,32 @@ namespace BeWo.Service.SBD
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Hat die vertretungsItemListe Objekte mit dem Klienten im selben Zeitfenster?
|
||||
foreach (var employeeVertretungsItem in employeeVertretungsItems.Where(w => w.Customer.Equals(customerDC)))
|
||||
{
|
||||
if (employeeVertretungsItem.Datum == dateTime)
|
||||
{
|
||||
if (IsAbsenceTimeInAssistanceTime(dateTime, employeeVertretungsItem.AssistanceTime, absenceTime))
|
||||
{
|
||||
employeeVertretungsItemsGuids2Ignore.AddIfNotIn(employeeVertretungsItem.Id);
|
||||
if (newVertretungsItem.VertretungsStatus == VertretungsStatus.KlientKrank)
|
||||
{
|
||||
newVertretungsItem.VertretungsStatus = VertretungsStatus.KlientUndMitarbeiterKrank;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVertretungsItem.VertretungsStatus =
|
||||
VertretungsStatus.MaKrankKeineVertretungBenoetigt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetSubstitutionColor(newVertretungsItem);
|
||||
|
||||
|
||||
|
||||
|
||||
SetSBDInformation(newVertretungsItem, customer, employee, false);
|
||||
|
||||
SetTeamleitung(employee, newVertretungsItem);
|
||||
@@ -339,6 +360,9 @@ namespace BeWo.Service.SBD
|
||||
}
|
||||
|
||||
vertretungsItems.AddRange(employeeVertretungsItems.Where(vertretungsItem => !employeeVertretungsItemsGuids2Ignore.Contains(vertretungsItem.Id)));
|
||||
|
||||
//prüfen, ob Mitarbeiter bereits als Vertretung eingesetzt ist:
|
||||
customerVertretungsItems = customerVertretungsItems.Where(c => !employeeVertretungsItems.Where(ei => ei.Vertreter != null).Select(ei2 => ei2.Vertreter.EmployeeOid).Contains(c.Employee.EmployeeOid)).ToList();
|
||||
vertretungsItems.AddRange(customerVertretungsItems);
|
||||
|
||||
SetSubstitutingEmployee2CustomersRelation(vertretungsItems);
|
||||
@@ -346,6 +370,15 @@ namespace BeWo.Service.SBD
|
||||
return vertretungsItems;
|
||||
}
|
||||
|
||||
private void AddToDict(Dictionary<string, bool> dict, DateTime dateTime, long oid)
|
||||
{
|
||||
String key = String.Format("{0:ddMMyyyy}_{1}", dateTime, oid);
|
||||
if (!dict.ContainsKey(key))
|
||||
{
|
||||
dict.Add(key, true);
|
||||
}
|
||||
}
|
||||
|
||||
public List<VertretungsItemDC> CreateVertretungsListe(DateTime start, DateTime end)
|
||||
{
|
||||
return CreateSubstitutions(start, end);
|
||||
@@ -434,6 +467,9 @@ namespace BeWo.Service.SBD
|
||||
case VertretungsStatus.MaKrankKeineVertretungBenoetigt:
|
||||
vertretungsItem.KlientStatusColor = "#7FFF7F"; // Grün
|
||||
break;
|
||||
case VertretungsStatus.KlientUndMitarbeiterKrank:
|
||||
vertretungsItem.KlientStatusColor = "#7FFF7F"; // Grün
|
||||
break;
|
||||
case VertretungsStatus.MaKrankVertretungVorhanden:
|
||||
vertretungsItem.KlientStatusColor = "#7FFF7F"; // Grün
|
||||
break;
|
||||
@@ -608,13 +644,18 @@ namespace BeWo.Service.SBD
|
||||
vertretungsItem.VertretungsStatus = VertretungsStatus.MaKrankVertretungBenoetigt;
|
||||
vertretungsItem.Dringlichkeit = "Dringend";
|
||||
vertretungsItem.DringlichkeitColor = "#FF0000"; // rot
|
||||
}
|
||||
|
||||
if (customer.SubstitutionNeed == SubstitutionNeed.SubstitutionWanted && customer.SubstitutionNeed != SubstitutionNeed.SubstitutionNeeded)
|
||||
}
|
||||
else if (customer.SubstitutionNeed == SubstitutionNeed.SubstitutionWanted)
|
||||
{
|
||||
vertretungsItem.Dringlichkeit = "Möglichst";
|
||||
vertretungsItem.DringlichkeitColor = "#F3D04F"; // Senfgelb
|
||||
}
|
||||
else if (customer.SubstitutionNeed == SubstitutionNeed.NoSubstitutionWanted)
|
||||
{
|
||||
vertretungsItem.VertretungsStatus = VertretungsStatus.MaKrankKeineVertretungBenoetigt;
|
||||
vertretungsItem.Dringlichkeit = "Kein Vertretungsbedarf";
|
||||
vertretungsItem.DringlichkeitColor = "#FFFFFF"; // weiß
|
||||
}
|
||||
|
||||
if (customer.AbWelchemKrankheitsTag > 1 && dateTime < absenceTimeStartDate.AddDays(customer.AbWelchemKrankheitsTag - 1))
|
||||
{
|
||||
@@ -623,7 +664,7 @@ namespace BeWo.Service.SBD
|
||||
vertretungsItem.DringlichkeitColor = "#FFFFFF"; // weiß
|
||||
}
|
||||
|
||||
if (customer.AbWelchemKrankheitsTag == 1 && customer.SubstitutionNeed != SubstitutionNeed.SubstitutionWanted && customer.SubstitutionNeed != SubstitutionNeed.SubstitutionNeeded)
|
||||
if (customer.AbWelchemKrankheitsTag <= 1 && customer.SubstitutionNeed != SubstitutionNeed.SubstitutionWanted && customer.SubstitutionNeed != SubstitutionNeed.SubstitutionNeeded)
|
||||
{
|
||||
vertretungsItem.VertretungsStatus = VertretungsStatus.MaKrankKeineVertretungBenoetigt;
|
||||
}
|
||||
@@ -690,7 +731,7 @@ namespace BeWo.Service.SBD
|
||||
|
||||
var absenceTimeEnd = absenceTime.End;
|
||||
|
||||
if (absenceTimeEnd.HasValue && absenceTime.Start.Value.Equals(absenceTimeEnd.Value))
|
||||
if (absenceTimeEnd.HasValue && absenceTimeEnd.Value.Hour == 0 && absenceTimeEnd.Value.Minute == 0)
|
||||
{
|
||||
absenceTimeEnd = absenceTimeEnd.Value.AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
@@ -709,9 +750,13 @@ namespace BeWo.Service.SBD
|
||||
|
||||
var absenceTimeEnd = absenceTime.End;
|
||||
|
||||
if (absenceTimeEnd.HasValue && absenceTime.Start.Value.Equals(absenceTimeEnd.Value))
|
||||
//if (absenceTimeEnd.HasValue && absenceTime.Start.Value.Equals(absenceTimeEnd.Value))
|
||||
//{
|
||||
// absenceTimeEnd = absenceTimeEnd.Value.AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
//}
|
||||
if (absenceTimeEnd.HasValue && absenceTimeEnd.Value.Hour == 0 && absenceTimeEnd.Value.Minute == 0 && absenceTimeEnd.Value.Second == 0)
|
||||
{
|
||||
absenceTimeEnd = absenceTimeEnd.Value.AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
absenceTimeEnd = absenceTimeEnd.Value.Date.AddHours(23).AddMinutes(59).AddSeconds(59);
|
||||
}
|
||||
|
||||
return assistanceTimeDates.Start.IsIntervalOverlappingWithAbsenceTimeInterval(assistanceTimeDates.End, absenceTime.Start.Value, absenceTimeEnd);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Security;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
@@ -28,6 +29,8 @@ namespace BeWo.Service.Security
|
||||
{
|
||||
try
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var lTemp = pMessage.Headers.Action.Split("/");
|
||||
string lServiceName = lTemp[lTemp.Count - 1];
|
||||
string lServiceInterface = lTemp[lTemp.Count - 2];
|
||||
|
||||
@@ -147,8 +147,57 @@ namespace BeWo.Service.Security
|
||||
var info = new LicenseInfoDC();
|
||||
|
||||
#if DEBUG
|
||||
try
|
||||
{
|
||||
string url = ConfigurationManager.AppSettings.Get("LicenseInfoUrl");
|
||||
|
||||
info.MaxLicenseCount = 9999;
|
||||
//url = url.Replace("[TENANT]", MultitenancyOperationContextExt.Current.Tenant);
|
||||
|
||||
var test = MultitenancyOperationContextExt.Current.Tenant;
|
||||
|
||||
url = url.Replace("[TENANT]", "1234567890");
|
||||
url += "&t=1";
|
||||
//url = url.Replace("[TENANT]", "1441747891");
|
||||
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
//MessageBox.Show(hostAddress);
|
||||
byte[] response = client.DownloadData(url);
|
||||
|
||||
String result = System.Text.Encoding.ASCII.GetString(response);
|
||||
//if (MultitenancyOperationContextExt.Current.Tenant == "demo")
|
||||
//{
|
||||
// result = "7;30";
|
||||
//}
|
||||
String[] resultArray = result.Split(';');
|
||||
|
||||
int maxLicenses = 0;
|
||||
decimal percentFreeEmployees = 0;
|
||||
if (resultArray.Length > 0)
|
||||
{
|
||||
Int32.TryParse(resultArray[0], out maxLicenses);
|
||||
if (resultArray.Length > 1)
|
||||
{
|
||||
Decimal.TryParse(resultArray[1], out percentFreeEmployees);
|
||||
}
|
||||
}
|
||||
info.MaxLicenseCount = maxLicenses;
|
||||
info.PercentFreeEmployee = percentFreeEmployees;
|
||||
|
||||
info.LicenseInUseCount = DAOFactory.GenericDAO.GetAllActive<ApplicationUser>().Count;
|
||||
info.EmployeeCount = DAOFactory.GenericDAO.GetAllActive<Employee>().Count;
|
||||
|
||||
info.MaxEmployeeCount = (int)Math.Ceiling(maxLicenses * ((100 + percentFreeEmployees) / 100));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//
|
||||
}
|
||||
return info;
|
||||
|
||||
|
||||
info.MaxLicenseCount = 9999;
|
||||
info.PercentFreeEmployee = 100;
|
||||
|
||||
info.LicenseInUseCount = DAOFactory.GenericDAO.GetAllActive<ApplicationUser>().Count;
|
||||
|
||||
@@ -74,6 +74,9 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BeWo.Data">
|
||||
<HintPath>..\Data\obj\Debug\BeWo.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core">
|
||||
<HintPath>..\Lib\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -166,6 +169,9 @@
|
||||
<Compile Include="Core\ServiceLogic.cs" />
|
||||
<Compile Include="Core\SettingsLogic.cs" />
|
||||
<Compile Include="Core\Utils.cs" />
|
||||
<Compile Include="DCEntityMapper\DienstDC_Dienst.cs" />
|
||||
<Compile Include="DCEntityMapper\RatingTypeDC_RatingType.cs" />
|
||||
<Compile Include="DCEntityMapper\GoalRatingDC_GoalRating.cs" />
|
||||
<Compile Include="DCEntityMapper\ReportTemplateDC_ReportTemplate.cs" />
|
||||
<Compile Include="DCEntityMapper\HomeViewPanelDC_HomeViewPanel.cs" />
|
||||
<Compile Include="DCEntityMapper\FlexibleReportLayoutDC_FlexibleReportLayout.cs" />
|
||||
@@ -243,6 +249,7 @@
|
||||
<Compile Include="DCEntityMapper\ChatBewoMessageSyncDC_ChatBewoMessageSync.cs" />
|
||||
<Compile Include="DCEntityMapper\BudgetDC_Budget.cs" />
|
||||
<Compile Include="DCEntityMapper\QuittierungsCheckDC_QuittierungsCheck.cs" />
|
||||
<Compile Include="DCEntityMapper\RatingDC_Rating.cs" />
|
||||
<Compile Include="DCEntityMapper\TextbausteinDC_Textbaustein.cs" />
|
||||
<Compile Include="DCEntityMapper\TokenDC_Token.cs" />
|
||||
<Compile Include="DCEntityMapper\VertretungsListeDC_VertretungsListe.cs" />
|
||||
@@ -327,6 +334,7 @@
|
||||
<Compile Include="Multitenancy\MultitenancyBehaviorExtension.cs" />
|
||||
<Compile Include="Multitenancy\MultitenancyContextInitializer.cs" />
|
||||
<Compile Include="Multitenancy\MultitenancyEndpointBehavior.cs" />
|
||||
<Compile Include="OwnChat\OwnChatHelper.cs" />
|
||||
<Compile Include="Plugins\AccountingService.cs" />
|
||||
<Compile Include="Plugins\CustomerService.cs" />
|
||||
<Compile Include="Plugins\UserService.cs" />
|
||||
@@ -394,10 +402,6 @@
|
||||
<Compile Include="UnitOfWork\HibernateSessionContextInitializer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Data\Data.csproj">
|
||||
<Project>{b0d73e3d-4ae7-4024-93a6-db1f46d7ccee}</Project>
|
||||
<Name>Data</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Shared\Shared.csproj">
|
||||
<Project>{2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}</Project>
|
||||
<Name>Shared</Name>
|
||||
|
||||
@@ -871,5 +871,41 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<SupportConceptCostBearerRelDC> GetSupportConceptCostBearerRelDCsByOids(List<long> supportConcept2CostbearerOids);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<DienstDC> GetAllDienste();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void InsertNewDienst(List<DienstDC> dienst);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void DeactivateDienst(Dictionary<long, long> pOid2Version);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void UpdateDienst(List<DienstDC> dienste);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<RatingTypeDC> GetAllRatingTypes();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void InsertNewRatingType(List<RatingTypeDC> ratingTypes);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void DeactivateRatingType(Dictionary<long, long> pOid2Version);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void UpdateRatingType(List<RatingTypeDC> ratingTypes);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<GoalRatingDC> FetchServiceRecordRatings(long? supportConceptOid, long? costBearer2SupportConceptOid, long? supportConceptApprovalPeriodOid, long? serviceCategoryOid, DateTime? start, DateTime? end);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.OwnChat;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BS.Shared;
|
||||
@@ -934,6 +935,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
object[] Lists = GetFromNHibernateDecoupledCustomerRelatedLists(lOriginal);
|
||||
MakeCustomerHistoryEntry(lOriginal, lOriginal.Oid.Value, StatementType.Insert, Lists[0] as List<Customer2Person>, Lists[1] as List<Customer2Organisation>, Lists[2] as List<Employee2Customer>);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
return oid;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1178,7 +1180,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
CheckUpdatedReferenceNumbers(pCustomerDC, lOriginal);
|
||||
|
||||
return lOriginal.Oid.Value;
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
|
||||
return lOriginal.Oid.Value;
|
||||
}
|
||||
catch (StaleObjectStateException)
|
||||
{
|
||||
@@ -2326,6 +2330,13 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var result = new List<SupportConceptDC>();
|
||||
var supportConcepts = DAOFactory.SearchDAO.GetAllActiveSupportConceptsByCustomers(pCustomerOids.ToList());
|
||||
|
||||
foreach (var sc in supportConcepts)
|
||||
{
|
||||
if (sc.Customer.Person.LastName == "Janzen")
|
||||
{
|
||||
int test = 0;
|
||||
}
|
||||
}
|
||||
result.AddRange(MapperFactory.SupportConceptDC_SupportConcept.MapToNewDCs(supportConcepts));
|
||||
|
||||
return result;
|
||||
|
||||
@@ -7,6 +7,7 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.OwnChat;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.Service.SBD;
|
||||
using BeWo.Service.Security;
|
||||
@@ -683,9 +684,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
MakeNewEmployeeHistoryEntry(temp, StatementType.Insert);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
|
||||
|
||||
return id;
|
||||
return id;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -713,6 +714,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
Team lTeam = MapperFactory.TeamDC_Team.MapToNewEntity(pTeam);
|
||||
DAOFactory.GenericDAO.Insert(lTeam);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
|
||||
return lTeam.Oid.Value;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -859,6 +863,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
MakeNewEmployeeHistoryEntry(lOriginal, StatementType.Update);
|
||||
|
||||
DAOFactory.GenericDAO.Update(lOriginal);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
return lOriginal.Oid.Value;
|
||||
}
|
||||
catch (StaleObjectStateException)
|
||||
@@ -892,6 +898,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
Team lOriginal = DAOFactory.GenericDAO.LoadByID<Team>(pTeam.TeamOid.Value);
|
||||
MapperFactory.TeamDC_Team.MergeWithEntity(pTeam, lOriginal);
|
||||
DAOFactory.GenericDAO.Update(lOriginal);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
|
||||
return lOriginal.Oid.Value;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1381,7 +1390,38 @@ namespace BeWo.Service.ServiceImplementations
|
||||
vertretungsItem.Employee != null).Select(item => item.Employee.EmployeeOid);
|
||||
|
||||
employeeOids = employeeOids.Where(e => !abwesenendeEmployeeOids.Contains(e));
|
||||
return MapperFactory.CompactVertreterEmployeeDC_VertreterEmployee.MapToNewDCs(DAOFactory.GenericDAO.GetActiveByIDs<Employee>(employeeOids));
|
||||
var list = MapperFactory.CompactVertreterEmployeeDC_VertreterEmployee.MapToNewDCs(DAOFactory.GenericDAO.GetActiveByIDs<Employee>(employeeOids));
|
||||
|
||||
//Setze Betreuungszeiten
|
||||
foreach (var vertreter in list)
|
||||
{
|
||||
foreach (var item in vertretungsListe)
|
||||
{
|
||||
if (item.Employee.EmployeeOid == vertreter.EmployeeOid)
|
||||
{
|
||||
//if (vertreter.Arbeitszeit == null)
|
||||
//{
|
||||
// vertreter.Arbeitszeit = new List<ArbeitszeitDC>();
|
||||
//}
|
||||
|
||||
//if (vertreter.Arbeitszeit.Count == 0)
|
||||
//{
|
||||
// vertreter.Arbeitszeit.Add(new ArbeitszeitDC
|
||||
// {
|
||||
// Eintraege = new List<ArbeitszeitEintragDC>()
|
||||
// });
|
||||
//}
|
||||
//vertreter.Arbeitszeit[0].Eintraege.AddRange(item.Arbeitszeiten);
|
||||
vertreter.Arbeitszeit = new List<ArbeitszeitDC>();
|
||||
vertreter.Arbeitszeit.Add(
|
||||
new ArbeitszeitDC
|
||||
{
|
||||
Eintraege = item.Arbeitszeiten.ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1499,9 +1539,10 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
var employees = DAOFactory.GenericDAO.GetAll<Employee>();
|
||||
var s = PluginLoader.FindClass<EmployeeService>();
|
||||
|
||||
return s.GetAllCompactEmployees();
|
||||
|
||||
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(employees);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@ using BS.Shared.Extensions;
|
||||
|
||||
using MySql.Data.MySqlClient;
|
||||
using BeWo.Service.Configuration;
|
||||
using BeWo.Service.OwnChat;
|
||||
using BeWo.Service.Plugins;
|
||||
|
||||
namespace BeWo.Service.ServiceImplementations
|
||||
@@ -68,6 +69,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
DAOFactory.GenericDAO.Insert(passwortvelauf);
|
||||
|
||||
DAOFactory.GenericDAO.Update(lOriginal);
|
||||
|
||||
OwnChatHelper.StartOwnChatSync();
|
||||
|
||||
return lOriginal.Version.Value;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -752,13 +756,33 @@ namespace BeWo.Service.ServiceImplementations
|
||||
return "Das Passwort muss mindestens 8 Zeichen lang sein!";
|
||||
}
|
||||
|
||||
//if (!(pNewPassword.Any(x => sonderzeichen.Contains(x)) && pNewPassword.Any(x => zahlen.Contains(x)) && pNewPassword.Any(x => grossBuchstaben.Contains(x)) && pNewPassword.Any(x => kleinBuchstaben.Contains(x))))
|
||||
if (!(pNewPassword.Any(x => zahlen.Contains(x)) && pNewPassword.Any(x => grossBuchstaben.Contains(x)) && pNewPassword.Any(x => kleinBuchstaben.Contains(x))))
|
||||
int richtlinienCount = 0;
|
||||
|
||||
if (pNewPassword.Any(x => zahlen.Contains(x)))
|
||||
{
|
||||
return "Das Passwort sollte Sonderzeichen, Zahlen, Groß- und Kleinbuchstaben enthalten.";
|
||||
richtlinienCount++;
|
||||
}
|
||||
if (pNewPassword.Any(x => grossBuchstaben.Contains(x)))
|
||||
{
|
||||
richtlinienCount++;
|
||||
}
|
||||
if (pNewPassword.Any(x => kleinBuchstaben.Contains(x)))
|
||||
{
|
||||
richtlinienCount++;
|
||||
}
|
||||
if (pNewPassword.Any(x => sonderzeichen.Contains(x)))
|
||||
{
|
||||
richtlinienCount++;
|
||||
}
|
||||
|
||||
if (pNewPassword.Equals("bewo")) {
|
||||
//if (!(pNewPassword.Any(x => sonderzeichen.Contains(x)) && pNewPassword.Any(x => zahlen.Contains(x)) && pNewPassword.Any(x => grossBuchstaben.Contains(x)) && pNewPassword.Any(x => kleinBuchstaben.Contains(x))))
|
||||
if (richtlinienCount < 3)
|
||||
{
|
||||
return "Das Passwort muss mindestens drei Zeichen aus der Gruppe Sonderzeichen, Zahlen, Groß- und Kleinbuchstaben enthalten.";
|
||||
}
|
||||
|
||||
if (pNewPassword.Equals("bewo"))
|
||||
{
|
||||
return "Das Passwort darf nicht bewo heißen";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user