Prüfen von Rechte Version

This commit is contained in:
Christian
2023-11-08 00:34:17 +01:00
parent 2548012b55
commit 5206ae0cf1
22 changed files with 1789 additions and 264 deletions

View File

@@ -4581,6 +4581,22 @@ namespace BeWo.Data.Access
return q.List<long>();
}
public IList FindCustomerOid2Persons(IList<long> personOids)
{
String oidList = "";
foreach (var oid in personOids)
{
if (oidList.Length > 0)
{
oidList += ",";
}
oidList += String.Format("{0}", oid);
}
return GetSqlResult("SELECT oid,personoid,customeroid,istfamilie FROM customer2person where personoid in (" + oidList + ")");
}
public List<SchedulerAppointment> FindActiveAppointmentsForCustomers(List<long> customerOids, DateTime startDate, DateTime endDate)
{
var customerOidSqlString = string.Empty;

View File

@@ -1,5 +1,7 @@
using BeWo.Data.Entities;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -52,5 +54,98 @@ namespace BeWo.Data.Security
return rights;
}
public static String GetBeWoVersion()
{
return GetBeWoVersion(GetLoggedInUser().LoginName);
}
public static String GetBeWoVersion(String loginName)
{
var lastLogins = DAOFactory.SearchDAO.FindLastLogins(loginName, 1).ToList();
if (lastLogins != null && lastLogins.Count > 0)
{
var login = lastLogins[0];
if (!String.IsNullOrEmpty(login.Referrer))
{
//var test = "MobilClient, Version: Unbekannt";
//var test2 = "BeWoClient, Version: Microsoft Windows NT 6.2.9200.0;CLRVersion=4.0.30319.42000;BeWoVersion=Version 3.16;IsNet45OrNewer=True";
var str = login.Referrer;
var start = str.IndexOf("BeWoVersion=");
if (start > 0)
{
var stop = str.IndexOf(";", start);
if (stop > start)
{
var version = str.Substring(start + 12, stop - start - 12);
version = version.Replace("Version", "").Trim();
return version;
}
}
}
}
return "";
}
public static void CheckRightVersion(UserDC user)
{
var version = GetBeWoVersion(GetLoggedInUser().LoginName);
CheckRightVersion(version, user);
}
public static void CheckRightVersion(UserGroupDC groupDC)
{
var version = GetBeWoVersion(GetLoggedInUser().LoginName);
CheckRightVersion(version, groupDC);
}
public static void CheckRightVersion(String version, UserDC userDC)
{
foreach (var ug in userDC.UserGroups)
{
CheckRightVersion(version, ug);
}
}
public static void CheckRightVersion(String version, UserGroupDC ug)
{
var allrights = ug.Rights;
ug.Rights = new List<UserRightType>();
foreach (var r in allrights)
{
if (IsCorrectVersion(r, version))
{
ug.Rights.Add(r);
}
}
}
public static bool IsCorrectVersion(UserRightType r, string version)
{
var rightVersion = GetRightVersion(r);
if (version.CompareTo(rightVersion) < 0)
{
return false;
}
return true;
}
public static String GetRightVersion(UserRightType r)
{
if (r == UserRightType.Customer_ViewBetreuung || r == UserRightType.Customer_ViewAbsenceTimes)
{
return "3.17";
}
return "1.0";
}
}
}

View File

@@ -970,3 +970,9 @@ ALTER TABLE `AbsenceReason` ADD COLUMN `Sichtbarkeit` int NULL;
ALTER TABLE `feiertag`
ADD COLUMN `OrganisationOid` BIGINT NULL DEFAULT NULL;
ALTER TABLE servicerecordhistory ADD COLUMN `CustomerConfirmationReceiptSignatureStateType` int DEFAULT 0;
ALTER TABLE servicerecordhistory ADD COLUMN `EmployeeConfirmationReceiptSignatureStateType` int DEFAULT 0;
ALTER TABLE servicerecordhistory ADD COLUMN `ServiceRecordSignatureStateType` int DEFAULT 0;
ALTER TABLE servicerecordhistory ADD COLUMN `CustomerConfirmationReceiptSignatureOid` BIGINT(18) DEFAULT NULL, ADD COLUMN `EmployeeConfirmationReceiptSignatureOid` BIGINT(18) DEFAULT NULL;

View File

@@ -1206,7 +1206,8 @@ namespace BeWo.Report
public override XtraReport CreateInvoiceListReport(List<long> oids)
{
XtraReport master = null;
XtraReport master = new XtraReport();
master.CreateDocument();
var ibList = DAOFactory.GenericDAO.LoadByIDs<InvoiceBase>(oids);
@@ -1231,14 +1232,24 @@ namespace BeWo.Report
{
report.CreateDocument();
}
if (master == null)
var wm = report.Watermark;
bool firstpage = true;
foreach (var item in report.Pages)
{
master = report;
}
else
{
master.Pages.AddRange(report.Pages);
var page2add = item as DevExpress.XtraPrinting.Page;
if (page2add != null)
{
master.Pages.Add(page2add);
if (wm != null && firstpage)
{
var newpage = master.Pages[master.Pages.Count - 1];
newpage.AssignWatermark(wm);
}
}
firstpage = false;
}
//master.Pages.AddRange(report.Pages);
}
}

View File

@@ -63,6 +63,12 @@
<ItemGroup>
<Compile Include="CustomReportCreator.cs" />
<Compile Include="CustomSettlementInvoiceCreation.cs" />
<Compile Include="Finanzauswertung.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Finanzauswertung.designer.cs">
<DependentUpon>Finanzauswertung.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Quittierungsbeleg.cs">
<SubType>Component</SubType>
@@ -110,6 +116,10 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Finanzauswertung.resx">
<DependentUpon>Finanzauswertung.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Quittierungsbeleg.resx">
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>

View File

@@ -13,28 +13,28 @@ namespace BeWo.AidshilfeDortmund
{
public override List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
{
var items = base.CreateInvoiceItems(si, apList, true);
//public override List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
//{
// var items = base.CreateInvoiceItems(si, apList, true);
decimal hours = 0;
foreach (var ap in apList)
{
hours += ap.RecordedMinutes;
}
if (si.RateFactor.HasValue)
{
hours *= (100 + si.RateFactor.Value) / 100;
}
hours /= 60;
// decimal hours = 0;
// foreach (var ap in apList)
// {
// hours += ap.RecordedMinutes;
// }
// if (si.RateFactor.HasValue)
// {
// hours *= (100 + si.RateFactor.Value) / 100;
// }
// hours /= 60;
si.RecordedBillableFLSNetto = hours;
si.RecordedBillableFLSBrutto = si.RecordedBillableFLSNetto;
// si.RecordedBillableFLSNetto = hours;
// si.RecordedBillableFLSBrutto = si.RecordedBillableFLSNetto;
return items;
}
// return items;
//}
//public override List<InvoiceItemDC> CreateInvoiceItems(Settlement2DC si, IList<ApprovalPeriod> apList, bool schneideBeiMaxAb)
//{
// List<InvoiceItemDC> iiList = new List<InvoiceItemDC>();

View File

@@ -0,0 +1,79 @@
using System;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace AidshilfeDortmund
{
public partial class Finanzauswertung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<FinanceRO>
{
public Finanzauswertung()
{
InitializeComponent();
}
public void SetReportDataSource(FinanceRO pRO)
{
pRO.CalculateBillableAmountInReportTimeSpan();
pRO.CalculatePaidAmountInReportTimeSpan();
if (pRO.ReportStartDate.HasValue && pRO.ReportEndDate.HasValue)
{
DateTime start = pRO.ReportStartDate.Value;
DateTime end = pRO.ReportEndDate.Value;
if (start.Year == end.Year && start.Month == end.Month && start.Day == 1 &&
end.Day == DateTime.DaysInMonth(end.Year, end.Month))
{
lblTitel.Text = String.Format("Finanzauswertung {0:MMMM yyyy}", start);
cellBewilligtImZeitraumHeader.Text = String.Format("bewilligte FLS {0:MMMM}", start);
cellGeleistetImZeitraumHeader.Text = String.Format("geleistete Std. {0:MMMM}", start);
cellFehlkontakteHeader.Text = String.Format("Fehl-\nkontakte {0:MMMM}", start);
}
else
{
lblTitel.Text = String.Format("Finanzauswertung {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
cellBewilligtImZeitraumHeader.Text = String.Format("bewilligte FLS {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
cellGeleistetImZeitraumHeader.Text = String.Format("geleistete Std. {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
//cellFehlkontakteHeader.Text = String.Format("Fehl-\nkontakte {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
}
if (pRO.RateFactor.HasValue)
{
cellRateFactorHeader.Text = String.Format("geleistete Std. x {0:0.##}", pRO.RateFactor);
}
else
{
//cellRateFactorHeader.Visible = false;
//cellRateFactor.Visible = false;
}
}
else
{
cellBewilligtImZeitraumHeader.Visible = false;
cellBewilligteFLSImBereich.Visible = false;
cellGeleistetImBereich.Visible = false;
cellGeleistetImZeitraumHeader.Visible = false;
cellRateFactorHeader.Visible = false;
cellRateFactor.Visible = false;
}
if (pRO.GruppierungLeistungskategorie && pRO.SupportConceptFinanceList != null)
{
GroupHeader1.Visible = true;
GroupFooter1.Visible = true;
foreach (var scRo in pRO.SupportConceptFinanceList)
{
if (String.IsNullOrEmpty(scRo.Leistungskategorie))
{
scRo.GruppierungsKategorie = " ";
}
else
{
scRo.GruppierungsKategorie = String.Format("Leistungskategorie {0}", scRo.Leistungskategorie);
}
}
}
this.bindingSource1.DataSource = pRO;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -87,7 +87,16 @@ namespace AkggMid
return false;
if (item.AbsenceReason.Description.ToLower().Contains("ma_vkt"))
return false;
if (item.AbsenceReason.Description.ToLower().Contains("ma_bkl"))
return false;
if (item.AbsenceReason.Description.ToLower().Contains("ma_päd.tag"))
return false;
if (item.AbsenceReason.Description.ToLower().Contains("ma_uf"))
return false;
return base.IstAnrechenbareAbsenceTime(item);
}

View File

@@ -79,10 +79,6 @@
<Compile Include="Validation\ServiceRecordValidator.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BeWo\BeWo.csproj">
<Project>{3FEBB560-9275-413A-9767-BB68C44EEBC3}</Project>
<Name>BeWo</Name>
</ProjectReference>
<ProjectReference Include="..\..\Data\Data.csproj">
<Project>{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}</Project>
<Name>Data</Name>

View File

@@ -5,14 +5,12 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Threading;
using BeWo.Core.Service;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;

View File

@@ -5,14 +5,12 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Threading;
using BeWo.Core.Service;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;

View File

@@ -146,22 +146,25 @@ namespace LebenshilfeBadKreuznach.Statistics
}
SupportConceptPeriodStatisticsDC periodStats = GetPeriodFromServiceRecord(cb2sc, stats.PeriodStatistics, sr);
decimal minutesProvidedWeekNew = 0;
decimal minutesProvidedWeekOld = 0;
decimal minutesProvidedQuartalNew = 0;
decimal minutesProvidedQuartalOld = 0;
if (periodStats != null)
{
//Verhindern dass das ServiceRecord durch den base Aufruf doppelt gezählt wird
minutesProvidedQuartalOld = periodStats.MinutesProvidedThisMonth;
minutesProvidedWeekOld = periodStats.MinutesProvidedThisWeek;
}
base.ProcessServiceRecord(sr, cb2sc, stats, statisticsDate, calc);
bool billable = false;
if (sr.ServiceDescription != null && sr.ServiceDescription.ServiceCategory != null)
{
billable = sr.ServiceDescription.ServiceCategory.IsBillable;
}
//bool billable = false;
//if (sr.ServiceDescription != null && sr.ServiceDescription.ServiceCategory != null)
//{
// billable = sr.ServiceDescription.ServiceCategory.IsBillable;
//}
@@ -178,10 +181,15 @@ namespace LebenshilfeBadKreuznach.Statistics
{
minutesProvidedQuartalNew = minutes;
}
periodStats.MinutesProvidedThisMonth = minutesProvidedQuartalOld + minutesProvidedQuartalNew;
DateTime mondayDt = statisticsDate.GetLast(DayOfWeek.Monday).Date;
if (sr.Start >= mondayDt && sr.Start < mondayDt.AddDays(7))
{
minutesProvidedWeekNew = minutes;
}
periodStats.MinutesProvidedThisMonth = minutesProvidedQuartalOld + minutesProvidedQuartalNew;
periodStats.MinutesProvidedThisWeek = minutesProvidedWeekOld + minutesProvidedWeekNew;
}
}

View File

@@ -15,7 +15,15 @@ namespace LebenshilfeBadKreuznach.Validation
int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
{
var list = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
var newResult = new List<ServiceRecordValidationResultDC>();
foreach (var item in list)
{
if (item.ResultType != ServiceRecordValidationResult.ApprovedFLSOverspending && (String.IsNullOrEmpty(item.Message) || !item.Message.Contains("liegt außerhalb des Hilfeplanzeitraums")))
{
newResult.Add(item);
}
}
if (statistics != null && statistics.PeriodStatistics != null)
{
foreach (var stat in statistics.PeriodStatistics)
@@ -43,14 +51,14 @@ namespace LebenshilfeBadKreuznach.Validation
Allow = false
};
list.Add(dc);
newResult.Add(dc);
}
}
}
}
}
return list;
return newResult;
}
}
}

View File

@@ -153,7 +153,12 @@ namespace SHKService.Service
item.Employee = new CompactEmployeeDC();
item.Employee.LastName = "Ohne Betreuung";
}
item.CustomerToolTip = null;
item.EmployeeToolTip = null;
item.VertreterToolTip = null;
}
return vertretungsListe;
}
@@ -303,6 +308,30 @@ namespace SHKService.Service
if (vertretungsItem.MailCustomer != null)
{
//vertretungsItem.MailCustomer.Message = @"Lieber Klient,%0D%0A%0D%0Ablablubb%0D%0AZeile2%0D%0A%0D%0ANochne Zeile%0D%0A%0D%0ATschüss";
if (vertretung != null)
{
String vertreterName = vertretung.Person.LastName;
if (vertretung.Person.Sex.HasValue && vertretung.Person.Sex.Value == Sex.Male)
{
vertreterName = "Herr " + vertreterName;
}
else
{
vertreterName = "Frau " + vertreterName;
}
vertretungsItem.MailCustomer.Message = String.Format(@"
Sehr geehrte Damen und Herren,
die Schulbegleitung für {0} wird vom {1:dd.MM.yyyy} bis voraussichtlich {2:dd.MM.yyyy} {3} übernehmen.
Eventuelle Änderungen oder Vertretungen nach dem Datum Ende teilen wir Ihnen so früh wie möglich mit. Es gilt die jeweils letzte Mail.
Bei Rückfragen erreichen Sie uns an jedem Unterrichtstag von 6:30 Uhr bis 10:00 Uhr unter 015116889795", customer != null ? customer.Person.FirstName : "", vertretungsItem.Absencetime != null ? vertretungsItem.Absencetime.Start : null, vertretungsItem.Absencetime != null ? vertretungsItem.Absencetime.End : null, vertreterName);
vertretungsItem.MailCustomer.Message = vertretungsItem.MailCustomer.Message.Replace("\n", "%0D%0A");
}
}
if (vertretungsItem.MailEmployee != null)
@@ -317,7 +346,38 @@ namespace SHKService.Service
if (vertretungsItem.MailSchule != null)
{
//vertretungsItem.MailSchule.Message = @"Liebe Schule,%0D%0A%0D%0Ablablubb%0D%0AZeile2%0D%0A%0D%0ANochne Zeile%0D%0A%0D%0ATschüss";
if (vertretung != null)
{
String vertreterName = vertretung.Person.LastName;
if (vertretung.Person.Sex.HasValue && vertretung.Person.Sex.Value == Sex.Male)
{
vertreterName = "Herr " + vertreterName;
}
else
{
vertreterName = "Frau " + vertreterName;
}
vertretungsItem.MailSchule.Message = String.Format(@"
Sehr geehrte Damen und Herren,
die Schulbegleitung für {0} wird vom {1:dd.MM.yyyy} bis voraussichtlich {2:dd.MM.yyyy} {3} übernehmen.
Eventuelle Änderungen oder Vertretungen nach dem Datum Ende teilen wir Ihnen so früh wie möglich mit. Es gilt die jeweils letzte Mail.
Bei Rückfragen erreichen Sie uns an jedem Unterrichtstag von 6:30 Uhr bis 10:00 Uhr unter 015116889795", customer != null ? customer.Person.FirstNameLastName : "", vertretungsItem.Absencetime != null ? vertretungsItem.Absencetime.Start : null, vertretungsItem.Absencetime != null ? vertretungsItem.Absencetime.End : null, vertreterName);
}
else
{
vertretungsItem.MailSchule.Message = String.Format(@"
Sehr geehrte Damen und Herren,
leider haben wir aktuell für {0} am {1:dd.MM.yyyy} keine freie Vertretungskraft. 
Eventuelle Änderungen oder Vertretungen nach dem {1:dd.MM.yyyy} teilen wir Ihnen so früh wie möglich mit. Es gilt die jeweils letzte Mail.
Bei Rückfragen erreichen Sie uns an jedem Unterrichtstag von 6:30 Uhr bis 10:00 Uhr unter: 015116889795", customer != null ? customer.Person.FirstNameLastName : "", vertretungsItem.Datum);
}
vertretungsItem.MailSchule.Message = vertretungsItem.MailSchule.Message.Replace("\n", "%0D%0A");
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
@@ -379,7 +380,6 @@ namespace BeWo.Service.Plugins
var result = new List<CompactPersonDC>();
var alleList = new List<CompactPersonDC>();
var cProcessed = new Dictionary<long, bool>();
bool darfPersonenSehen = false;
bool darfFamilieSehen = false;
@@ -418,7 +418,188 @@ namespace BeWo.Service.Plugins
return result.OrderBy(p => p.ToString()).ToList();
}
private void SetFamilyMemberStatus(List<CompactPersonDC> result)
public virtual List<CompactPersonDC> GetAllPersonsByTypeCompact(PersonType pType)
{
var result = new List<CompactPersonDC>();
bool darfFamilieSehen = false;
bool darfAlleKlientenSehen = false;
bool darfKlientenDesTeamsSehen = false;
bool darfSeineKlientenSehen = false;
List<long> allowedCustomerOids = new List<long>();
if (!UserRightHelper.LoggedInUserHasRight(UserRightType.PersonView_View))
{
return result;
}
var user = UserRightHelper.GetLoggedInUser();
if (UserRightHelper.LoggedInUserHasRight(UserRightType.Person_FamilyView))
{
darfFamilieSehen = true;
}
if (UserRightHelper.LoggedInUserHasRight(UserRightType.CustomerView_View))
{
darfAlleKlientenSehen = true;
darfKlientenDesTeamsSehen = true;
darfSeineKlientenSehen = true;
}
else if (UserRightHelper.LoggedInUserHasRight(UserRightType.Customer_ViewMyTeams))
{
darfKlientenDesTeamsSehen = true;
darfSeineKlientenSehen = true;
var dict = CreateTeamOidDict(user.Employee.Oid.Value);
foreach (var oid in dict.Keys)
{
var clist = DAOFactory.SearchDAO.FindCustomerOfTeam(oid);
foreach (var c in clist)
{
foreach (var e2c in c.Employee2CustomerList)
{
if (!e2c.EndDate.HasValue || e2c.EndDate.Value >= DateTime.Now.Date)
{
allowedCustomerOids.Add(e2c.CustomerOid.Value);
}
}
}
}
foreach (var e2c in user.Employee.Employee2CustomerList)
{
if (!e2c.EndDate.HasValue || e2c.EndDate.Value >= DateTime.Now.Date)
{
allowedCustomerOids.Add(e2c.CustomerOid.Value);
}
}
}
else if (UserRightHelper.LoggedInUserHasRight(UserRightType.Customer_ViewMyCustomers))
{
darfSeineKlientenSehen = true;
foreach (var e2c in user.Employee.Employee2CustomerList)
{
if (!e2c.EndDate.HasValue || e2c.EndDate.Value >= DateTime.Now.Date)
{
allowedCustomerOids.Add(e2c.CustomerOid.Value);
}
}
}
IList<Person> persons = DAOFactory.GenericDAO.GetAll<Person>().Where(p => p.Type == pType).ToList();
Dictionary<long, List<CustomerPersonRelationDC>> person2CustomerOidDict = new Dictionary<long, List<CustomerPersonRelationDC>>();
IList<long> personOids = new List<long>();
foreach (var person in persons)
{
personOids.Add(person.Oid.Value);
}
if (!darfFamilieSehen || !darfAlleKlientenSehen)
{
var c2oList = DAOFactory.SearchDAO.FindCustomerOid2Persons(personOids);
foreach (object[] item in c2oList)
{
var oid = (long)item[0];
var poid = (long)item[1];
var coid = (long)item[2];
var test = (sbyte?)item[3];
var isF = (sbyte?)item[3];
var c2p = new CustomerPersonRelationDC();
c2p.Customer2PersonOid = oid;
c2p.Person = new CompactPersonDC { PersonOid = poid };
c2p.Customer = new CompactCustomerDC { CustomerOid = coid };
c2p.IstFamilie = isF.HasValue ? isF.Value == 1 : false;
if (!person2CustomerOidDict.ContainsKey(poid))
{
person2CustomerOidDict.Add(poid, new List<CustomerPersonRelationDC>());
}
person2CustomerOidDict[poid].Add(c2p);
}
}
foreach (var person in persons)
{
List<CustomerPersonRelationDC> list = null;
if (person2CustomerOidDict.ContainsKey(person.Oid.Value))
{
list = person2CustomerOidDict[person.Oid.Value];
}
else
{
list = new List<CustomerPersonRelationDC>();
}
if (UserIsAllowedToViewPerson(person, list, allowedCustomerOids, darfFamilieSehen, darfAlleKlientenSehen, darfKlientenDesTeamsSehen, darfSeineKlientenSehen))
{
if (person.Organisation2Persons.Count == 0)
{
var dc = MapperFactory.CompactPersonDC_Person.MapToNewDC(person);
result.Add(dc);
if (pType == PersonType.Others)
AddContacts(dc, person, null);
}
foreach (var o2p in person.Organisation2Persons)
{
var dc = MapperFactory.CompactPersonDC_Person.MapToNewDC(person);
result.Add(dc);
if (pType == PersonType.Others)
{
AddContacts(dc, person, o2p);
dc.Organisation = o2p.Organisation.Name;
if (o2p.Organisation.Address != null)
{
dc.Street = o2p.Organisation.Address.Street;
dc.PostalCode = o2p.Organisation.Address.PostalCode;
dc.Town = o2p.Organisation.Address.Town;
}
}
}
}
}
SetFamilyMemberStatus(result);
return result;
}
private bool UserIsAllowedToViewPerson(Person person, List<CustomerPersonRelationDC> person2CustomerList, List<long> allowedCustomerOids, bool darfFamilieSehen, bool darfAlleKlientenSehen, bool darfKlientenDesTeamsSehen, bool darfSeineKlientenSehen)
{
if (darfFamilieSehen && darfAlleKlientenSehen)
{
return true;
}
if (!darfFamilieSehen)
{
return person2CustomerList.Count(p => p.IstFamilie) == 0;
}
if (darfAlleKlientenSehen)
{
return true;
}
if (darfKlientenDesTeamsSehen || darfSeineKlientenSehen)
{
foreach (var p2c in person2CustomerList)
{
if (allowedCustomerOids.Contains(p2c.Customer.CustomerOid))
{
return true;
}
}
}
return false;
}
private void SetFamilyMemberStatus(List<CompactPersonDC> result)
{
var familyOids = DAOFactory.SearchDAO.FindFamilyMemberOids();
@@ -431,6 +612,103 @@ namespace BeWo.Service.Plugins
}
}
public static void AddContacts(CompactPersonDC dc, Person person, Organisation2Person o2p)
{
if (o2p != null)
{
if (o2p.Contacts != null)
{
foreach (Contact contact in o2p.Contacts)
{
if (contact.Type == ContactType.business_Phone)
{
dc.Communication1 = contact.Value;
}
if (contact.Type == ContactType.business_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
if (o2p.Organisation != null && o2p.Organisation.Contacts != null)
{
if (String.IsNullOrEmpty(dc.Communication1))
{
foreach (Contact contact in o2p.Organisation.Contacts)
{
if (contact.Type == ContactType.business_Phone)
{
dc.Communication1 = contact.Value;
}
}
}
if (String.IsNullOrEmpty(dc.Communication2))
{
//foreach (var contact in org.Contacts)
//{
// if (contact.Type == ContactType.b)
// {
// dc.Communication2 = contact.Value;
// }
//}
}
if (String.IsNullOrEmpty(dc.Communication3))
{
foreach (Contact contact in o2p.Organisation.Contacts)
{
if (contact.Type == ContactType.business_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication1))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_Phone)
{
dc.Communication1 = contact.Value;
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication2))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_MobilePhone)
{
dc.Communication2 = contact.Value;
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication3))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
}
}
private ApplicationUser GetLoggedInUser()
{

View File

@@ -223,7 +223,7 @@ namespace BeWo.Service.Plugins
//t = "7817461089"; // FAB e.V. (Familienarbeit und Beratung e.V.)
//t = "5207911843"; // Pro Balance
//t = "8619663355"; // HSH Cologne
t = "1652658918"; // LH Frankfurt Oder
//t = "1652658918"; // LH Frankfurt Oder
//t = "7696927868"; // Kuhring Betreuung
//t = "6251348980"; // BeWo Gün
//t = "6782533512"; // LH Dorsten
@@ -326,7 +326,7 @@ namespace BeWo.Service.Plugins
//t = "5065709552"; // Biotop e.V.
//t = "9094672461"; // Transkulturelles Betreuungsbüro (Toprak GmbH)
//t = "9008813932"; // Aids Hilfe Giessen
t = "4052216789"; // Perspektiven e.V.
//t = "4052216789"; // Perspektiven e.V.
//t = "7663765314"; // Christina Frommen (Frommen BeWo)
//t = "5462295916"; // BeWo Dellbrueck
//t = "2120989920"; // Sozialbüro Schüßler und Wilckens GbR
@@ -357,7 +357,7 @@ namespace BeWo.Service.Plugins
//t = "4434019324"; // FENIX Soziale Dienste
//t = "6219220038"; // SKM Kreis Viersen e.V.
//t = "1372050368"; // Petra Wagner Matthes
//t = "1253359817"; // Lebenshilfe Bad Kreuznach e.V.
t = "1253359817"; // Lebenshilfe Bad Kreuznach e.V.
//t = "6038574522"; // I-Wohl
//t = "2438529184"; // Alloheim Seniorenresidenzen SE
//t = "7564067748"; // SKM Aachen

View File

@@ -366,14 +366,11 @@ namespace BeWo.Service.Plugins
{
stats.MinutesOutOfApprovedPeriod += minutesProvidedRounded;
}
else
{
stats.MinutesProvidedTotal += minutesProvided;
stats.MinutesProvidedTotalRounded += minutesProvidedRounded;
stats.MinutesProvidedThisWeek += minutesProvidedThisWeek;
stats.MinutesProvidedThisMonth += minutesProvidedThisMonth;
stats.IstTotalUntilThisMonth += minutesProvidedUntilLastMonth;
}
stats.MinutesProvidedTotal += minutesProvided;
stats.MinutesProvidedTotalRounded += minutesProvidedRounded;
stats.MinutesProvidedThisMonth += minutesProvidedThisMonth;
stats.IstTotalUntilThisMonth += minutesProvidedUntilLastMonth;
stats.MinutesProvidedThisWeek += minutesProvidedThisWeek;
if (periodStats != null)
@@ -382,13 +379,12 @@ namespace BeWo.Service.Plugins
{
periodStats.MinutesOutOfApprovedPeriod += minutesProvidedRounded;
}
{
periodStats.MinutesProvidedTotal += minutesProvided;
periodStats.MinutesProvidedTotalRounded += minutesProvidedRounded;
periodStats.MinutesProvidedThisWeek += minutesProvidedThisWeek;
periodStats.MinutesProvidedThisMonth += minutesProvidedThisMonth;
periodStats.IstTotalUntilThisMonth += minutesProvidedUntilLastMonth;
}
periodStats.MinutesProvidedTotal += minutesProvided;
periodStats.MinutesProvidedTotalRounded += minutesProvidedRounded;
periodStats.MinutesProvidedThisWeek += minutesProvidedThisWeek;
periodStats.MinutesProvidedThisMonth += minutesProvidedThisMonth;
periodStats.IstTotalUntilThisMonth += minutesProvidedUntilLastMonth;
}
}

View File

@@ -5,6 +5,7 @@ using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.MessageContracts;
@@ -129,73 +130,12 @@ namespace BeWo.Service.Plugins
// }
//}
}
CheckRightVersion(userDC);
UserRightHelper.CheckRightVersion(userDC);
}
return userDC;
}
private void CheckRightVersion(UserDC userDC)
{
var lastLogins = DAOFactory.SearchDAO.FindLastLogins(userDC.LoginName, 1).ToList();
if (lastLogins != null && lastLogins.Count > 0)
{
var login = lastLogins[0];
if (!String.IsNullOrEmpty(login.Referrer))
{
//var test = "MobilClient, Version: Unbekannt";
//var test2 = "BeWoClient, Version: Microsoft Windows NT 6.2.9200.0;CLRVersion=4.0.30319.42000;BeWoVersion=Version 3.16;IsNet45OrNewer=True";
var str = login.Referrer;
//str = test;
var start = str.IndexOf("BeWoVersion=");
if (start > 0)
{
var stop = str.IndexOf(";", start);
if (stop > start)
{
//BeWoClient, Version: Microsoft Windows NT 6.2.9200.0;CLRVersion=4.0.30319.42000;BeWoVersion=Version 3.17;IsNet45OrNewer=True
var version = str.Substring(start + 12, stop - start - 12);
version = version.Replace("Version", "").Trim();
foreach (var ug in userDC.UserGroups)
{
var allrights = ug.Rights;
ug.Rights = new List<UserRightType>();
foreach (var r in allrights)
{
if (IsCorrectVersion(r, version))
{
ug.Rights.Add(r);
}
}
}
}
}
}
}
}
private bool IsCorrectVersion(UserRightType r, string version)
{
var rightVersion = GetRightVersion(r);
if (version.CompareTo(rightVersion) < 0)
{
return false;
}
return true;
}
private object GetRightVersion(UserRightType r)
{
if (r == UserRightType.Customer_ViewBetreuung || r == UserRightType.Customer_ViewAbsenceTimes)
{
return "3.17";
}
return "1.0";
}
}
}

View File

@@ -387,7 +387,7 @@ namespace BeWo.Service.ServiceImplementations
result.Add(dc);
if (pType == PersonType.Others)
AddContacts(dc, person, null);
CustomerService.AddContacts(dc, person, null);
}
foreach (Organisation2Person o2p in person.Organisation2Persons)
{
@@ -396,7 +396,7 @@ namespace BeWo.Service.ServiceImplementations
if (pType == PersonType.Others)
{
AddContacts(dc, person, o2p);
CustomerService.AddContacts(dc, person, o2p);
dc.Organisation = o2p.Organisation.Name;
if (o2p.Organisation.Address != null)
@@ -423,43 +423,10 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
IList<Person> persons = DAOFactory.GenericDAO.GetAll<Person>().Where(p => p.Type == pType).ToList();
var s = PluginLoader.FindClass<CustomerService>();
var result = new List<CompactPersonDC>();
return s.GetAllPersonsByTypeCompact(pType);
foreach (var person in persons)
{
if (person.Organisation2Persons.Count == 0)
{
var dc = MapperFactory.CompactPersonDC_Person.MapToNewDC(person);
result.Add(dc);
if (pType == PersonType.Others)
AddContacts(dc, person, null);
}
foreach (var o2p in person.Organisation2Persons)
{
var dc = MapperFactory.CompactPersonDC_Person.MapToNewDC(person);
result.Add(dc);
if (pType == PersonType.Others)
{
AddContacts(dc, person, o2p);
dc.Organisation = o2p.Organisation.Name;
if (o2p.Organisation.Address != null)
{
dc.Street = o2p.Organisation.Address.Street;
dc.PostalCode = o2p.Organisation.Address.PostalCode;
dc.Town = o2p.Organisation.Address.Town;
}
}
}
}
SetFamilyMemberStatus(result);
return result;
}
catch (Exception e)
{
@@ -1945,102 +1912,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
private static void AddContacts(CompactPersonDC dc, Person person, Organisation2Person o2p)
{
if (o2p != null)
{
if (o2p.Contacts != null)
{
foreach (Contact contact in o2p.Contacts)
{
if (contact.Type == ContactType.business_Phone)
{
dc.Communication1 = contact.Value;
}
if (contact.Type == ContactType.business_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
if (o2p.Organisation != null && o2p.Organisation.Contacts != null)
{
if (String.IsNullOrEmpty(dc.Communication1))
{
foreach (Contact contact in o2p.Organisation.Contacts)
{
if (contact.Type == ContactType.business_Phone)
{
dc.Communication1 = contact.Value;
}
}
}
if (String.IsNullOrEmpty(dc.Communication2))
{
//foreach (var contact in org.Contacts)
//{
// if (contact.Type == ContactType.b)
// {
// dc.Communication2 = contact.Value;
// }
//}
}
if (String.IsNullOrEmpty(dc.Communication3))
{
foreach (Contact contact in o2p.Organisation.Contacts)
{
if (contact.Type == ContactType.business_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication1))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_Phone)
{
dc.Communication1 = contact.Value;
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication2))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_MobilePhone)
{
dc.Communication2 = contact.Value;
}
}
}
}
if (String.IsNullOrEmpty(dc.Communication3))
{
if (person.Contacts != null)
{
foreach (Contact contact in person.Contacts)
{
if (contact.Type == ContactType.private_Mail)
{
dc.Communication3 = contact.Value;
}
}
}
}
}
private List<CompactOrganisationDC> CreateCompactOrganisations(IList<Organisation> list)
{

View File

@@ -25,6 +25,7 @@ using MySql.Data.MySqlClient;
using BeWo.Service.Configuration;
using BeWo.Service.OwnChat;
using BeWo.Service.Plugins;
using BeWo.Data.Security;
namespace BeWo.Service.ServiceImplementations
{
@@ -286,7 +287,13 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
return MapperFactory.UserGroupDC_UserGroup.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<UserGroup>());
var list = MapperFactory.UserGroupDC_UserGroup.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<UserGroup>());
var version = UserRightHelper.GetBeWoVersion();
foreach (var ug in list)
{
UserRightHelper.CheckRightVersion(version, ug);
}
return list;
}
catch (Exception e)
{
@@ -312,7 +319,14 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
return MapperFactory.UserGroupDC_UserGroup.MapToNewDCs(SettingsLogic.GetLastOpened<UserGroup>());
var list = MapperFactory.UserGroupDC_UserGroup.MapToNewDCs(SettingsLogic.GetLastOpened<UserGroup>());
foreach (var item in list)
{
item.Rights = new List<UserRightType>(); // Keine Rechte zum Client schicken um bei neuen Rechten keinen Fehler mit alter Version zu erzeugen. Die Rechte sind hier sowieso nicht wichtig.
}
return list;
}
catch (Exception e)
{
@@ -564,6 +578,7 @@ namespace BeWo.Service.ServiceImplementations
SettingsLogic.AddToUsersHistory<ApplicationUser>(pUserOid);
var user = MapperFactory.UserDC_User.MapToNewDC(DAOFactory.GenericDAO.LoadByID<ApplicationUser>(pUserOid));
UserRightHelper.CheckRightVersion(user);
//var m = DAOFactory.GenericDAO.LoadByID<Mandator>(1);
//if (m != null && m.ClientId == "SBD")
//{
@@ -632,7 +647,10 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
return MapperFactory.UserGroupDC_UserGroup.MapToNewDC(DAOFactory.GenericDAO.LoadByID<UserGroup>(pOid));
var ug = MapperFactory.UserGroupDC_UserGroup.MapToNewDC(DAOFactory.GenericDAO.LoadByID<UserGroup>(pOid));
UserRightHelper.CheckRightVersion(ug);
return ug;
}
catch (Exception e)
{