diff --git a/.gitignore b/.gitignore
index ce4dc378c..55ce342e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -259,3 +259,5 @@
/.vs/BeWoGit/v15
/ReportImp/DerKarrenSbd/obj/Debug
/ReportImp/DerKarrenSbd/obj/Release
+/.vs
+/BeWo/.vs/BeWo/v14/*.suo
diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index ba1910b95..cf2fb96de 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -287,6 +287,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -751,6 +755,9 @@
ServiceRecordRTFWindowView.xaml
+
+ TextbausteinView.xaml
+
MessageDialog.xaml
@@ -895,6 +902,7 @@
MiniChatView.xaml
+
WohnheimNavigationView.xaml
diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs
index 3e74aa8bb..95945cce8 100644
--- a/BeWo/BeWoApp.xaml.cs
+++ b/BeWo/BeWoApp.xaml.cs
@@ -18,6 +18,7 @@ using BeWo.Core.Config;
using BeWo.ServiceProxy;
using BeWo.View;
using BeWo.View.Navigation;
+using BeWo.View.Navigation.Filter;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
@@ -203,7 +204,7 @@ namespace BeWo
bool isZeiterfassungInStdMin = false;
int lastSelectedStundenkontoIntervall = 3;
bool showSignatures = false;
- bool showRtfTextfeld = false;
+ bool showRtfTextfield = false;
AppSettings.ShowAdvisedAttendedFlag = false;
@@ -378,10 +379,10 @@ namespace BeWo
showSignatures = true;
}
- val = GetSettingValue(_Mandator.Settings, "ShowRtfTextfeld");
+ val = GetSettingValue(_Mandator.Settings, "ShowRtfTextfield");
if (val != null && val.Equals("1"))
{
- showRtfTextfeld = true;
+ showRtfTextfield = true;
}
@@ -450,7 +451,7 @@ namespace BeWo
AppSettings.ShowHilfeplanBezeichnung = showHilfeplanBezeichnung;
AppSettings.ShowArbeitszeiten = showArbeitszeiten;
AppSettings.ShowSignatures = showSignatures;
- AppSettings.ShowRtfTextfeld = showRtfTextfeld;
+ AppSettings.ShowRtfTextfield = showRtfTextfield;
AppSettings.ShowCustomerDistanceFields = showCustomerDistanceFields;
AppSettings.ShowAdditionalService = showAdditionalService;
AppSettings.ShowRoundedDurationInEmployeeAnalysis = showRoundedDurationInEmployeeAnalysis;
@@ -678,11 +679,9 @@ namespace BeWo
_AppSettings.IsDirty = false;
SetSettingValue(SettingsType.ApplicationSettings, "WindowStateType", ((int) _AppSettings.WindowState).ToString());
SetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeInterval", ((int) _AppSettings.LastSelectedServiceRecordTimeInterval).ToString());
- SetSettingValue(SettingsType.ApplicationSettings, "ShowAllClients", _AppSettings.ShowAllClients ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMySupportConcepts", _AppSettings.ShowOnlyMySupportConcepts ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamSupportConcepts", _AppSettings.ShowOnlyTeamSupportConcepts ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients", _AppSettings.ShowOnlyMyClients ? "1" : "0");
- SetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamClients", _AppSettings.ShowOnlyTeamClients ? "1" : "0");
+ SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterInZeiterfassung", ((int)_AppSettings.CustomerFilterInZeiterfassung).ToString());
+ SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterSupportConcepts", ((int)_AppSettings.CustomerFilterSupportConcepts).ToString());
+ SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterCustomers", ((int)_AppSettings.CustomerFilterCustomers).ToString());
SetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts", _AppSettings.ShowExpiredSupportConcepts ? "1" : "0");
SetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl", _AppSettings.ShowServiceRecordGridControl ? "1" : "0");
SetSettingValue(SettingsType.ApplicationSettings, "StartupPanelMaximized", _AppSettings.StartupPanelMaximized);
@@ -805,20 +804,21 @@ namespace BeWo
_AppSettings.LastSelectedServiceRecordTimeInterval = (ServiceRecordTimeInterval) result;
}
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowAllClients");
- _AppSettings.ShowAllClients = val == "1";
-
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMySupportConcepts");
- _AppSettings.ShowOnlyMySupportConcepts = val != "0";
-
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamSupportConcepts");
- _AppSettings.ShowOnlyTeamSupportConcepts = val != "0";
-
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyMyClients");
- _AppSettings.ShowOnlyMyClients = val == "1";
-
- val = GetSettingValue(SettingsType.ApplicationSettings, "ShowOnlyTeamClients");
- _AppSettings.ShowOnlyTeamClients = val == "1";
+ val = GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterInZeiterfassung");
+ if (Int32.TryParse(val, out result))
+ {
+ _AppSettings.CustomerFilterInZeiterfassung = (CustomerFilterEnum)result;
+ }
+ val = GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterSupportConcepts");
+ if (Int32.TryParse(val, out result))
+ {
+ _AppSettings.CustomerFilterSupportConcepts = (CustomerFilterEnum)result;
+ }
+ val = GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterCustomers");
+ if (Int32.TryParse(val, out result))
+ {
+ _AppSettings.CustomerFilterCustomers = (CustomerFilterEnum)result;
+ }
val = GetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl");
_AppSettings.ShowServiceRecordGridControl = val == "1";
diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs
index f25125d75..0a1a1fd25 100644
--- a/BeWo/Core/BeWoUtils.cs
+++ b/BeWo/Core/BeWoUtils.cs
@@ -1885,6 +1885,7 @@ namespace BeWo.Core
{
encoder.Frames.Add(BitmapFrame.Create((BitmapSource)imgg.Source));
encoder.Save(ms);
+
var img = System.Drawing.Image.FromStream(ms);
using (var imgbit = new Bitmap(img))
@@ -1892,7 +1893,7 @@ namespace BeWo.Core
form.StartPosition = FormStartPosition.CenterScreen;
form.Size = imgbit.Size;
form.FormBorderStyle = FormBorderStyle.Sizable;
-
+ form.ShowIcon = false;
using (var pb = new PictureBox())
{
pb.Dock = DockStyle.Fill;
diff --git a/BeWo/Core/Config/AppSettings.cs b/BeWo/Core/Config/AppSettings.cs
index d5aae2eb3..77e96eaaa 100644
--- a/BeWo/Core/Config/AppSettings.cs
+++ b/BeWo/Core/Config/AppSettings.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-
+using BeWo.View.Navigation.Filter;
using BS.Shared;
namespace BeWo.Core.Config
@@ -18,10 +18,13 @@ namespace BeWo.Core.Config
private bool misZeiterfassungInStdMin = true;
- private bool mShowOnlyMySupportConcepts = true;
-
- private bool mShowOnlyTeamSupportConcepts = true;
+ private CustomerFilterEnum _CustomerFilterInZeiterfassung = CustomerFilterEnum.All;
+ private CustomerFilterEnum _CustomerFilterSupportConcepts = CustomerFilterEnum.All;
+ private CustomerFilterEnum _CustomerFilterCustomers = CustomerFilterEnum.All;
+ private bool _showExpiredSupportConcepts = true;
+ private bool _showServiceRecordGridControl;
+
private WindowStateType mWindowStateType = WindowStateType.Default;
private ServiceRecordTimeInterval mLastSelectedServiceRecordTimeInterval = ServiceRecordTimeInterval.All;
@@ -35,6 +38,7 @@ namespace BeWo.Core.Config
Default,
Maximised
}
+
public bool IsServiceRecordNoticeMandatory
{
@@ -102,26 +106,50 @@ namespace BeWo.Core.Config
public bool HideServiceRecordInsertedByAndInsertedOn { get; set; }
public bool ShowAdvisedAttendedFlag { get; set; }
-
- private bool _showAllClients;
-
- public bool ShowAllClients
+
+ public CustomerFilterEnum CustomerFilterInZeiterfassung
{
- get { return _showAllClients; }
+ get { return _CustomerFilterInZeiterfassung; }
set
{
- if (_showAllClients != value)
+ if (_CustomerFilterInZeiterfassung != value)
{
- _showAllClients = value;
+ _CustomerFilterInZeiterfassung = value;
IsDirty = true;
}
}
}
+ public CustomerFilterEnum CustomerFilterSupportConcepts
+ {
+ get { return _CustomerFilterSupportConcepts; }
+ set
+ {
+ if (_CustomerFilterSupportConcepts != value)
+ {
+ _CustomerFilterSupportConcepts = value;
+ IsDirty = true;
+ }
+ }
+ }
+
+ public CustomerFilterEnum CustomerFilterCustomers
+ {
+ get { return _CustomerFilterCustomers; }
+
+ set
+ {
+ if (_CustomerFilterCustomers != value)
+ {
+ _CustomerFilterCustomers = value;
+ IsDirty = true;
+ }
+ }
+ }
+
+
public bool ShowDatevFields { get; set; }
-
- private bool _showExpiredSupportConcepts = true;
-
+
public bool ShowExpiredSupportConcepts
{
get { return _showExpiredSupportConcepts; }
@@ -135,37 +163,8 @@ namespace BeWo.Core.Config
}
}
- private bool _showOnlyMyClients;
-
- public bool ShowOnlyMyClients
- {
- get { return _showOnlyMyClients; }
- set
- {
- if (_showOnlyMyClients != value)
- {
- _showOnlyMyClients = value;
- IsDirty = true;
- }
- }
- }
-
- private bool _showOnlyTeamClients;
-
- public bool ShowOnlyTeamClients
- {
- get { return _showOnlyTeamClients; }
- set
- {
- if (_showOnlyTeamClients != value)
- {
- _showOnlyTeamClients = value;
- IsDirty = true;
- }
- }
- }
-
- private bool _showServiceRecordGridControl;
+
+
public bool ShowServiceRecordGridControl
{
@@ -182,34 +181,7 @@ namespace BeWo.Core.Config
public bool ShowLargeCustomerNotice { get; set; }
- public bool ShowOnlyMySupportConcepts
- {
- get { return mShowOnlyMySupportConcepts; }
-
- set
- {
- if (mShowOnlyMySupportConcepts != value)
- {
- mShowOnlyMySupportConcepts = value;
- IsDirty = true;
- }
- }
- }
-
- public bool ShowOnlyTeamSupportConcepts
- {
- get { return mShowOnlyTeamSupportConcepts; }
-
- set
- {
- if (mShowOnlyTeamSupportConcepts != value)
- {
- mShowOnlyTeamSupportConcepts = value;
- IsDirty = true;
- }
- }
- }
-
+
public bool ZeigeNurMeineTermine
{
get { return mZeigeNurMeineTermine; }
@@ -349,7 +321,7 @@ namespace BeWo.Core.Config
public bool ShowSignatures { get; set; }
- public bool ShowRtfTextfeld { get; set; }
+ public bool ShowRtfTextfield { get; set; }
public bool ShowTeamNews { get; set; }
diff --git a/BeWo/MainControl.xaml b/BeWo/MainControl.xaml
index 7756c250b..000c1068c 100644
--- a/BeWo/MainControl.xaml
+++ b/BeWo/MainControl.xaml
@@ -162,7 +162,7 @@
-
+
@@ -133,7 +133,7 @@
-
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/ServicesReportView.xaml.cs b/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
index 2fa17151b..a517ab16f 100644
--- a/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
+++ b/BeWo/View/Detail/Report/ServicesReportView.xaml.cs
@@ -43,7 +43,7 @@ namespace BeWo.View.Detail.Report
public CompactOrganisationDC Organisation { get { return _Organisation; } set { _Organisation = value; } }
- private List _quittierungsCheck = new List();
+ //private List _quittierungsCheck = new List();
private Dictionary Dicdate = new Dictionary();
@@ -63,20 +63,19 @@ namespace BeWo.View.Detail.Report
// checkbox_all.IsChecked = false;
//}
- SetMonthCombobox();
- SetYearCombobox();
+ // SetMonthCombobox();
+ // SetYearCombobox();
- GridControlQuittierungsCheck.ItemsSource = _quittierungsCheck;
+ //GridControlQuittierungsCheck.ItemsSource = _quittierungsCheck;
- GetQuittierungsCheckCustomerList(DateTime.Now);
+ // GetQuittierungsCheckCustomerList(DateTime.Now);
combobox_month.SelectionChanged += combobox_month_SelectionChanged;
combobox_year.SelectionChanged += combobox_year_SelectionChanged;
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
- //ThemeManager.SetTheme(docPrevControl, Theme.Office2010Black);
-
+
Unloaded += delegate
{
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, null);
@@ -334,270 +333,270 @@ namespace BeWo.View.Detail.Report
}
//####################### Übersicht bereich #############################################
- private void GetQuittierungsCheckCustomerList(DateTime monat)
- {
- List qbCheckList = new List();
+ //private void GetQuittierungsCheckCustomerList(DateTime monat)
+ //{
+ // List qbCheckList = new List();
- long? oid = null;
+ // long? oid = null;
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
- {
- oid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
- }
+ // if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
+ // {
+ // oid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
+ // }
- ServiceFacade.DoCustomerServiceAsync(
- s => s.GetAllActiveCustomersCompactWithQBCheckList(this.FetchReferenceNumbers, oid, monat),
- r =>
- {
- List list = r;
+ // ServiceFacade.DoCustomerServiceAsync(
+ // s => s.GetAllActiveCustomersCompactWithQBCheckList(this.FetchReferenceNumbers, oid, monat),
+ // r =>
+ // {
+ // List list = r;
- if (oid != null)
- {
- list = list.Where(c => c.Customer.IsRelatedToEmployee).ToList();
- }
+ // if (oid != null)
+ // {
+ // list = list.Where(c => c.Customer.IsRelatedToEmployee).ToList();
+ // }
- list.Sort((x, y) => (x.Customer.LastName + ", " + x.Customer.FirstName).CompareTo(y.Customer.LastName + ", " + y.Customer.FirstName));
+ // list.Sort((x, y) => (x.Customer.LastName + ", " + x.Customer.FirstName).CompareTo(y.Customer.LastName + ", " + y.Customer.FirstName));
- qbCheckList = list;
+ // qbCheckList = list;
- #region Dispatcher Refresh and add items to Grid
- this.Dispatch(delegate
- {
- AddQuittierungsCheckToGrid(qbCheckList);
- GridControlQuittierungsCheck.RefreshData();
- GridControlQuittierungsCheck.RefreshUI();
- });
- #endregion
- });
- }
+ // #region Dispatcher Refresh and add items to Grid
+ // this.Dispatch(delegate
+ // {
+ // AddQuittierungsCheckToGrid(qbCheckList);
+ // GridControlQuittierungsCheck.RefreshData();
+ // GridControlQuittierungsCheck.RefreshUI();
+ // });
+ // #endregion
+ // });
+ //}
- private void AddQuittierungsCheckToGrid(List customerListe)
- {
- _quittierungsCheck.Clear();
+ //private void AddQuittierungsCheckToGrid(List customerListe)
+ //{
+ // _quittierungsCheck.Clear();
- foreach (var list in customerListe)
- {
- QuittierungsCheckView x = new QuittierungsCheckView();
+ // foreach (var list in customerListe)
+ // {
+ // QuittierungsCheckView x = new QuittierungsCheckView();
- x.Klient = list.Customer.FullName;
+ // x.Klient = list.Customer.FullName;
- //############ Druck ####################
- if (list.QuittierungsbelegDruck.HasValue)
- x.QuittierungsbelegGedruckt = list.QuittierungsbelegDruck.Value;
+ // //############ Druck ####################
+ // if (list.QuittierungsbelegDruck.HasValue)
+ // x.QuittierungsbelegGedruckt = list.QuittierungsbelegDruck.Value;
- if (list.QuittierungsbelegDruckAm.HasValue)
- {
- x.QuittierungsbelegGedrucktAm = list.QuittierungsbelegDruckAm.Value.ToString("dd.MM.yyyy");
- x.IsQbUnterschriebenAvailable = true;
- }
- else
- {
- x.IsQbUnterschriebenAvailable = false;
- }
+ // if (list.QuittierungsbelegDruckAm.HasValue)
+ // {
+ // x.QuittierungsbelegGedrucktAm = list.QuittierungsbelegDruckAm.Value.ToString("dd.MM.yyyy");
+ // x.IsQbUnterschriebenAvailable = true;
+ // }
+ // else
+ // {
+ // x.IsQbUnterschriebenAvailable = false;
+ // }
- x.GedrucktAm = list.QuittierungsbelegDruckAm;
+ // x.GedrucktAm = list.QuittierungsbelegDruckAm;
- x.QuittierungsbelegGedrucktVonOid = list.QuittierungsbelegGedrucktVonOid;
+ // x.QuittierungsbelegGedrucktVonOid = list.QuittierungsbelegGedrucktVonOid;
- x.QuittierungsbelegGedrucktVon = list.QuittierungsbelegGedrucktVon;
+ // x.QuittierungsbelegGedrucktVon = list.QuittierungsbelegGedrucktVon;
- //######################################
+ // //######################################
- //############ Unterschrift ############
- if (list.QuittierungsbelegUnterschrift.HasValue)
- x.QuittierungsbelegUnterschrieben = list.QuittierungsbelegUnterschrift.Value;
+ // //############ Unterschrift ############
+ // if (list.QuittierungsbelegUnterschrift.HasValue)
+ // x.QuittierungsbelegUnterschrieben = list.QuittierungsbelegUnterschrift.Value;
- x.QuittierungsbelegUnterschriebenVonOid = list.QuittierungsbelegUnterschriftVonOid;
+ // x.QuittierungsbelegUnterschriebenVonOid = list.QuittierungsbelegUnterschriftVonOid;
- x.QuittierungsbelegUnterschriebenVon = list.QuittierungsbelegUnterschriftVon;
+ // x.QuittierungsbelegUnterschriebenVon = list.QuittierungsbelegUnterschriftVon;
- //######################################
+ // //######################################
- if (list.QuittierungsCheckOid.HasValue)
- x.QuittierungsCheckOid = list.QuittierungsCheckOid;
+ // if (list.QuittierungsCheckOid.HasValue)
+ // x.QuittierungsCheckOid = list.QuittierungsCheckOid;
- if (list.Monat.HasValue)
- x.Monat = list.Monat.Value;
+ // if (list.Monat.HasValue)
+ // x.Monat = list.Monat.Value;
- x.CompactCustomer = list.Customer;
+ // x.CompactCustomer = list.Customer;
- _quittierungsCheck.Add(x);
- }
- }
+ // _quittierungsCheck.Add(x);
+ // }
+ //}
- private void CheckBoxQBU_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
- {
- var qbChanges = (QuittierungsCheckView)GridControlQuittierungsCheck.SelectedItem;
+ //private void CheckBoxQBU_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
+ //{
+ // var qbChanges = (QuittierungsCheckView)GridControlQuittierungsCheck.SelectedItem;
- QuittierungsCheckDC qbCheck = new QuittierungsCheckDC()
- {
- CustomerOid = qbChanges.CompactCustomer.CustomerOid,
+ // QuittierungsCheckDC qbCheck = new QuittierungsCheckDC()
+ // {
+ // CustomerOid = qbChanges.CompactCustomer.CustomerOid,
- QuittierungsbelegGedruckt = qbChanges.QuittierungsbelegGedruckt,
- QuittierungsbelegGedrucktAm = qbChanges.GedrucktAm,
- QuittierungsbelegGedrucktVon = qbChanges.QuittierungsbelegGedrucktVonOid,
+ // QuittierungsbelegGedruckt = qbChanges.QuittierungsbelegGedruckt,
+ // QuittierungsbelegGedrucktAm = qbChanges.GedrucktAm,
+ // QuittierungsbelegGedrucktVon = qbChanges.QuittierungsbelegGedrucktVonOid,
- Monat = qbChanges.Monat
- };
+ // Monat = qbChanges.Monat
+ // };
- if ((bool)e.NewValue == true)
- {
- qbCheck.QuittierungsbelegUnterschriebenVon = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
- qbCheck.QuittierungsbelegUnterschrieben = true;
- }
- else
- {
- qbCheck.QuittierungsbelegUnterschriebenVon = null;
- qbCheck.QuittierungsbelegUnterschrieben = false;
- }
+ // if ((bool)e.NewValue == true)
+ // {
+ // qbCheck.QuittierungsbelegUnterschriebenVon = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
+ // qbCheck.QuittierungsbelegUnterschrieben = true;
+ // }
+ // else
+ // {
+ // qbCheck.QuittierungsbelegUnterschriebenVon = null;
+ // qbCheck.QuittierungsbelegUnterschrieben = false;
+ // }
- if (qbChanges.QuittierungsCheckOid.HasValue)
- {
- qbCheck.QuittierungsCheckOid = qbChanges.QuittierungsCheckOid;
- ServiceFacade.DoCustomerServiceSync(r => r.UpdateNewQuittierungsCheck(qbCheck));
- }
- else
- {
- ServiceFacade.DoCustomerServiceSync(r => r.SaveNewQuittierungsCheck(qbCheck));
- }
+ // if (qbChanges.QuittierungsCheckOid.HasValue)
+ // {
+ // qbCheck.QuittierungsCheckOid = qbChanges.QuittierungsCheckOid;
+ // ServiceFacade.DoCustomerServiceSync(r => r.UpdateNewQuittierungsCheck(qbCheck));
+ // }
+ // else
+ // {
+ // ServiceFacade.DoCustomerServiceSync(r => r.SaveNewQuittierungsCheck(qbCheck));
+ // }
- GetQuittierungsCheckCustomerList(Dicdate[(string)MonthCombobox.SelectedItem]);
- }
+ // GetQuittierungsCheckCustomerList(Dicdate[(string)MonthCombobox.SelectedItem]);
+ //}
- private void SetMonthCombobox()
- {
- List monate = new List();
+ //private void SetMonthCombobox()
+ //{
+ // List monate = new List();
- monate.Add(Monat.Januar.ToString());
- monate.Add(Monat.Februar.ToString());
- monate.Add(Monat.März.ToString());
- monate.Add(Monat.April.ToString());
- monate.Add(Monat.Mai.ToString());
- monate.Add(Monat.Juni.ToString());
- monate.Add(Monat.Juli.ToString());
- monate.Add(Monat.August.ToString());
- monate.Add(Monat.September.ToString());
- monate.Add(Monat.Oktober.ToString());
- monate.Add(Monat.November.ToString());
- monate.Add(Monat.Dezember.ToString());
+ // monate.Add(Monat.Januar.ToString());
+ // monate.Add(Monat.Februar.ToString());
+ // monate.Add(Monat.März.ToString());
+ // monate.Add(Monat.April.ToString());
+ // monate.Add(Monat.Mai.ToString());
+ // monate.Add(Monat.Juni.ToString());
+ // monate.Add(Monat.Juli.ToString());
+ // monate.Add(Monat.August.ToString());
+ // monate.Add(Monat.September.ToString());
+ // monate.Add(Monat.Oktober.ToString());
+ // monate.Add(Monat.November.ToString());
+ // monate.Add(Monat.Dezember.ToString());
- MonthCombobox.ItemsSource = monate;
+ // MonthCombobox.ItemsSource = monate;
- var dateTime = DateTime.Now;
+ // var dateTime = DateTime.Now;
- var editValue = "default";
+ // var editValue = "default";
- int i = 1;
- foreach (var mon in monate)
- {
- var x = new DateTime(dateTime.Year,i,1);
- Dicdate.Add(mon,x);
+ // int i = 1;
+ // foreach (var mon in monate)
+ // {
+ // var x = new DateTime(dateTime.Year,i,1);
+ // Dicdate.Add(mon,x);
- i++;
- }
+ // i++;
+ // }
- foreach (var key in Dicdate)
- {
- if (key.Value.Month == DateTime.Now.Month)
- {
- editValue = key.Key;
- }
- }
+ // foreach (var key in Dicdate)
+ // {
+ // if (key.Value.Month == DateTime.Now.Month)
+ // {
+ // editValue = key.Key;
+ // }
+ // }
- MonthCombobox.EditValue = editValue;
- }
+ // MonthCombobox.EditValue = editValue;
+ //}
- private void SetYearCombobox()
- {
- List year = new List();
+ //private void SetYearCombobox()
+ //{
+ // List year = new List();
- year.Add(DateTime.Now.AddYears(-5).Year.ToString());
- year.Add(DateTime.Now.AddYears(-4).Year.ToString());
- year.Add(DateTime.Now.AddYears(-3).Year.ToString());
- year.Add(DateTime.Now.AddYears(-2).Year.ToString());
- year.Add(DateTime.Now.AddYears(-1).Year.ToString());
- year.Add(DateTime.Now.Year.ToString());
+ // year.Add(DateTime.Now.AddYears(-5).Year.ToString());
+ // year.Add(DateTime.Now.AddYears(-4).Year.ToString());
+ // year.Add(DateTime.Now.AddYears(-3).Year.ToString());
+ // year.Add(DateTime.Now.AddYears(-2).Year.ToString());
+ // year.Add(DateTime.Now.AddYears(-1).Year.ToString());
+ // year.Add(DateTime.Now.Year.ToString());
- YearCombobox.ItemsSource = year;
+ // YearCombobox.ItemsSource = year;
- YearCombobox.EditValue = DateTime.Now.Year.ToString();
+ // YearCombobox.EditValue = DateTime.Now.Year.ToString();
- DictYear.Add(DateTime.Now.AddYears(-5).Year.ToString(), DateTime.Now.AddYears(-5));
- DictYear.Add(DateTime.Now.AddYears(-4).Year.ToString(), DateTime.Now.AddYears(-4));
- DictYear.Add(DateTime.Now.AddYears(-3).Year.ToString(), DateTime.Now.AddYears(-3));
- DictYear.Add(DateTime.Now.AddYears(-2).Year.ToString(), DateTime.Now.AddYears(-2));
- DictYear.Add(DateTime.Now.AddYears(-1).Year.ToString(), DateTime.Now.AddYears(-1));
- DictYear.Add(DateTime.Now.Year.ToString(), DateTime.Now);
+ // DictYear.Add(DateTime.Now.AddYears(-5).Year.ToString(), DateTime.Now.AddYears(-5));
+ // DictYear.Add(DateTime.Now.AddYears(-4).Year.ToString(), DateTime.Now.AddYears(-4));
+ // DictYear.Add(DateTime.Now.AddYears(-3).Year.ToString(), DateTime.Now.AddYears(-3));
+ // DictYear.Add(DateTime.Now.AddYears(-2).Year.ToString(), DateTime.Now.AddYears(-2));
+ // DictYear.Add(DateTime.Now.AddYears(-1).Year.ToString(), DateTime.Now.AddYears(-1));
+ // DictYear.Add(DateTime.Now.Year.ToString(), DateTime.Now);
- }
+ //}
- private void MonthCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
- {
- var monat = (string)e.NewValue;
+ //private void MonthCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
+ //{
+ // var monat = (string)e.NewValue;
- var year = (string) YearCombobox.SelectedItem;
+ // var year = (string) YearCombobox.SelectedItem;
- if (year == null)
- {
- year = DateTime.Now.Year.ToString();
- }
+ // if (year == null)
+ // {
+ // year = DateTime.Now.Year.ToString();
+ // }
- if (Dicdate.ContainsKey(monat))
- {
- if (DictYear.ContainsKey(year))
- {
- DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[monat].Date.Month, 1);
+ // if (Dicdate.ContainsKey(monat))
+ // {
+ // if (DictYear.ContainsKey(year))
+ // {
+ // DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[monat].Date.Month, 1);
- GetQuittierungsCheckCustomerList(newDate);
- }
- }
- }
+ // GetQuittierungsCheckCustomerList(newDate);
+ // }
+ // }
+ //}
- private void YearCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
- {
- var year = (string)e.NewValue;
+ //private void YearCombobox_OnEditValueChanged(object sender, EditValueChangedEventArgs e)
+ //{
+ // var year = (string)e.NewValue;
- var month = (string) MonthCombobox.SelectedItem;
+ // var month = (string) MonthCombobox.SelectedItem;
- if (DictYear.ContainsKey(year))
- {
- if (Dicdate.ContainsKey(month))
- {
- DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[month].Date.Month, 1);
+ // if (DictYear.ContainsKey(year))
+ // {
+ // if (Dicdate.ContainsKey(month))
+ // {
+ // DateTime newDate = new DateTime(DictYear[year].Date.Year, Dicdate[month].Date.Month, 1);
- GetQuittierungsCheckCustomerList(newDate);
- }
- }
- }
+ // GetQuittierungsCheckCustomerList(newDate);
+ // }
+ // }
+ //}
}
- public class QuittierungsCheckView
- {
- public string Klient { get; set; }
+ //public class QuittierungsCheckView
+ //{
+ // public string Klient { get; set; }
- public bool QuittierungsbelegGedruckt { get; set; }
- public string QuittierungsbelegGedrucktAm { get; set; }
- public string QuittierungsbelegGedrucktVon { get; set; }
+ // public bool QuittierungsbelegGedruckt { get; set; }
+ // public string QuittierungsbelegGedrucktAm { get; set; }
+ // public string QuittierungsbelegGedrucktVon { get; set; }
- public bool QuittierungsbelegUnterschrieben { get; set; }
- public string QuittierungsbelegUnterschriebenVon { get; set; }
+ // public bool QuittierungsbelegUnterschrieben { get; set; }
+ // public string QuittierungsbelegUnterschriebenVon { get; set; }
- public long? QuittierungsCheckOid { get; set; }
- public long? QuittierungsbelegUnterschriebenVonOid { get; set; }
- public long? QuittierungsbelegGedrucktVonOid { get; set; }
+ // public long? QuittierungsCheckOid { get; set; }
+ // public long? QuittierungsbelegUnterschriebenVonOid { get; set; }
+ // public long? QuittierungsbelegGedrucktVonOid { get; set; }
- public bool IsQbUnterschriebenAvailable { get; set; }
+ // public bool IsQbUnterschriebenAvailable { get; set; }
- public CompactCustomerDC CompactCustomer { get; set; }
+ // public CompactCustomerDC CompactCustomer { get; set; }
- public DateTime Monat { get; set; }
- public DateTime? GedrucktAm { get; set; }
- }
+ // public DateTime Monat { get; set; }
+ // public DateTime? GedrucktAm { get; set; }
+ //}
}
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/SettlementView.xaml b/BeWo/View/Detail/Report/SettlementView.xaml
index c9532b280..6b11278b5 100644
--- a/BeWo/View/Detail/Report/SettlementView.xaml
+++ b/BeWo/View/Detail/Report/SettlementView.xaml
@@ -22,7 +22,7 @@
-
+
diff --git a/BeWo/View/Detail/ServiceRecordEditView.xaml b/BeWo/View/Detail/ServiceRecordEditView.xaml
index ac0366624..0cbc0b174 100644
--- a/BeWo/View/Detail/ServiceRecordEditView.xaml
+++ b/BeWo/View/Detail/ServiceRecordEditView.xaml
@@ -13,6 +13,7 @@
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
+
@@ -302,8 +303,541 @@
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -352,33 +864,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -390,33 +877,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -428,33 +890,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -466,36 +903,12 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/BeWo/View/Detail/ServiceRecordEditView.xaml.cs b/BeWo/View/Detail/ServiceRecordEditView.xaml.cs
index 808ad862f..deab1b672 100644
--- a/BeWo/View/Detail/ServiceRecordEditView.xaml.cs
+++ b/BeWo/View/Detail/ServiceRecordEditView.xaml.cs
@@ -20,6 +20,7 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
+using DevExpress.Xpf.RichEdit;
namespace BeWo.View.Detail
{
@@ -35,6 +36,7 @@ namespace BeWo.View.Detail
private CompactEmployeeDC _SelectedEmployee;
+
private bool _HideCustomers;
public ServiceRecordEditView()
@@ -168,10 +170,11 @@ namespace BeWo.View.Detail
Loaded += ServiceRecordEditView_Loaded;
- if(BeWoApp.AppSettings.ShowRtfTextfeld)
+ if(BeWoApp.AppSettings.ShowRtfTextfield)
{
+
ConfigureRTFDocTypes();
- LoadNoticeInRTFTxte();
+ //LoadNoticeInRTFTxte();
}
else{
ConfigureDocTypes();
@@ -389,10 +392,10 @@ namespace BeWo.View.Detail
// _ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration.Value;
// }
- if (BeWoApp.AppSettings.ShowRtfTextfeld)
- {
- SetRTFDaten();
- }
+ //if (BeWoApp.AppSettings.ShowRtfTextfield)
+ //{
+ // SetRTFDaten();
+ //}
_ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration.Value;
if (_SelectedEmployee != null)
@@ -417,51 +420,7 @@ namespace BeWo.View.Detail
}
}
-
- private void SetRTFDaten()
- {
-
- if (richEditControl1.Text != "")
- {
- _ServiceRecordVM.Notice = richEditControl1.Text;
- _ServiceRecordVM.RTFNotice = richEditControl1.RtfText;
- }
- if (richEditControl2.Text != "")
- {
- _ServiceRecordVM.Notice2 = richEditControl2.Text;
- _ServiceRecordVM.RTFNotice2 = richEditControl2.RtfText;
- }
- if (richEditControl3.Text != "")
- {
- _ServiceRecordVM.Notice3 = richEditControl3.Text;
- _ServiceRecordVM.RTFNotice3 = richEditControl3.RtfText;
- }
- if (richEditControl4.Text != "")
- {
- _ServiceRecordVM.Notice4 = richEditControl4.Text;
- _ServiceRecordVM.RTFNotice4 = richEditControl4.RtfText;
- }
- if (richEditControl5.Text != "")
- {
- _ServiceRecordVM.Notice5 = richEditControl5.Text;
- _ServiceRecordVM.RTFNotice5 = richEditControl5.RtfText;
- }
- }
-
- private void LoadNoticeInRTFTxte()
- {
- richEditControl1.Text = _ServiceRecordVM.Notice;
- richEditControl2.Text = _ServiceRecordVM.Notice2;
- richEditControl3.Text = _ServiceRecordVM.Notice3;
- richEditControl4.Text = _ServiceRecordVM.Notice4;
- richEditControl5.Text = _ServiceRecordVM.Notice5;
-
- richEditControl1.RtfText = _ServiceRecordVM.RTFNotice;
- richEditControl2.RtfText = _ServiceRecordVM.RTFNotice2;
- richEditControl3.RtfText = _ServiceRecordVM.RTFNotice3;
- richEditControl4.RtfText = _ServiceRecordVM.RTFNotice4;
- richEditControl5.RtfText = _ServiceRecordVM.RTFNotice5;
- }
+
private void EmployeeSearchView_CustomerSelected(object sender, EventArgs e)
{
@@ -612,6 +571,9 @@ namespace BeWo.View.Detail
private void ConfigureDocTypes()
{
//Tabs und Tabelle
+ barManager.Visibility = Visibility.Collapsed;
+ TabBorder.Background = null;
+
int i = ViewModel.AllDocTypes.Count;
if (i == 0)
@@ -718,5 +680,145 @@ namespace BeWo.View.Detail
numeric_duration.Mask = "########0.00";
}
}
+
+ private void tabitem_RtfDokuSelected(object sender, RoutedEventArgs e)
+ {
+ RemoveBarManagerRef();
+ InitRichTextEdit(sender as TabItem);
+
+ }
+
+ private void InitRichTextEdit(TabItem tabItem)
+ {
+ RichEditControl re = null;
+ if (tabItem.Content == null)
+ {
+
+ var dp = new System.Windows.Controls.DockPanel();
+
+ re = new RichEditControl();
+
+ re.CommandBarStyle = CommandBarStyle.Empty;
+ re.HorizontalAlignment = HorizontalAlignment.Stretch;
+ re.VerticalAlignment = VerticalAlignment.Stretch;
+ re.Margin = new Thickness(0);
+
+ if (tabItem.Name == TabitemRtf1Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice, _ServiceRecordVM.RTFNotice);
+ }
+ else if (tabItem.Name == TabitemRtf2Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice2, _ServiceRecordVM.RTFNotice2);
+ }
+ else if (tabItem.Name == TabitemRtf3Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice3, _ServiceRecordVM.RTFNotice3);
+ }
+ else if (tabItem.Name == TabitemRtf4Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice4, _ServiceRecordVM.RTFNotice4);
+ }
+ else if (tabItem.Name == TabitemRtf5Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice5, _ServiceRecordVM.RTFNotice5);
+ }
+ dp.Children.Add(re);
+ tabItem.Content = dp;
+
+ }
+ else
+ {
+ re = GetRichEditFromTabItem(tabItem);
+
+ }
+ re.BarManager = barManager;
+ re.ContentChanged += RichEdit_ContentChanged;
+
+ FontSizeComboBox.OfficeFontSizeProvider = re;
+ RichEditStyleComboBox.RichEditControl = re;
+ biPageLayoutSizeList.RichEditControl = re;
+ biMailMergeInsertFieldPlaceholder.RichEditControl = re;
+ biReviewReviewers.RichEditControl = re;
+ }
+
+ private void RichEdit_ContentChanged(object sender, EventArgs e)
+ {
+ RichEditControl rec = sender as RichEditControl;
+ if (rec != null)
+ {
+ if (TabitemRtf1Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice = rec.Text;
+ _ServiceRecordVM.RTFNotice = rec.RtfText;
+ }
+ else if (TabitemRtf2Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice2 = rec.Text;
+ _ServiceRecordVM.RTFNotice2 = rec.RtfText;
+ }
+ else if (TabitemRtf3Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice3 = rec.Text;
+ _ServiceRecordVM.RTFNotice3 = rec.RtfText;
+ }
+ else if (TabitemRtf4Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice4 = rec.Text;
+ _ServiceRecordVM.RTFNotice4 = rec.RtfText;
+ }
+ else if (TabitemRtf5Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice5 = rec.Text;
+ _ServiceRecordVM.RTFNotice5 = rec.RtfText;
+ }
+ }
+ }
+
+ private void InitTextForRichText(RichEditControl re, string notice, string rtfNotice)
+ {
+ if (!String.IsNullOrWhiteSpace(rtfNotice))
+ {
+ re.RtfText = rtfNotice;
+ }
+ else if (!String.IsNullOrWhiteSpace(notice))
+ {
+ re.Text = notice;
+ }
+ }
+
+ private void RemoveBarManagerRef()
+ {
+ RemoveBarManagerFromTabItem(TabitemRtf1Note);
+ RemoveBarManagerFromTabItem(TabitemRtf2Note);
+ RemoveBarManagerFromTabItem(TabitemRtf3Note);
+ RemoveBarManagerFromTabItem(TabitemRtf4Note);
+ RemoveBarManagerFromTabItem(TabitemRtf5Note);
+ }
+
+ private void RemoveBarManagerFromTabItem(TabItem tabitem)
+ {
+ RichEditControl rec = GetRichEditFromTabItem(tabitem);
+
+ if (rec != null)
+ {
+ rec.ContentChanged -= RichEdit_ContentChanged;
+ rec.BarManager = null;
+ }
+
+ }
+
+ private RichEditControl GetRichEditFromTabItem(TabItem tabitemRtf1Note)
+ {
+ if (tabitemRtf1Note.Content != null)
+ {
+ var dp = tabitemRtf1Note.Content as System.Windows.Controls.DockPanel;
+ if (dp != null && dp.Children.Count > 0)
+ {
+ return dp.Children[0] as RichEditControl;
+ }
+ }
+ return null;
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Detail/ServiceRecordGroupEditView.xaml b/BeWo/View/Detail/ServiceRecordGroupEditView.xaml
index 1dbb11676..6428a13be 100644
--- a/BeWo/View/Detail/ServiceRecordGroupEditView.xaml
+++ b/BeWo/View/Detail/ServiceRecordGroupEditView.xaml
@@ -294,9 +294,541 @@
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -345,33 +852,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -383,33 +865,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -421,33 +878,8 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -459,38 +891,13 @@
AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
diff --git a/BeWo/View/Detail/ServiceRecordGroupEditView.xaml.cs b/BeWo/View/Detail/ServiceRecordGroupEditView.xaml.cs
index 89cf2d1b8..a97d1172a 100644
--- a/BeWo/View/Detail/ServiceRecordGroupEditView.xaml.cs
+++ b/BeWo/View/Detail/ServiceRecordGroupEditView.xaml.cs
@@ -16,6 +16,7 @@ using BS.Shared.Services;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Translation;
+using DevExpress.Xpf.RichEdit;
namespace BeWo.View.Detail
{
@@ -136,10 +137,9 @@ namespace BeWo.View.Detail
_ServiceRecordVM.SetDirty(false);
- if (BeWoApp.AppSettings.ShowRtfTextfeld)
+ if (BeWoApp.AppSettings.ShowRtfTextfield)
{
ConfigureRTFDocTypes();
- LoadNoticeInRTFTxte();
}
else
{
@@ -163,21 +163,7 @@ namespace BeWo.View.Detail
}
}
-
- private void LoadNoticeInRTFTxte()
- {
- richEditControl1.Text = _ServiceRecordVM.Notice;
- richEditControl2.Text = _ServiceRecordVM.Notice2;
- richEditControl3.Text = _ServiceRecordVM.Notice3;
- richEditControl4.Text = _ServiceRecordVM.Notice4;
- richEditControl5.Text = _ServiceRecordVM.Notice5;
-
- richEditControl1.RtfText = _ServiceRecordVM.RTFNotice;
- richEditControl2.RtfText = _ServiceRecordVM.RTFNotice2;
- richEditControl3.RtfText = _ServiceRecordVM.RTFNotice3;
- richEditControl4.RtfText = _ServiceRecordVM.RTFNotice4;
- richEditControl5.RtfText = _ServiceRecordVM.RTFNotice5;
- }
+
public bool IsCustomerChangeAllowed()
{
@@ -327,47 +313,13 @@ namespace BeWo.View.Detail
return ServiceRecordDialogResult.ClosedWithoutSaving;
}
-
- private void SetRTFDaten()
- {
-
- if (richEditControl1.Text != "")
- {
- _ServiceRecordVM.Notice = richEditControl1.Text;
- _ServiceRecordVM.RTFNotice = richEditControl1.RtfText;
- }
- if (richEditControl2.Text != "")
- {
- _ServiceRecordVM.Notice2 = richEditControl2.Text;
- _ServiceRecordVM.RTFNotice2 = richEditControl2.RtfText;
- }
- if (richEditControl3.Text != "")
- {
- _ServiceRecordVM.Notice3 = richEditControl3.Text;
- _ServiceRecordVM.RTFNotice3 = richEditControl3.RtfText;
- }
- if (richEditControl4.Text != "")
- {
- _ServiceRecordVM.Notice4 = richEditControl4.Text;
- _ServiceRecordVM.RTFNotice4 = richEditControl4.RtfText;
- }
- if (richEditControl5.Text != "")
- {
- _ServiceRecordVM.Notice5 = richEditControl5.Text;
- _ServiceRecordVM.RTFNotice5 = richEditControl5.RtfText;
- }
- }
+
protected override void Save()
{
if (!IsDirty)
return;
-
- if (BeWoApp.AppSettings.ShowRtfTextfeld)
- {
- SetRTFDaten();
- }
-
+
UpdateServiceRecordGroup();
@@ -818,6 +770,8 @@ namespace BeWo.View.Detail
private void ConfigureDocTypes()
{
+ barManager.Visibility = Visibility.Collapsed;
+ TabBorder.Background = null;
//Tabs und Tabelle
int i = ViewModel.AllDocTypes.Count;
@@ -984,5 +938,145 @@ namespace BeWo.View.Detail
numerictb_duration.Mask = "########0.00";
}
}
+
+ private void tabitem_RtfDokuSelected(object sender, RoutedEventArgs e)
+ {
+ RemoveBarManagerRef();
+ InitRichTextEdit(sender as TabItem);
+
+ }
+
+ private void InitRichTextEdit(TabItem tabItem)
+ {
+ RichEditControl re = null;
+ if (tabItem.Content == null)
+ {
+
+ var dp = new System.Windows.Controls.DockPanel();
+
+ re = new RichEditControl();
+
+ re.CommandBarStyle = CommandBarStyle.Empty;
+ re.HorizontalAlignment = HorizontalAlignment.Stretch;
+ re.VerticalAlignment = VerticalAlignment.Stretch;
+ re.Margin = new Thickness(0);
+
+ if (tabItem.Name == TabitemRtf1Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice, _ServiceRecordVM.RTFNotice);
+ }
+ else if (tabItem.Name == TabitemRtf2Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice2, _ServiceRecordVM.RTFNotice2);
+ }
+ else if (tabItem.Name == TabitemRtf3Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice3, _ServiceRecordVM.RTFNotice3);
+ }
+ else if (tabItem.Name == TabitemRtf4Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice4, _ServiceRecordVM.RTFNotice4);
+ }
+ else if (tabItem.Name == TabitemRtf5Note.Name)
+ {
+ InitTextForRichText(re, _ServiceRecordVM.Notice5, _ServiceRecordVM.RTFNotice5);
+ }
+ dp.Children.Add(re);
+ tabItem.Content = dp;
+
+ }
+ else
+ {
+ re = GetRichEditFromTabItem(tabItem);
+
+ }
+ re.BarManager = barManager;
+ re.ContentChanged += RichEdit_ContentChanged;
+
+ FontSizeComboBox.OfficeFontSizeProvider = re;
+ RichEditStyleComboBox.RichEditControl = re;
+ biPageLayoutSizeList.RichEditControl = re;
+ biMailMergeInsertFieldPlaceholder.RichEditControl = re;
+ biReviewReviewers.RichEditControl = re;
+ }
+
+ private void RichEdit_ContentChanged(object sender, EventArgs e)
+ {
+ RichEditControl rec = sender as RichEditControl;
+ if (rec != null)
+ {
+ if (TabitemRtf1Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice = rec.Text;
+ _ServiceRecordVM.RTFNotice = rec.RtfText;
+ }
+ else if (TabitemRtf2Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice2 = rec.Text;
+ _ServiceRecordVM.RTFNotice2 = rec.RtfText;
+ }
+ else if (TabitemRtf3Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice3 = rec.Text;
+ _ServiceRecordVM.RTFNotice3 = rec.RtfText;
+ }
+ else if (TabitemRtf4Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice4 = rec.Text;
+ _ServiceRecordVM.RTFNotice4 = rec.RtfText;
+ }
+ else if (TabitemRtf5Note.IsSelected)
+ {
+ _ServiceRecordVM.Notice5 = rec.Text;
+ _ServiceRecordVM.RTFNotice5 = rec.RtfText;
+ }
+ }
+ }
+
+ private void InitTextForRichText(RichEditControl re, string notice, string rtfNotice)
+ {
+ if (!String.IsNullOrWhiteSpace(rtfNotice))
+ {
+ re.RtfText = rtfNotice;
+ }
+ else if (!String.IsNullOrWhiteSpace(notice))
+ {
+ re.Text = notice;
+ }
+ }
+
+ private void RemoveBarManagerRef()
+ {
+ RemoveBarManagerFromTabItem(TabitemRtf1Note);
+ RemoveBarManagerFromTabItem(TabitemRtf2Note);
+ RemoveBarManagerFromTabItem(TabitemRtf3Note);
+ RemoveBarManagerFromTabItem(TabitemRtf4Note);
+ RemoveBarManagerFromTabItem(TabitemRtf5Note);
+ }
+
+ private void RemoveBarManagerFromTabItem(TabItem tabitem)
+ {
+ RichEditControl rec = GetRichEditFromTabItem(tabitem);
+
+ if (rec != null)
+ {
+ rec.ContentChanged -= RichEdit_ContentChanged;
+ rec.BarManager = null;
+ }
+
+ }
+
+ private RichEditControl GetRichEditFromTabItem(TabItem tabitemRtf1Note)
+ {
+ if (tabitemRtf1Note.Content != null)
+ {
+ var dp = tabitemRtf1Note.Content as System.Windows.Controls.DockPanel;
+ if (dp != null && dp.Children.Count > 0)
+ {
+ return dp.Children[0] as RichEditControl;
+ }
+ }
+ return null;
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml b/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml
index 44468f58c..12850e0cb 100644
--- a/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml
+++ b/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml
@@ -9,58 +9,572 @@
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:search="clr-namespace:BeWo.View.Search"
+ xmlns:controls="clr-namespace:BeWo.View.Controls"
mc:Ignorable="d"
- Height="900" Width="900" x:Name="RtfWindow" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" >
-
-
-
-
-
-
-
-
-
-
-
-
+ WindowStyle="None"
+ AllowsTransparency="True"
+ Background="Transparent"
+ MinHeight="400" MinWidth="400" x:Name="RtfWindow" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" >
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml.cs b/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml.cs
index 87a34b2ef..0c0923e78 100644
--- a/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml.cs
+++ b/BeWo/View/Detail/ServiceRecordRTFWindowView.xaml.cs
@@ -1,10 +1,11 @@
using System;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using BeWo.ViewModel;
-
+using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
@@ -19,14 +20,21 @@ namespace BeWo.View.Detail
{
InitializeComponent();
- RtfWindow.Title = titel;
+ this.Title = titel;
+ rootGroupBox.Header = titel;
richEditControl.Text = text;
richEditControl.RtfText = rtfText;
- Width = SystemParameters.PrimaryScreenWidth / 2;
- Height = SystemParameters.PrimaryScreenWidth / 2;
+ //Width = SystemParameters.PrimaryScreenWidth / 2;
+ //Height = SystemParameters.PrimaryScreenWidth / 2;
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneAnsehen))
+ {
+ TextbausteineButton.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControl.Visibility = Visibility.Collapsed;
+ }
+
AddClose();
}
@@ -41,70 +49,79 @@ namespace BeWo.View.Detail
Close();
}
+ private void TextModuleTreeViewControl_OnTextModuleSelected(object sender, EventArgs e)
+ {
+ var textToAdd = e.Data.Text;
+
+ if (!String.IsNullOrWhiteSpace(textToAdd))
+ {
+ var oldPos = richEditControl.Document.CaretPosition.ToInt();
+
+ var pos = richEditControl.Document.CaretPosition;
+ var doc = pos.BeginUpdateDocument();
+ doc.InsertText(pos, textToAdd);
+ richEditControl.Document.CaretPosition =
+ richEditControl.Document.CreatePosition(oldPos + textToAdd.Length);
+
+ pos.EndUpdateDocument(doc);
+ richEditControl.Focus();
+ }
+ }
+
+ private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ try
+ {
+ DragMove();
+ }
+ catch (Exception) { }
+ }
+
+ private void RootGroupBox_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
+ {
+ var pos = PointToScreen(Mouse.GetPosition(this));
+
+ if (!(e.OriginalSource is Border) && !(e.OriginalSource is TextBlock) || pos.Y > 200d || e.OriginalSource is TextBlock && Mouse.DirectlyOver is Button)
+ {
+ return;
+ }
+
+ if (WindowState == WindowState.Maximized)
+ {
+ WindowState = WindowState.Normal;
+ return;
+ }
+
+ if (WindowState == WindowState.Normal)
+ {
+ WindowState = WindowState.Maximized;
+ }
+ }
+
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
popup_textbausteine.IsOpen = true;
}
private void TextbausteineSearchView_OnItemSelected(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(richEditControl.Text))
- {
- richEditControl.Text = e.Data.Text;
- richEditControl.Document.CaretPosition = richEditControl.Document.Range.End;
- }
- else
- {
- if (richEditControl.Document.CaretPosition.ToInt() == 0)
- {
- richEditControl.Text = e.Data.Text + richEditControl.Text;
- }
- else if (richEditControl.Document.CaretPosition == richEditControl.Document.Range.End)
- {
- richEditControl.Text = richEditControl.Text + e.Data.Text;
- }
- else
- {
- var anzahlLeerzeichen = richEditControl.Document.CaretPosition.ToInt() - richEditControl.Text.Length;
-
- var leerzeichen = String.Empty;
- for (var i = 0; i < anzahlLeerzeichen; i++)
- {
- leerzeichen += " ";
- }
-
- var start = richEditControl.Text.Substring(0, (richEditControl.Document.CaretPosition.ToInt() - anzahlLeerzeichen));
- var ende = richEditControl.Text.Substring((richEditControl.Document.CaretPosition.ToInt() - anzahlLeerzeichen));
-
- richEditControl.Text = start + leerzeichen + e.Data.Text + ende;
- }
-
- richEditControl.Document.CaretPosition = richEditControl.Document.Range.End;
-
- popup_textbausteine.IsOpen = false;
- }
- }
-
- private void EditTextbausteineClick(object sender, RoutedEventArgs e)
{
- VMFactory.CreateTextModuleListVMAsync(
- textModules => this.Dispatch(delegate
- {
- var tbv = new TextModuleView(textModules) { Background = FindResource("ApplicationBackground") as LinearGradientBrush };
+ var textToAdd = e.Data.Text;
- var window = new BeWoWindow(tbv) { rootGroupBox = { Header = "Textbausteine" }, Width = 850, MinWidth = 850 };
+ if (!String.IsNullOrWhiteSpace(textToAdd))
+ {
+ var oldPos = richEditControl.Document.CaretPosition.ToInt();
- tbv.CancelButton.Click += (o, args) =>
- {
- tbv.Focus();
- tbv.DoSaveCheck();
+ var pos = richEditControl.Document.CaretPosition;
+ var doc = pos.BeginUpdateDocument();
+ doc.InsertText(pos, textToAdd);
+ richEditControl.Document.CaretPosition =
+ richEditControl.Document.CreatePosition(oldPos + textToAdd.Length);
- window.Close();
- };
-
- window.Show();
- }), false, true);
- }
+ pos.EndUpdateDocument(doc);
+ richEditControl.Focus();
+ }
+ popup_textbausteine.IsOpen = false;
+ }
}
public class CustomRTFWindowArgs : EventArgs
diff --git a/BeWo/View/Detail/ServiceRecordView2.xaml b/BeWo/View/Detail/ServiceRecordView2.xaml
index 16491ca94..43fee6013 100644
--- a/BeWo/View/Detail/ServiceRecordView2.xaml
+++ b/BeWo/View/Detail/ServiceRecordView2.xaml
@@ -849,8 +849,10 @@
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -927,8 +911,9 @@
-
-
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -1006,8 +973,9 @@
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -1086,8 +1035,9 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1165,8 +1096,9 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1670,7 +1583,7 @@
-
+
@@ -1731,10 +1644,13 @@
+
+
+
-
diff --git a/BeWo/View/Detail/ServiceRecordView2.xaml.cs b/BeWo/View/Detail/ServiceRecordView2.xaml.cs
index c6d7217cd..2dea3bfeb 100644
--- a/BeWo/View/Detail/ServiceRecordView2.xaml.cs
+++ b/BeWo/View/Detail/ServiceRecordView2.xaml.cs
@@ -52,7 +52,9 @@ namespace BeWo.View.Detail
{
get
{
- return BeWoApp.AppSettings.HideServiceRecordInsertedByAndInsertedOn ? Visibility.Collapsed : Visibility.Visible;
+ return BeWoApp.AppSettings.HideServiceRecordInsertedByAndInsertedOn
+ ? Visibility.Collapsed
+ : Visibility.Visible;
}
}
@@ -72,21 +74,19 @@ namespace BeWo.View.Detail
private AssessmentSheetEntryView assessmentSheet;
- private ServiceRecordVM lastSelectedVM;
+ private ServiceRecordVM lastSelectedVM;
- private readonly Dictionary> customerContainsAssessmentCategories = new Dictionary>();
+ private readonly Dictionary>
+ customerContainsAssessmentCategories = new Dictionary>();
private bool _IgnoreGroupMultiCheck;
private int lastPosition;
public static double DocumentationTextBoxFontSize
- {
- get
- {
- return BeWoApp.AppSettings.DocumentationFontSize;
- }
- }
+ {
+ get { return BeWoApp.AppSettings.DocumentationFontSize; }
+ }
public ServiceRecordView2(ServiceRecordListVM pViewModel, long? startSupportConceptOid)
{
@@ -102,7 +102,7 @@ namespace BeWo.View.Detail
_StartSupportConceptOid = startSupportConceptOid;
ViewModel = pViewModel;
-
+
//serviceRecordListContent.
// CheckMinStdSwitch.SelectedIndex = 0;
@@ -115,7 +115,7 @@ namespace BeWo.View.Detail
//}
if (ViewModel.ServiceRecordTimeInterval == ServiceRecordTimeInterval.XTage)
{
- NDays.Visibility = Visibility.Visible;
+ NDays.Visibility = Visibility.Visible;
}
else if (ViewModel.ServiceRecordTimeInterval == ServiceRecordTimeInterval.ZeitraumWaehlen)
{
@@ -132,7 +132,8 @@ namespace BeWo.View.Detail
if (!String.IsNullOrWhiteSpace(BeWoApp.AppSettings.TimeRecordingMenuName))
{
- chkWithClient.Content = BeWoApp.AppSettings.TimeRecordingMenuName + Translator.Translate(" für ausgewählten Klienten");
+ chkWithClient.Content = BeWoApp.AppSettings.TimeRecordingMenuName +
+ Translator.Translate(" für ausgewählten Klienten");
txtTimeRecording.Text = BeWoApp.AppSettings.TimeRecordingMenuName;
}
else
@@ -140,10 +141,11 @@ namespace BeWo.View.Detail
chkWithClient.Content = Translator.Translate("Zeiterfassung für ausgewählten Klienten");
txtTimeRecording.Text = Translator.Translate("Zeiterfassung");
}
- numerictb_distance.Visibility = BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
- lblDistance.Visibility = BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
+ numerictb_distance.Visibility =
+ BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
+ lblDistance.Visibility = BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
- DistanceGridColumn.Visible = BeWoApp.AppSettings.ShowDistanceFields;
+ DistanceGridColumn.Visible = BeWoApp.AppSettings.ShowDistanceFields;
//this.numerictb_duration.TextChanged += (s, e) =>
// {
@@ -154,12 +156,12 @@ namespace BeWo.View.Detail
// };
combobox_services.SelectionChanged += (s, e) =>
+ {
+ if (combobox_services.SelectedIndex == -1)
{
- if (combobox_services.SelectedIndex == -1)
- {
- combobox_services.SelectedIndex = 0;
- }
- };
+ combobox_services.SelectedIndex = 0;
+ }
+ };
//combobox_services_wohnheimbuchung.SelectionChanged += (s, e) =>
//{
@@ -169,7 +171,7 @@ namespace BeWo.View.Detail
// }
//};
- InitDayCheckBoxes();
+ InitDayCheckBoxes();
Loaded += ServiceRecordView2_Loaded;
@@ -181,7 +183,7 @@ namespace BeWo.View.Detail
punktebogenRootGrid.Children.Clear();
punktebogenRootGrid.Children.Add(assessmentSheet);
assessmentSheet.Visibility = Visibility.Collapsed;
- }
+ }
else
{
punktebogenRootGrid.Visibility = Visibility.Collapsed;
@@ -193,86 +195,125 @@ namespace BeWo.View.Detail
//srListBox.Visibility = Visibility.Hidden;
//srGridControl.Visibility = Visibility.Visible;
}
-
+
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees))
{
employeeSearchView.SearchMode = SearchMode.OnlyTeamMember;
}
- if (BeWoApp.AppSettings.ShowMarker)
- {
- chkContentFilter.Content = "Nur Marker anzeigen";
- chkContentFilter.Visibility = Visibility.Visible;
-
- chkServiceRecordTypeContent.Content = "Marker";
- chkServiceRecordTypeContent.Visibility = Visibility.Visible;
-
- }
- else
- {
- if (BeWoApp.Mandator.BeWoClientType == 3)
- {
- //Köln Ring
- chkContentFilter.Visibility = Visibility.Visible;
- chkServiceRecordTypeContent.Visibility = Visibility.Visible;
- }
- else
- {
- chkContentFilter.Visibility = Visibility.Collapsed;
- chkServiceRecordTypeContent.Visibility = Visibility.Collapsed;
- }
- }
-
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
- {
- chkGroupBooking.Visibility = Visibility.Collapsed;
- }
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreatingMultiBooking))
- {
- chkMultiBooking.Visibility = Visibility.Collapsed;
- }
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneAnsehen))
+ if (BeWoApp.AppSettings.ShowMarker)
{
- TextModuleTreeViewControl1.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton1.Visibility = Visibility.Collapsed;
- TextModuleTreeViewControl2.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton2.Visibility = Visibility.Collapsed;
- TextModuleTreeViewControl3.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton3.Visibility = Visibility.Collapsed;
- TextModuleTreeViewControl4.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton4.Visibility = Visibility.Collapsed;
- TextModuleTreeViewControl5.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton5.Visibility = Visibility.Collapsed;
+ chkContentFilter.Content = "Nur Marker anzeigen";
+ chkContentFilter.Visibility = Visibility.Visible;
+
+ chkServiceRecordTypeContent.Content = "Marker";
+ chkServiceRecordTypeContent.Visibility = Visibility.Visible;
+
}
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneBearbeiten))
+ else
+ {
+ if (BeWoApp.Mandator.BeWoClientType == 3)
+ {
+ //Köln Ring
+ chkContentFilter.Visibility = Visibility.Visible;
+ chkServiceRecordTypeContent.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ chkContentFilter.Visibility = Visibility.Collapsed;
+ chkServiceRecordTypeContent.Visibility = Visibility.Collapsed;
+ }
+ }
+
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
+ {
+ chkGroupBooking.Visibility = Visibility.Collapsed;
+ }
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreatingMultiBooking))
+ {
+ chkMultiBooking.Visibility = Visibility.Collapsed;
+ }
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneAnsehen))
+ {
+ TextbausteineButton1.Visibility = Visibility.Collapsed;
+ TextbausteineButtonRtf1.Visibility = Visibility.Collapsed;
+
+ TextbausteineButton2.Visibility = Visibility.Collapsed;
+ TextbausteineButtonRtf2.Visibility = Visibility.Collapsed;
+
+ TextbausteineButton3.Visibility = Visibility.Collapsed;
+ TextbausteineButtonRtf3.Visibility = Visibility.Collapsed;
+
+ TextbausteineButton4.Visibility = Visibility.Collapsed;
+ TextbausteineButtonRtf4.Visibility = Visibility.Collapsed;
+
+ TextbausteineButton5.Visibility = Visibility.Collapsed;
+ TextbausteineButtonRtf5.Visibility = Visibility.Collapsed;
+
+ //TextModuleTreeViewControl1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton1.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControlRtf1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF1.Visibility = Visibility.Collapsed;
+
+ //TextModuleTreeViewControl2.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton2.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControlRtf1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF2.Visibility = Visibility.Collapsed;
+
+ //TextModuleTreeViewControl3.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton3.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControlRtf1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF3.Visibility = Visibility.Collapsed;
+
+ //TextModuleTreeViewControl4.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton4.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControlRtf1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF4.Visibility = Visibility.Collapsed;
+
+ //TextModuleTreeViewControl5.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton5.Visibility = Visibility.Collapsed;
+ //TextModuleTreeViewControlRtf1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF5.Visibility = Visibility.Collapsed;
+ }
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneBearbeiten))
{
TextbausteineBearbeitenButton1.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton2.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton3.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton4.Visibility = Visibility.Collapsed;
- TextbausteineBearbeitenButton5.Visibility = Visibility.Collapsed;
- }
- // gridServiceRecordsSelection.DataSource = pViewModel.VMList;
+ TextbausteineBearbeitenButton2.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton3.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton4.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButton5.Visibility = Visibility.Collapsed;
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecordAllowRebooking))
- {
- Eintragumbuchunsbutton.Visibility = Visibility.Collapsed;
- }
+ TextbausteineBearbeitenButtonRTF1.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF2.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF3.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF4.Visibility = Visibility.Collapsed;
+ TextbausteineBearbeitenButtonRTF5.Visibility = Visibility.Collapsed;
+ }
+ // gridServiceRecordsSelection.DataSource = pViewModel.VMList;
+
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecordAllowRebooking))
+ {
+ Eintragumbuchunsbutton.Visibility = Visibility.Collapsed;
+ }
//ServiceFacade.DoCustomerServiceAsync(s => s.GetAllActiveWohnheimeCompact(), wohnheime => this.Dispatch(() =>
//{
// chkWohnheimBooking.Visibility = wohnheime.Any() ? Visibility.Visible : Visibility.Collapsed;
//}));
- SetStatisticsVisibility();
+ SetStatisticsVisibility();
- if(BeWoApp.AppSettings.ShowRtfTextfeld){
- ConfigureRTFDocTypes();
+ if (BeWoApp.AppSettings.ShowRtfTextfield)
+ {
+ ConfigureRTFDocTypes();
SetRTFFontSizeFromApp();
- }
- else{
+ }
+ else
+ {
ConfigureDocTypes();
- }
+ }
ConfigureEndDate();
@@ -282,21 +323,25 @@ namespace BeWo.View.Detail
//richEdit.VerticalRulerVisibility = Visibility.Collapsed;
//richEdit.ActiveViewType = RichEditViewType.Simple;
-
+
}
private void SetRTFFontSizeFromApp()
{
- var size = BeWoApp.AppSettings.DocumentationFontSize;
- richEditControl1.FontSize = size;
- richEditControl2.FontSize = size;
- richEditControl3.FontSize = size;
- richEditControl4.FontSize = size;
- richEditControl5.FontSize = size;
+ //var size = BeWoApp.AppSettings.DocumentationFontSize;
+ //if (size > 0)
+ //{
+ // richEditControl1.FontSize = size;
+ // richEditControl2.FontSize = size;
+ // richEditControl3.FontSize = size;
+ // richEditControl4.FontSize = size;
+ // richEditControl5.FontSize = size;
+ //}
}
- private void ConfigureEndDate() {
-
+ private void ConfigureEndDate()
+ {
+
var Settings = BeWoApp.AppSettings;
if (Settings.IsOnlyYearMonthVisible)
@@ -307,7 +352,7 @@ namespace BeWo.View.Detail
EndDatumHeader.Visible = false;
- numerictb_distance.SetValue(WidthProperty, (double)105);
+ numerictb_distance.SetValue(WidthProperty, (double) 105);
numerictb_distance.SetValue(HorizontalAlignmentProperty, HorizontalAlignment.Right);
lblDistance.SetValue(HorizontalAlignmentProperty, HorizontalAlignment.Left);
}
@@ -324,7 +369,8 @@ namespace BeWo.View.Detail
MinStdDauerlbl.SetValue(Grid.ColumnProperty, 0);
numeric_duration.SetValue(Grid.ColumnProperty, 1);
- if (MinSTDMitEnd.Text == ZeiterfassungsDauer.Stunden.ToString()) {
+ if (MinSTDMitEnd.Text == ZeiterfassungsDauer.Stunden.ToString())
+ {
numeric_duration.IsFloatValue = true;
numeric_duration.Mask = "########0.00";
}
@@ -337,15 +383,15 @@ namespace BeWo.View.Detail
EndDatumHeader.Visible = true;
- numerictb_distance.SetValue(WidthProperty, (double)47);
+ numerictb_distance.SetValue(WidthProperty, (double) 47);
numerictb_distance.SetValue(HorizontalAlignmentProperty, HorizontalAlignment.Right);
}
else
{
- GridMitEnddatum.Visibility = Visibility.Collapsed;
- GridMitJahrMonat.Visibility = Visibility.Collapsed;
- GridOhneEnddatum.Visibility = Visibility.Visible;
+ GridMitEnddatum.Visibility = Visibility.Collapsed;
+ GridMitJahrMonat.Visibility = Visibility.Collapsed;
+ GridOhneEnddatum.Visibility = Visibility.Visible;
//Collapse Zeit art und ändere namen von Dauer aufs originale zurück.
RoundedDHeader.Header = "Minuten";
@@ -357,7 +403,7 @@ namespace BeWo.View.Detail
}
if (Settings.IsZeiterfassungInStdMin)
{
-
+
MinSTDOhneEnd.Visibility = Visibility.Visible;
MinStdDauerLabel.SetValue(Grid.ColumnProperty, 0);
@@ -382,140 +428,140 @@ namespace BeWo.View.Detail
}
- private void ConfigureRTFDocTypes()
- {
- //hier der Aufruf für die RTF GEdönse
- TabitemRtf1Note.IsSelected = true;
+ private void ConfigureRTFDocTypes()
+ {
+ //hier der Aufruf für die RTF GEdönse
+ TabitemRtf1Note.IsSelected = true;
- TabItem1_Notice.Visibility = Visibility.Collapsed;
- TabItem2_Notice.Visibility = Visibility.Collapsed;
- TabItem3_Notice.Visibility = Visibility.Collapsed;
- TabItem4_Notice.Visibility = Visibility.Collapsed;
- TabItem5_Notice.Visibility = Visibility.Collapsed;
+ TabItem1_Notice.Visibility = Visibility.Collapsed;
+ TabItem2_Notice.Visibility = Visibility.Collapsed;
+ TabItem3_Notice.Visibility = Visibility.Collapsed;
+ TabItem4_Notice.Visibility = Visibility.Collapsed;
+ TabItem5_Notice.Visibility = Visibility.Collapsed;
- TabitemRtf1Note.Visibility = Visibility.Visible;
- TabitemRtf2Note.Visibility = Visibility.Visible;
- TabitemRtf3Note.Visibility = Visibility.Visible;
- TabitemRtf4Note.Visibility = Visibility.Visible;
- TabitemRtf5Note.Visibility = Visibility.Visible;
+ TabitemRtf1Note.Visibility = Visibility.Visible;
+ TabitemRtf2Note.Visibility = Visibility.Visible;
+ TabitemRtf3Note.Visibility = Visibility.Visible;
+ TabitemRtf4Note.Visibility = Visibility.Visible;
+ TabitemRtf5Note.Visibility = Visibility.Visible;
- int i = _ViewModel.AllDocTypes.Count;
- DokumentationLabel.Visibility = Visibility.Collapsed;
-
-
- if (i == 0)
- {
- TabitemRtf1Note.Header = "Dokumentation";
- head_Doku1.Header = "Dokumentation";
- DokumentationLabel.Content = "";
-
- TabitemRtf2Note.Visibility = Visibility.Collapsed;
- TabitemRtf3Note.Visibility = Visibility.Collapsed;
- TabitemRtf4Note.Visibility = Visibility.Collapsed;
- TabitemRtf5Note.Visibility = Visibility.Collapsed;
-
- head_Doku2.Visible = false;
- head_Doku3.Visible = false;
- head_Doku4.Visible = false;
- head_Doku5.Visible = false;
-
- }
- else if (i == 1)
- {
- //DokumentationLabel.Content = "Dokumentation";
- TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
-
- TabitemRtf2Note.Visibility = Visibility.Collapsed;
- TabitemRtf3Note.Visibility = Visibility.Collapsed;
- TabitemRtf4Note.Visibility = Visibility.Collapsed;
- TabitemRtf5Note.Visibility = Visibility.Collapsed;
-
- head_Doku2.Visible = false;
- head_Doku3.Visible = false;
- head_Doku4.Visible = false;
- head_Doku5.Visible = false;
- }
- else if (i == 2)
- {
- DokumentationLabel.Content = "Dokumentation";
- TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
- TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
-
- TabitemRtf3Note.Visibility = Visibility.Collapsed;
- TabitemRtf4Note.Visibility = Visibility.Collapsed;
- TabitemRtf5Note.Visibility = Visibility.Collapsed;
-
- head_Doku3.Visible = false;
- head_Doku4.Visible = false;
- head_Doku5.Visible = false;
- }
- else if (i == 3)
- {
- DokumentationLabel.Content = "Dokumentation";
- TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
- TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
- TabitemRtf2Note.Header = _ViewModel.AllDocTypes[2].ToString();
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
- head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
-
- TabitemRtf4Note.Visibility = Visibility.Collapsed;
- TabitemRtf5Note.Visibility = Visibility.Collapsed;
-
- head_Doku4.Visible = false;
- head_Doku5.Visible = false;
- }
- else if (i == 4)
- {
- DokumentationLabel.Content = "Dokumentation";
-
- TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
- TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
- TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
- TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
-
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
- head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
- head_Doku4.Header = _ViewModel.AllDocTypes[3].ToString();
-
- TabitemRtf5Note.Visibility = Visibility.Collapsed;
-
- head_Doku5.Visible = false;
- }
- else if (i == 5)
- {
- DokumentationLabel.Content = "Dokumentation";
-
- TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
- TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
- TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
- TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
- TabitemRtf5Note.Header = _ViewModel.AllDocTypes[4].ToString();
-
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
- head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
- head_Doku4.Header = _ViewModel.AllDocTypes[3].ToString();
- head_Doku5.Header = _ViewModel.AllDocTypes[4].ToString();
- }
+ int i = _ViewModel.AllDocTypes.Count;
+ DokumentationLabel.Visibility = Visibility.Collapsed;
- }
+ if (i == 0)
+ {
+ TabitemRtf1Note.Header = "Dokumentation";
+ head_Doku1.Header = "Dokumentation";
+ DokumentationLabel.Content = "";
+
+ TabitemRtf2Note.Visibility = Visibility.Collapsed;
+ TabitemRtf3Note.Visibility = Visibility.Collapsed;
+ TabitemRtf4Note.Visibility = Visibility.Collapsed;
+ TabitemRtf5Note.Visibility = Visibility.Collapsed;
+
+ head_Doku2.Visible = false;
+ head_Doku3.Visible = false;
+ head_Doku4.Visible = false;
+ head_Doku5.Visible = false;
+
+ }
+ else if (i == 1)
+ {
+ //DokumentationLabel.Content = "Dokumentation";
+ TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+
+ TabitemRtf2Note.Visibility = Visibility.Collapsed;
+ TabitemRtf3Note.Visibility = Visibility.Collapsed;
+ TabitemRtf4Note.Visibility = Visibility.Collapsed;
+ TabitemRtf5Note.Visibility = Visibility.Collapsed;
+
+ head_Doku2.Visible = false;
+ head_Doku3.Visible = false;
+ head_Doku4.Visible = false;
+ head_Doku5.Visible = false;
+ }
+ else if (i == 2)
+ {
+ DokumentationLabel.Content = "Dokumentation";
+ TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
+
+ TabitemRtf3Note.Visibility = Visibility.Collapsed;
+ TabitemRtf4Note.Visibility = Visibility.Collapsed;
+ TabitemRtf5Note.Visibility = Visibility.Collapsed;
+
+ head_Doku3.Visible = false;
+ head_Doku4.Visible = false;
+ head_Doku5.Visible = false;
+ }
+ else if (i == 3)
+ {
+ DokumentationLabel.Content = "Dokumentation";
+ TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
+ TabitemRtf2Note.Header = _ViewModel.AllDocTypes[2].ToString();
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
+ head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
+
+ TabitemRtf4Note.Visibility = Visibility.Collapsed;
+ TabitemRtf5Note.Visibility = Visibility.Collapsed;
+
+ head_Doku4.Visible = false;
+ head_Doku5.Visible = false;
+ }
+ else if (i == 4)
+ {
+ DokumentationLabel.Content = "Dokumentation";
+
+ TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
+ TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
+ TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
+
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
+ head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
+ head_Doku4.Header = _ViewModel.AllDocTypes[3].ToString();
+
+ TabitemRtf5Note.Visibility = Visibility.Collapsed;
+
+ head_Doku5.Visible = false;
+ }
+ else if (i == 5)
+ {
+ DokumentationLabel.Content = "Dokumentation";
+
+ TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
+ TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
+ TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
+ TabitemRtf5Note.Header = _ViewModel.AllDocTypes[4].ToString();
+
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
+ head_Doku3.Header = _ViewModel.AllDocTypes[2].ToString();
+ head_Doku4.Header = _ViewModel.AllDocTypes[3].ToString();
+ head_Doku5.Header = _ViewModel.AllDocTypes[4].ToString();
+ }
+
+
+ }
private void ConfigureDocTypes()
{
- TabItem1_Notice.IsSelected = true;
+ TabItem1_Notice.IsSelected = true;
//Tabs und Tabelle
int i = _ViewModel.AllDocTypes.Count;
- DokumentationLabel.Visibility = Visibility.Collapsed;
- if(i == 0)
+ DokumentationLabel.Visibility = Visibility.Collapsed;
+ if (i == 0)
{
- TabItem1_Notice.Header = "Dokumentation";
- head_Doku1.Header = "Dokumentation";
+ TabItem1_Notice.Header = "Dokumentation";
+ head_Doku1.Header = "Dokumentation";
DokumentationLabel.Content = "";
TabItem2_Notice.Visibility = Visibility.Collapsed;
@@ -527,13 +573,13 @@ namespace BeWo.View.Detail
head_Doku3.Visible = false;
head_Doku4.Visible = false;
head_Doku5.Visible = false;
-
+
}
- else if (i == 1)
+ else if (i == 1)
{
//DokumentationLabel.Content = "Dokumentation";
- TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Visibility = Visibility.Collapsed;
TabItem3_Notice.Visibility = Visibility.Collapsed;
@@ -545,12 +591,13 @@ namespace BeWo.View.Detail
head_Doku4.Visible = false;
head_Doku5.Visible = false;
}
- else if (i == 2) {
+ else if (i == 2)
+ {
DokumentationLabel.Content = "Dokumentation";
- TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
- TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
- head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
- head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
+ TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
+ TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
+ head_Doku1.Header = _ViewModel.AllDocTypes[0].ToString();
+ head_Doku2.Header = _ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Visibility = Visibility.Collapsed;
TabItem4_Notice.Visibility = Visibility.Collapsed;
@@ -560,7 +607,7 @@ namespace BeWo.View.Detail
head_Doku4.Visible = false;
head_Doku5.Visible = false;
}
- else if (i == 3)
+ else if (i == 3)
{
DokumentationLabel.Content = "Dokumentation";
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
@@ -576,7 +623,7 @@ namespace BeWo.View.Detail
head_Doku4.Visible = false;
head_Doku5.Visible = false;
}
- else if (i == 4)
+ else if (i == 4)
{
DokumentationLabel.Content = "Dokumentation";
@@ -612,134 +659,148 @@ namespace BeWo.View.Detail
}
}
- private void ViewModelOnStatisticInfosLoaded(object sender, EventArgs eventArgs)
- {
- var info = sender as ServiceRecordStatisticsInfoDC;
- if (info != null)
- {
- StatisticInfoGrid.Children.Clear();
- StatisticInfoGrid.ColumnDefinitions.Clear();
- StatisticInfoGrid.RowDefinitions.Clear();
+ private void ViewModelOnStatisticInfosLoaded(object sender, EventArgs eventArgs)
+ {
+ var info = sender as ServiceRecordStatisticsInfoDC;
+ if (info != null)
+ {
+ StatisticInfoGrid.Children.Clear();
+ StatisticInfoGrid.ColumnDefinitions.Clear();
+ StatisticInfoGrid.RowDefinitions.Clear();
- if (info.Header != null)
- {
- StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
-
-
- foreach (var header in info.Header)
- {
- StatisticInfoGrid.RowDefinitions.Add(new RowDefinition());
- }
- int rowIndex = 0;
- foreach (var header in info.Header)
- {
- var txt = new TextBlock();
- txt.SetValue(Grid.ColumnProperty, 0);
- txt.SetValue(Grid.RowProperty, rowIndex);
- txt.Foreground = new SolidColorBrush((Color) ColorConverter.ConvertFromString(info.ForegroundColor[rowIndex]));
- txt.Height = 14;
- txt.Text = header;
-
- StatisticInfoGrid.Children.Add(txt);
-
- rowIndex++;
- }
-
- if (info.PeriodStatisticInfos != null)
- {
- foreach (var periodInfo in info.PeriodStatisticInfos)
- {
- StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
- StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
- }
-
- int colIndex = 1;
- foreach (var periodInfo in info.PeriodStatisticInfos)
- {
- rowIndex = 0;
- foreach (var lv in periodInfo.LeftValues)
- {
- if (!String.IsNullOrEmpty(lv))
- {
- var txt = new TextBlock();
- txt.SetValue(Grid.ColumnProperty, colIndex);
- txt.SetValue(Grid.RowProperty, rowIndex);
- txt.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(periodInfo.LeftValueColors[rowIndex]));
- txt.Height = 12;
- txt.FontWeight = FontWeights.Bold;
- txt.Text = lv;
- txt.HorizontalAlignment = HorizontalAlignment.Right;
- txt.Margin = new Thickness(10,0,0,0);
- txt.Padding = new Thickness(1, 0, 1, 0);
- if (String.IsNullOrEmpty(periodInfo.RightValues[rowIndex]))
- {
- txt.SetValue(Grid.ColumnSpanProperty, 2);
- }
-
- StatisticInfoGrid.Children.Add(txt);
-
-
- //
- }
- if (!String.IsNullOrEmpty(periodInfo.RightValues[rowIndex]))
- {
- var txt = new TextBlock();
- txt.SetValue(Grid.ColumnProperty, colIndex + 1);
- txt.SetValue(Grid.RowProperty, rowIndex);
- txt.Foreground =
- new SolidColorBrush((Color) ColorConverter.ConvertFromString(periodInfo.RightValueColors[rowIndex]));
- txt.Height = 12;
- txt.FontWeight = FontWeights.Bold;
- txt.Text = periodInfo.RightValues[rowIndex];
- txt.HorizontalAlignment = HorizontalAlignment.Right;
- txt.Margin = new Thickness(10, 0, 0, 0);
- txt.Padding = new Thickness(1, 0, 1, 0);
- StatisticInfoGrid.Children.Add(txt);
+ if (info.Header != null)
+ {
+ StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition
+ {
+ Width = new GridLength(1, GridUnitType.Auto)
+ });
- //
- }
-
+ foreach (var header in info.Header)
+ {
+ StatisticInfoGrid.RowDefinitions.Add(new RowDefinition());
+ }
+ int rowIndex = 0;
+ foreach (var header in info.Header)
+ {
+ var txt = new TextBlock();
+ txt.SetValue(Grid.ColumnProperty, 0);
+ txt.SetValue(Grid.RowProperty, rowIndex);
+ txt.Foreground =
+ new SolidColorBrush(
+ (Color) ColorConverter.ConvertFromString(info.ForegroundColor[rowIndex]));
+ txt.Height = 14;
+ txt.Text = header;
- rowIndex++;
- }
+ StatisticInfoGrid.Children.Add(txt);
- colIndex += 2;
- }
- }
- }
- }
- }
+ rowIndex++;
+ }
- private void SetStatisticsVisibility()
- {
- String tenant = BeWoApp.Tenant;
+ if (info.PeriodStatisticInfos != null)
+ {
+ foreach (var periodInfo in info.PeriodStatisticInfos)
+ {
+ StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition
+ {
+ Width = new GridLength(1, GridUnitType.Auto)
+ });
+ StatisticInfoGrid.ColumnDefinitions.Add(new ColumnDefinition
+ {
+ Width = new GridLength(1, GridUnitType.Auto)
+ });
+ }
+
+ int colIndex = 1;
+ foreach (var periodInfo in info.PeriodStatisticInfos)
+ {
+ rowIndex = 0;
+ foreach (var lv in periodInfo.LeftValues)
+ {
+ if (!String.IsNullOrEmpty(lv))
+ {
+ var txt = new TextBlock();
+ txt.SetValue(Grid.ColumnProperty, colIndex);
+ txt.SetValue(Grid.RowProperty, rowIndex);
+ txt.Foreground = new SolidColorBrush(
+ (Color) ColorConverter.ConvertFromString(periodInfo.LeftValueColors[rowIndex]));
+ txt.Height = 12;
+ txt.FontWeight = FontWeights.Bold;
+ txt.Text = lv;
+ txt.HorizontalAlignment = HorizontalAlignment.Right;
+ txt.Margin = new Thickness(10, 0, 0, 0);
+ txt.Padding = new Thickness(1, 0, 1, 0);
+ if (String.IsNullOrEmpty(periodInfo.RightValues[rowIndex]))
+ {
+ txt.SetValue(Grid.ColumnSpanProperty, 2);
+ }
+
+ StatisticInfoGrid.Children.Add(txt);
+
+
+ //
+ }
+ if (!String.IsNullOrEmpty(periodInfo.RightValues[rowIndex]))
+ {
+ var txt = new TextBlock();
+ txt.SetValue(Grid.ColumnProperty, colIndex + 1);
+ txt.SetValue(Grid.RowProperty, rowIndex);
+ txt.Foreground =
+ new SolidColorBrush(
+ (Color) ColorConverter.ConvertFromString(
+ periodInfo.RightValueColors[rowIndex]));
+ txt.Height = 12;
+ txt.FontWeight = FontWeights.Bold;
+ txt.Text = periodInfo.RightValues[rowIndex];
+ txt.HorizontalAlignment = HorizontalAlignment.Right;
+ txt.Margin = new Thickness(10, 0, 0, 0);
+ txt.Padding = new Thickness(1, 0, 1, 0);
+ StatisticInfoGrid.Children.Add(txt);
+
+
+ //
+ }
+
+
+ rowIndex++;
+ }
+
+ colIndex += 2;
+ }
+ }
+ }
+ }
+ }
+
+ private void SetStatisticsVisibility()
+ {
+ String tenant = BeWoApp.Tenant;
#if DEBUG
- //tenant = "3057313346";
+ //tenant = "3057313346";
#endif
- if (tenant == "3057313346" || tenant == "2918696314")
- {
- lblStatisticInfo1.Text = "Geleistet/bewilligt Gesamt";
- lblStatisticInfo2.Text = "Geleistet/bewilligt pro Woche";
- lblStatisticInfo3.Text = "Geleistet/bewilligt pro Monat";
- lblStatisticInfo4.Text = "Übertrag Monat";
- lblStatisticInfo4.Visibility = Visibility.Visible;
- lblStatisticInfo5.Visibility = Visibility.Collapsed;
- }
- else
- {
- lblStatisticInfo4.Visibility = Visibility.Collapsed;
- lblStatisticInfo5.Visibility = Visibility.Collapsed;
- }
- }
+ if (tenant == "3057313346" || tenant == "2918696314")
+ {
+ lblStatisticInfo1.Text = "Geleistet/bewilligt Gesamt";
+ lblStatisticInfo2.Text = "Geleistet/bewilligt pro Woche";
+ lblStatisticInfo3.Text = "Geleistet/bewilligt pro Monat";
+ lblStatisticInfo4.Text = "Übertrag Monat";
+ lblStatisticInfo4.Visibility = Visibility.Visible;
+ lblStatisticInfo5.Visibility = Visibility.Collapsed;
+ }
+ else
+ {
+ lblStatisticInfo4.Visibility = Visibility.Collapsed;
+ lblStatisticInfo5.Visibility = Visibility.Collapsed;
+ }
+ }
- private void supportConceptSelectionControl_ControlInitialized(object sender, EventArgs e)
+ private void supportConceptSelectionControl_ControlInitialized(object sender, EventArgs e)
{
InitCustomerSelectedItem();
multiSupportConceptControl.SupportConceptList = supportConceptSelectionControl.SupportConceptList;
@@ -798,7 +859,8 @@ namespace BeWo.View.Detail
_ViewModel.ServiceRecordListChanged += ViewModel_ServiceRecordListChanged;
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecordView_Create) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.CreateAll))
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecordView_Create) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.CreateAll))
{
newObjectInfoGrid.IsEnabled = false;
button_add.IsEnabled = false;
@@ -813,11 +875,11 @@ namespace BeWo.View.Detail
// System.Windows.Media.TransformGroup group = this.DetailFrame.RenderTransform as System.Windows.Media.TransformGroup;
// System.Windows.Media.ScaleTransform scale = group.Children[0] as System.Windows.Media.ScaleTransform;
var lAnimation = new DoubleAnimation
- {
- From = detailContentGrid.Opacity,
- To = pOpacitiy,
- Duration = TimeSpan.FromMilliseconds(pDuration)
- };
+ {
+ From = detailContentGrid.Opacity,
+ To = pOpacitiy,
+ Duration = TimeSpan.FromMilliseconds(pDuration)
+ };
// lAnimation.From = scale.ScaleX;
// lAnimation.To = pOpacitiy;
@@ -869,7 +931,8 @@ namespace BeWo.View.Detail
var lDC = vm.CommitToDataContract();
ServiceFacade.DoOperationsServiceAsync(
- s => s.DeleteServiceRecord(lDC.ServiceRecordOid.Value, lDC.ServiceRecordVersion.Value), RefreshGrid);
+ s => s.DeleteServiceRecord(lDC.ServiceRecordOid.Value, lDC.ServiceRecordVersion.Value),
+ RefreshGrid);
}
// gridServiceRecordsSelection.UpdateLayout();
@@ -883,30 +946,31 @@ namespace BeWo.View.Detail
public void SetSelectedServiceRecordVM(ServiceRecordVM vm, bool isOnDelet)
{
- if (vm != null)
- {
- ServiceRecordVM existingVm = null;
+ if (vm != null)
+ {
+ ServiceRecordVM existingVm = null;
-
- if (!isOnDelet)
- {
- foreach (var serviceRecordVm in ViewModel.VMList)
- {
- if (serviceRecordVm.Id == vm.Id)
- {
- existingVm = serviceRecordVm;
- }
- }
- }
- else
- {
- foreach (var serviceRecordVm in ViewModel.VMList)
+
+ if (!isOnDelet)
+ {
+ foreach (var serviceRecordVm in ViewModel.VMList)
{
if (serviceRecordVm.Id == vm.Id)
{
- if(ViewModel.VMList.Count > 0 && lastPosition > 0) {
+ existingVm = serviceRecordVm;
+ }
+ }
+ }
+ else
+ {
+ foreach (var serviceRecordVm in ViewModel.VMList)
+ {
+ if (serviceRecordVm.Id == vm.Id)
+ {
+ if (ViewModel.VMList.Count > 0 && lastPosition > 0)
+ {
var a = ViewModel.VMList[lastPosition - 1];
-
+
existingVm = a;
}
else
@@ -915,12 +979,12 @@ namespace BeWo.View.Detail
}
}
}
- }
+ }
srListBox.SelectedItem = existingVm;
- srTableView.FocusedRow = existingVm;
-
- }
+ srTableView.FocusedRow = existingVm;
+
+ }
}
protected override void Save()
@@ -931,48 +995,48 @@ namespace BeWo.View.Detail
{
lToDos.Add(
s =>
+ {
+ var newItems = ViewModel.CommitAdded();
+ try
{
- var newItems = ViewModel.CommitAdded();
- try
+ var oids = s.InsertNewServiceRecords(newItems);
+ var idx = 0;
+
+ foreach (var vm in ViewModel.VMList)
{
- var oids = s.InsertNewServiceRecords(newItems);
- var idx = 0;
-
- foreach (var vm in ViewModel.VMList)
+ if (!vm.IsNew)
{
- if (!vm.IsNew)
- {
- continue;
- }
-
-
- vm.IsNew = false;
- vm.DataContract.ServiceRecordVersion = 1;
- vm.DataContract.ServiceRecordOid = oids[idx++];
- }
- }
- catch (Exception)
- {
- var newVMs = ViewModel.VMList.Where(vm => vm.IsNew).ToList();
-
- foreach (var serviceRecordVm in newVMs)
- {
- ViewModel.VMList.Remove(serviceRecordVm);
+ continue;
}
- this.Dispatch(() => ViewModel.RefreshServiceRecordsForSelectedTreeNode());
-
- throw;
+
+ vm.IsNew = false;
+ vm.DataContract.ServiceRecordVersion = 1;
+ vm.DataContract.ServiceRecordOid = oids[idx++];
}
+ }
+ catch (Exception)
+ {
+ var newVMs = ViewModel.VMList.Where(vm => vm.IsNew).ToList();
+
+ foreach (var serviceRecordVm in newVMs)
+ {
+ ViewModel.VMList.Remove(serviceRecordVm);
+ }
+
+ this.Dispatch(() => ViewModel.RefreshServiceRecordsForSelectedTreeNode());
+
+ throw;
+ }
});
}
ServiceFacade.DoMultipleOperationsServicesSync(lToDos);
- ReloadViewModel();
+ ReloadViewModel();
}
internal override bool DoSaveCheck()
{
- BeWoApp.SaveAppSettings();
+ BeWoApp.SaveAppSettings();
if (!String.IsNullOrEmpty(ViewModel.PrototypeVM.Notice))
{
@@ -1021,24 +1085,25 @@ namespace BeWo.View.Detail
serviceRecordEditView = new ServiceRecordEditView();
}
+
popup_content.Child = serviceRecordEditView;
-
- double height = 500;
- double width = 710;
- popup_content.Child = serviceRecordEditView;
- if (rootGrid.ActualWidth < width)
- {
- width = rootGrid.ActualWidth;
- }
- if (rootGrid.ActualHeight < height)
- {
- height = rootGrid.ActualHeight;
- }
-
- popup_content.Width = width;
- popup_content.Height = height;
+ double height = MainControl.ActualHeight * 0.8;
+ double width = 710;
+
+
+ if (MainControl.ActualWidth < width)
+ {
+ width = MainControl.ActualWidth;
+ }
+ if (height < 600)
+ {
+ height = 600;
+ }
+
+ popup_content.Width = width;
+ popup_content.Height = height;
if (serviceRecordEditView.CommandBindings.Count == 0)
{
@@ -1046,76 +1111,76 @@ namespace BeWo.View.Detail
new CommandBinding(
ApplicationCommands.Close,
(s, e) =>
+ {
+ ServiceRecordDialogResult result = ServiceRecordDialogResult.ClosedWithoutSaving;
+
+ if (vm.EditAllowed)
{
- ServiceRecordDialogResult result = ServiceRecordDialogResult.ClosedWithoutSaving;
+ if (serviceRecordEditView is ServiceRecordEditView)
+ {
+ result = ((ServiceRecordEditView) serviceRecordEditView).CloseAndDoSaveCheck();
+ }
+ else
+ {
+ result = ((ServiceRecordGroupEditView) serviceRecordEditView).CloseAndDoSaveCheck();
+ }
+ }
- if (vm.EditAllowed)
- {
- if (serviceRecordEditView is ServiceRecordEditView)
- {
- result = ((ServiceRecordEditView) serviceRecordEditView).CloseAndDoSaveCheck();
- }
- else
- {
- result = ((ServiceRecordGroupEditView) serviceRecordEditView).CloseAndDoSaveCheck();
- }
- }
-
- if (result == ServiceRecordDialogResult.ClosedWithSaving)
- {
- ClosePopupView();
- ViewModel.RefreshServiceRecordsForSelectedTreeNode();
- SetSelectedServiceRecordVM(vm, false);
- }
- else if (result == ServiceRecordDialogResult.ClosedWithoutSaving)
- {
- ClosePopupView();
- }
- }));
+ if (result == ServiceRecordDialogResult.ClosedWithSaving)
+ {
+ ClosePopupView();
+ ViewModel.RefreshServiceRecordsForSelectedTreeNode();
+ SetSelectedServiceRecordVM(vm, false);
+ }
+ else if (result == ServiceRecordDialogResult.ClosedWithoutSaving)
+ {
+ ClosePopupView();
+ }
+ }));
serviceRecordEditView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Save,
(s, e) =>
+ {
+ if (vm.EditAllowed)
{
- if (vm.EditAllowed)
+ bool save;
+ if (serviceRecordEditView is ServiceRecordEditView)
{
- bool save;
- if (serviceRecordEditView is ServiceRecordEditView)
- {
- save = ((ServiceRecordEditView) serviceRecordEditView).IsValid() &&
- ((ServiceRecordEditView) serviceRecordEditView).IsCustomerChangeAllowed();
- }
- else
- {
- save = ((ServiceRecordGroupEditView) serviceRecordEditView).IsValid() &&
- ((ServiceRecordGroupEditView) serviceRecordEditView)
- .IsCustomerChangeAllowed();
- }
-
- if (!save)
- {
- return;
- }
-
- serviceRecordEditView.SaveData();
+ save = ((ServiceRecordEditView) serviceRecordEditView).IsValid() &&
+ ((ServiceRecordEditView) serviceRecordEditView).IsCustomerChangeAllowed();
+ }
+ else
+ {
+ save = ((ServiceRecordGroupEditView) serviceRecordEditView).IsValid() &&
+ ((ServiceRecordGroupEditView) serviceRecordEditView)
+ .IsCustomerChangeAllowed();
}
- ClosePopupView();
- if (!(serviceRecordEditView is ServiceRecordEditView))
+ if (!save)
{
return;
}
- ViewModel.BuildServiceRecordsForSelectedTreeNode(true, RefreshFinished);
- lastSelectedVM = vm;
+ serviceRecordEditView.SaveData();
+ }
+ ClosePopupView();
- }));
+ if (!(serviceRecordEditView is ServiceRecordEditView))
+ {
+ return;
+ }
+
+ ViewModel.BuildServiceRecordsForSelectedTreeNode(true, RefreshFinished);
+ lastSelectedVM = vm;
+
+ }));
}
if (serviceRecordEditView is ServiceRecordEditView)
{
- ((ServiceRecordEditView)serviceRecordEditView).InitView(ViewModel, vm, WithoutClient);
+ ((ServiceRecordEditView) serviceRecordEditView).InitView(ViewModel, vm, WithoutClient);
serviceRecordEditView.ParentView = this;
SetPopupViewVisible(true);
}
@@ -1125,19 +1190,19 @@ namespace BeWo.View.Detail
s => s.GetServiceRecordGroup(vm.GroupOid.Value),
r => this.Dispatch(
delegate
- {
- ((ServiceRecordGroupEditView)serviceRecordEditView).InitView(ViewModel, vm, r);
+ {
+ ((ServiceRecordGroupEditView) serviceRecordEditView).InitView(ViewModel, vm, r);
- serviceRecordEditView.ParentView = this;
- popup_content.Width += 190;
- SetPopupViewVisible(true);
- }));
+ serviceRecordEditView.ParentView = this;
+ popup_content.Width += 190;
+ SetPopupViewVisible(true);
+ }));
}
}
-
- private void RefreshFinished()
- {
- SetSelectedServiceRecordVM(lastSelectedVM,false);
+
+ private void RefreshFinished()
+ {
+ SetSelectedServiceRecordVM(lastSelectedVM, false);
}
private void ShowHistory(ServiceRecordVM vm)
@@ -1148,24 +1213,24 @@ namespace BeWo.View.Detail
}
double height = 600;
- double width = 1200;
+ double width = 1200;
var serviceRecordHistoryView = new ServiceRecordHistoryView();
popup_content.Child = serviceRecordHistoryView;
-
+
if (rootGrid.ActualHeight < height)
{
height = rootGrid.ActualHeight;
}
- if (rootGrid.ActualWidth < width)
- {
- width = rootGrid.ActualWidth;
- }
+ if (rootGrid.ActualWidth < width)
+ {
+ width = rootGrid.ActualWidth;
+ }
popup_content.Height = height;
- popup_content.Width = width;
+ popup_content.Width = width;
if (serviceRecordHistoryView.CommandBindings.Count == 0)
{
@@ -1180,19 +1245,19 @@ namespace BeWo.View.Detail
s => s.GetServiceRecordHistory(vm.DataContract.ServiceRecordOid.Value),
r => this.Dispatch(
delegate
- {
- serviceRecordHistoryView.InitView(r);
+ {
+ serviceRecordHistoryView.InitView(r);
- serviceRecordHistoryView.ParentView = this;
- SetPopupViewVisible(true);
- }));
+ serviceRecordHistoryView.ParentView = this;
+ SetPopupViewVisible(true);
+ }));
}
private void EmployeeSearchView_CustomerSelected(object sender, EventArgs e)
{
- _SelectedEmployee = e.Data;
+ _SelectedEmployee = e.Data;
popupedit_employee.Text = _SelectedEmployee.ToString();
- popup_employee.IsOpen = false;
+ popup_employee.IsOpen = false;
ViewModel.SelectedEmployee = _SelectedEmployee;
@@ -1209,7 +1274,7 @@ namespace BeWo.View.Detail
var child = VisualTreeHelper.GetChild(obj, i);
if (child != null && child is ChildItem)
{
- return (ChildItem)child;
+ return (ChildItem) child;
}
var childOfChild = FindVisualChild(child);
@@ -1237,18 +1302,19 @@ namespace BeWo.View.Detail
foreach (var iDay in Utils.GetDayOfWeeks(DayOfWeek.Monday))
{
var lCb = new CheckBox
- {
- Content = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(iDay),
- Margin = new Thickness(3),
- IsHitTestVisible = DateTime.Now.DayOfWeek != iDay
- };
+ {
+ Content = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(iDay),
+ Margin = new Thickness(3),
+ IsHitTestVisible = DateTime.Now.DayOfWeek != iDay
+ };
_DayBoxes[iDay] = lCb;
wrapPanel_days.Visibility = Visibility.Collapsed;
wrapPanel_days.Children.Add(lCb);
lCb.Checked += (s, e) => ViewModel.RecordingDays.Add(_DayBoxes.Single(entry => entry.Value == s).Key);
- lCb.Unchecked += (s, e) => ViewModel.RecordingDays.Remove(_DayBoxes.Single(entry => entry.Value == s).Key);
+ lCb.Unchecked += (s, e) =>
+ ViewModel.RecordingDays.Remove(_DayBoxes.Single(entry => entry.Value == s).Key);
lCb.IsChecked = DateTime.Now.DayOfWeek == iDay;
}
@@ -1257,11 +1323,12 @@ namespace BeWo.View.Detail
datepicker_newDate1,
(s, e) => _DayBoxes.DoForEach(
iCheck =>
- {
- iCheck.Value.IsChecked = datepicker_newDate1.EditValue != null && iCheck.Key == datepicker_newDate1.DateTime.DayOfWeek;
- iCheck.Value.IsHitTestVisible = !iCheck.Value.IsChecked.Value;
- iCheck.Value.IsEnabled = iCheck.Value.IsHitTestVisible;
- }));
+ {
+ iCheck.Value.IsChecked = datepicker_newDate1.EditValue != null &&
+ iCheck.Key == datepicker_newDate1.DateTime.DayOfWeek;
+ iCheck.Value.IsHitTestVisible = !iCheck.Value.IsChecked.Value;
+ iCheck.Value.IsEnabled = iCheck.Value.IsHitTestVisible;
+ }));
}
@@ -1285,61 +1352,64 @@ namespace BeWo.View.Detail
Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
(Action) delegate
- {
- var selected = GetSelectedServiceRecordFromListBox();
- ViewModel.RefreshServiceRecordsForSelectedTreeNode();
- SetSelectedServiceRecordVM(selected,true);
+ {
+ var selected = GetSelectedServiceRecordFromListBox();
+ ViewModel.RefreshServiceRecordsForSelectedTreeNode();
+ SetSelectedServiceRecordVM(selected, true);
- });
+ });
}
- private void ReloadViewModel()
- {
- ViewModel.PrototypeVM.Notice = string.Empty;
- ViewModel.PrototypeVM.Notice2 = string.Empty;
- ViewModel.PrototypeVM.Notice3 = string.Empty;
- ViewModel.PrototypeVM.Notice4 = string.Empty;
- ViewModel.PrototypeVM.Notice5 = string.Empty;
+ private void ReloadViewModel()
+ {
+ ViewModel.PrototypeVM.Notice = string.Empty;
+ ViewModel.PrototypeVM.Notice2 = string.Empty;
+ ViewModel.PrototypeVM.Notice3 = string.Empty;
+ ViewModel.PrototypeVM.Notice4 = string.Empty;
+ ViewModel.PrototypeVM.Notice5 = string.Empty;
- SetDefaultCategory();
+ SetDefaultCategory();
- if (ViewModel.PrototypeVM.GoalTree != null && ViewModel.PrototypeVM.GoalTree.Count > 0)
- {
- foreach (var item in ViewModel.PrototypeVM.GoalTree)
- {
- item.IsChecked = false;
- }
- }
+ if (ViewModel.PrototypeVM.GoalTree != null && ViewModel.PrototypeVM.GoalTree.Count > 0)
+ {
+ foreach (var item in ViewModel.PrototypeVM.GoalTree)
+ {
+ item.IsChecked = false;
+ }
+ }
- ViewModel.PrototypeVM.DistanceInMeter = null;
- }
+ ViewModel.PrototypeVM.DistanceInMeter = null;
+ }
- private void SetDefaultCategory()
- {
- if (ViewModel.PrototypeVM.SortedCategories != null)
- {
- foreach (var cat in ViewModel.PrototypeVM.SortedCategories.Where(cat => cat.IsDefault))
- {
- ViewModel.PrototypeVM.Category = cat;
- }
- }
+ private void SetDefaultCategory()
+ {
+ if (ViewModel.PrototypeVM.SortedCategories != null)
+ {
+ foreach (var cat in ViewModel.PrototypeVM.SortedCategories.Where(cat => cat.IsDefault))
+ {
+ ViewModel.PrototypeVM.Category = cat;
+ }
+ }
- if (ViewModel.PrototypeVM.PossibleServiceDescriptions != null)
- {
- foreach (var sd in ViewModel.PrototypeVM.PossibleServiceDescriptions.Where(sd => sd.IsDefault))
- {
- ViewModel.PrototypeVM.ServiceDescription = sd;
- }
- }
- }
+ if (ViewModel.PrototypeVM.PossibleServiceDescriptions != null)
+ {
+ foreach (var sd in ViewModel.PrototypeVM.PossibleServiceDescriptions.Where(sd => sd.IsDefault))
+ {
+ ViewModel.PrototypeVM.ServiceDescription = sd;
+ }
+ }
+ }
- private bool SaveGroupBooking()
+ private bool SaveGroupBooking()
{
var lValid = true;
if (multiSupportConceptControl.SelectedSupportConcepts.Count == 0)
{
- MessageBox.Show(Translator.Translate("Bitte wählen Sie mindestens einen Klienten aus, für den Sie eine Gruppenbuchung anlegen möchten."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie mindestens einen Klienten aus, für den Sie eine Gruppenbuchung anlegen möchten."),
+ "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
lValid = false;
}
@@ -1347,18 +1417,27 @@ namespace BeWo.View.Detail
{
if (multiEmployeeControl.SelectedEmployees.Count == 0)
{
- MessageBox.Show(Translator.Translate("Bitte wählen Sie mindestens einen Mitarbeiter aus, für den Sie eine Gruppenbuchung anlegen möchten."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie mindestens einen Mitarbeiter aus, für den Sie eine Gruppenbuchung anlegen möchten."),
+ "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
lValid = false;
}
}
- var employeeOids = multiEmployeeControl.SelectedEmployees.Select(compactEmployeeDc => compactEmployeeDc.EmployeeOid).ToList();
+ var employeeOids = multiEmployeeControl.SelectedEmployees
+ .Select(compactEmployeeDc => compactEmployeeDc.EmployeeOid).ToList();
- var cb2scOids = (from scDc in multiSupportConceptControl.SelectedSupportConcepts where scDc.CostBearerRelOids != null && scDc.CostBearerRelOids.Count > 0 select scDc.CostBearerRelOids[0]).ToList();
+ var cb2scOids = (from scDc in multiSupportConceptControl.SelectedSupportConcepts
+ where scDc.CostBearerRelOids != null && scDc.CostBearerRelOids.Count > 0
+ select scDc.CostBearerRelOids[0]).ToList();
- foreach (var node in from dc in multiSupportConceptControl.SelectedSupportConcepts where lValid select SupportConceptService.CreateFlatSupportConceptItem(dc, null))
+ foreach (var node in from dc in multiSupportConceptControl.SelectedSupportConcepts
+ where lValid
+ select SupportConceptService.CreateFlatSupportConceptItem(dc, null))
{
- lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, null, node, WithoutClient, ViewModel.SelectedEmployee, employeeOids, cb2scOids);
+ lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, null, node, WithoutClient,
+ ViewModel.SelectedEmployee, employeeOids, cb2scOids);
}
if (lValid)
@@ -1379,86 +1458,89 @@ namespace BeWo.View.Detail
// Runden
var roundDuration = false;
var minuteInterval = 0;
- String calcId = null;
+ String calcId = null;
var lastMinuteInterval = -1;
- if (prototypeVM.ServiceDescription.Category.IsBillable)
- {
- roundDuration = true;
- foreach (var org in from dc in multiSupportConceptControl.SelectedSupportConcepts
- where dc.CostBearerList.Count > 0
- select dc.CostBearerList[0].Organisation)
- {
- if (org != null)
- {
- minuteInterval = org.ActualMinuteIntervall;
+ if (prototypeVM.ServiceDescription.Category.IsBillable)
+ {
+ roundDuration = true;
+ foreach (var org in from dc in multiSupportConceptControl.SelectedSupportConcepts
+ where dc.CostBearerList.Count > 0
+ select dc.CostBearerList[0].Organisation)
+ {
+ if (org != null)
+ {
+ minuteInterval = org.ActualMinuteIntervall;
- if (lastMinuteInterval == -1)
- {
- lastMinuteInterval = minuteInterval;
- calcId = org.CostBearerID;
- }
- else if (lastMinuteInterval != minuteInterval)
- {
- roundDuration = false;
- }
- }
- else if (minuteInterval >= 0)
- {
- roundDuration = false;
- }
- else
- {
- minuteInterval = 0;
- }
- }
- }
+ if (lastMinuteInterval == -1)
+ {
+ lastMinuteInterval = minuteInterval;
+ calcId = org.CostBearerID;
+ }
+ else if (lastMinuteInterval != minuteInterval)
+ {
+ roundDuration = false;
+ }
+ }
+ else if (minuteInterval >= 0)
+ {
+ roundDuration = false;
+ }
+ else
+ {
+ minuteInterval = 0;
+ }
+ }
+ }
- decimal duration = prototypeVM.RoundedDuration;
+ decimal duration = prototypeVM.RoundedDuration;
decimal totalDuration = duration;
- GroupDurationDC gd = ServiceRecordListVM.CalculateGroupDuration(personCount, employeeCount, totalDuration, cb2scOids);
+ GroupDurationDC gd =
+ ServiceRecordListVM.CalculateGroupDuration(personCount, employeeCount, totalDuration,
+ cb2scOids);
- if (gd != null)
- {
- prototypeVM.GroupRoundedDuration = gd.TotalDuration;
- prototypeVM.RoundedDuration = gd.SingleDuration;
- }
- else
- {
- //if (personCount > 2 && (BeWoApp.Tenant == "9893557471") || (BeWoApp.Tenant == "2918696314")) //Caritas Frankfurt
- //{
- // prototypeVM.GroupRoundedDuration = totalDuration;
- // prototypeVM.RoundedDuration = ((totalDuration * employeeCount) / personCount) + 10;
- //}
- //else if (personCount > 1 && BeWoApp.Tenant == "5653806613") //Feid&Kollegen
- //{
- // prototypeVM.GroupRoundedDuration = totalDuration;
- // prototypeVM.RoundedDuration = ((totalDuration * employeeCount) / personCount);
-
- //}
- //else
- //{
- if (minuteInterval > 0 && roundDuration)
- {
- Calculations calc = Calculations.GetInstance(calcId);
- totalDuration = calc.GetRoundedDuration(minuteInterval, duration);
- }
+ if (gd != null)
+ {
+ prototypeVM.GroupRoundedDuration = gd.TotalDuration;
+ prototypeVM.RoundedDuration = gd.SingleDuration;
+ }
+ else
+ {
+ //if (personCount > 2 && (BeWoApp.Tenant == "9893557471") || (BeWoApp.Tenant == "2918696314")) //Caritas Frankfurt
+ //{
+ // prototypeVM.GroupRoundedDuration = totalDuration;
+ // prototypeVM.RoundedDuration = ((totalDuration * employeeCount) / personCount) + 10;
+ //}
+ //else if (personCount > 1 && BeWoApp.Tenant == "5653806613") //Feid&Kollegen
+ //{
+ // prototypeVM.GroupRoundedDuration = totalDuration;
+ // prototypeVM.RoundedDuration = ((totalDuration * employeeCount) / personCount);
- prototypeVM.RoundedDuration = Math.Round(totalDuration / personCount, 0, MidpointRounding.AwayFromZero);
- prototypeVM.GroupRoundedDuration = totalDuration;
+ //}
+ //else
+ //{
+ if (minuteInterval > 0 && roundDuration)
+ {
+ Calculations calc = Calculations.GetInstance(calcId);
+ totalDuration = calc.GetRoundedDuration(minuteInterval, duration);
+ }
+
+ prototypeVM.RoundedDuration =
+ Math.Round(totalDuration / personCount, 0, MidpointRounding.AwayFromZero);
+ prototypeVM.GroupRoundedDuration = totalDuration;
+
+ //if (BeWoApp.Tenant == "0216265667") //Lebenshilfe Hannover
+ //{
+ // prototypeVM.RoundedDuration += 10;
+ //}
+
+ //}
+ }
- //if (BeWoApp.Tenant == "0216265667") //Lebenshilfe Hannover
- //{
- // prototypeVM.RoundedDuration += 10;
- //}
-
- //}
- }
-
ServiceRecordVM newVM;
var newVMList = new List();
@@ -1475,7 +1557,7 @@ namespace BeWo.View.Detail
newVM.SetInsertedOn(DateTime.Now);
newVMList.Add(newVM);
- if (!addToList)
+ if (!addToList)
continue;
// ###AddServiceRecord
@@ -1508,13 +1590,13 @@ namespace BeWo.View.Detail
else
{
var groupDC = new ServiceRecordGroupDC
- {
- CustomerCount = personCount,
- EmployeeCount = employeeCount,
- StartDate = prototypeVM.StartTime,
- EndDate = prototypeVM.EndTime,
- Notice = prototypeVM.Notice
- };
+ {
+ CustomerCount = personCount,
+ EmployeeCount = employeeCount,
+ StartDate = prototypeVM.StartTime,
+ EndDate = prototypeVM.EndTime,
+ Notice = prototypeVM.Notice
+ };
if (prototypeVM.GroupRoundedDuration != null)
groupDC.RoundedDuration = prototypeVM.GroupRoundedDuration.Value;
@@ -1542,7 +1624,8 @@ namespace BeWo.View.Detail
ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, UpdateViewModel);
- MessageBox.Show("Die Gruppenbuchung wurde erfolgreich gespeichert.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show("Die Gruppenbuchung wurde erfolgreich gespeichert.", "Speichern",
+ MessageBoxButton.OK, MessageBoxImage.Information);
}
}
@@ -1555,7 +1638,10 @@ namespace BeWo.View.Detail
if (multiSupportConceptControl.SelectedSupportConcepts.Count == 0)
{
- MessageBox.Show(Translator.Translate("Bitte wählen Sie mindestens einen Hilfeplan aus, für den Sie eine Mehrfachbuchung anlegen möchten."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie mindestens einen Hilfeplan aus, für den Sie eine Mehrfachbuchung anlegen möchten."),
+ "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
lValid = false;
}
@@ -1563,30 +1649,36 @@ namespace BeWo.View.Detail
{
if (multiEmployeeControl.SelectedEmployees.Count == 0)
{
- MessageBox.Show(Translator.Translate("Bitte wählen Sie mindestens einen Mitarbeiter aus, für den Sie eine Mehrfachbuchung anlegen möchten."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie mindestens einen Mitarbeiter aus, für den Sie eine Mehrfachbuchung anlegen möchten."),
+ "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
lValid = false;
}
}
- List employeeOids = new List();
- foreach (var compactEmployeeDc in multiEmployeeControl.SelectedEmployees)
- {
- employeeOids.Add(compactEmployeeDc.EmployeeOid);
- }
+ List employeeOids = new List();
+ foreach (var compactEmployeeDc in multiEmployeeControl.SelectedEmployees)
+ {
+ employeeOids.Add(compactEmployeeDc.EmployeeOid);
+ }
- List cb2scOids = new List();
- foreach (var scDc in multiSupportConceptControl.SelectedSupportConcepts)
- {
- if (scDc.CostBearerRelOids != null && scDc.CostBearerRelOids.Count > 0)
- {
- cb2scOids.Add(scDc.CostBearerRelOids[0]);
- }
- }
+ List cb2scOids = new List();
+ foreach (var scDc in multiSupportConceptControl.SelectedSupportConcepts)
+ {
+ if (scDc.CostBearerRelOids != null && scDc.CostBearerRelOids.Count > 0)
+ {
+ cb2scOids.Add(scDc.CostBearerRelOids[0]);
+ }
+ }
+
+ foreach (FlatSupportConceptTreeNodeDC node in from dc in multiSupportConceptControl.SelectedSupportConcepts
+ where lValid
+ select SupportConceptService.CreateFlatSupportConceptItem(dc, null))
+ lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, null, node, true,
+ ViewModel.SelectedEmployee, employeeOids, cb2scOids);
+ //lValid = ValidateServiceRecordVMClientX(ViewModel.PrototypeVM, node, true);
- foreach (FlatSupportConceptTreeNodeDC node in from dc in multiSupportConceptControl.SelectedSupportConcepts where lValid select SupportConceptService.CreateFlatSupportConceptItem(dc, null))
- lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, null, node, true, ViewModel.SelectedEmployee, employeeOids, cb2scOids);
- //lValid = ValidateServiceRecordVMClientX(ViewModel.PrototypeVM, node, true);
-
if (lValid)
{
@@ -1599,21 +1691,21 @@ namespace BeWo.View.Detail
ServiceRecordVM newVM = null;
List newVMList = new List();
- var vmDuration = prototypeVM.RoundedDuration;
+ var vmDuration = prototypeVM.RoundedDuration;
foreach (CompactSupportConceptDC dc in this.multiSupportConceptControl.SelectedSupportConcepts)
{
- decimal duration = vmDuration;
-
- if (dc.CostBearerList.Count > 0)
- {
- var org = dc.CostBearerList[0].Organisation;
- if (org != null)
- {
- Calculations calc = Calculations.GetInstance(org.CostBearerID);
+ decimal duration = vmDuration;
- prototypeVM.RoundedDuration = calc.GetRoundedDuration(org, duration);
- }
- }
+ if (dc.CostBearerList.Count > 0)
+ {
+ var org = dc.CostBearerList[0].Organisation;
+ if (org != null)
+ {
+ Calculations calc = Calculations.GetInstance(org.CostBearerID);
+
+ prototypeVM.RoundedDuration = calc.GetRoundedDuration(org, duration);
+ }
+ }
bool addToList = true;
@@ -1643,23 +1735,24 @@ namespace BeWo.View.Detail
lToDos.Add(
s =>
+ {
+ List oids = s.InsertNewServiceRecords(dcList);
+ int idx = 0;
+ foreach (ServiceRecordVM vm in newVMList)
{
- List oids = s.InsertNewServiceRecords(dcList);
- int idx = 0;
- foreach (ServiceRecordVM vm in newVMList)
- {
- vm.IsNew = false;
- vm.DataContract.ServiceRecordVersion = 1;
- vm.DataContract.ServiceRecordOid = oids[idx++];
- }
- });
+ vm.IsNew = false;
+ vm.DataContract.ServiceRecordVersion = 1;
+ vm.DataContract.ServiceRecordOid = oids[idx++];
+ }
+ });
}
-
+
ServiceFacade.DoMultipleOperationsServicesAsync(lToDos, UpdateViewModel);
- MessageBox.Show("Die Dokumentationen wurde erfolgreich gespeichert.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show("Die Dokumentationen wurde erfolgreich gespeichert.", "Speichern",
+ MessageBoxButton.OK, MessageBoxImage.Information);
}
}
@@ -1676,13 +1769,17 @@ namespace BeWo.View.Detail
if (!WithoutClient && (selectedNode == null || selectedNode.SupportConceptTreeNodeDC == null))
{
- MessageBox.Show(Translator.Translate("Bitte wählen Sie zuerst einen Hilfeplan, für den Sie Leistungen dokumentieren möchten."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie zuerst einen Hilfeplan, für den Sie Leistungen dokumentieren möchten."),
+ "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
lValid = false;
}
if (lValid)
{
- lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, ViewModel.StatisticsDC, selectedNode, WithoutClient, ViewModel.SelectedEmployee, null, null);
+ lValid = BeWoUtils.ValidateServiceRecordVM(ViewModel.PrototypeVM, ViewModel.StatisticsDC, selectedNode,
+ WithoutClient, ViewModel.SelectedEmployee, null, null);
if (lValid)
{
@@ -1708,33 +1805,33 @@ namespace BeWo.View.Detail
private void SelectedItemChanged(FlatSupportConceptTreeNodeDC selectedNode)
{
- if (ViewModel == null)
+ if (ViewModel == null)
return;
UpdateAssessmentSheet(selectedNode);
ViewModel.ChangeTreeItemSelection(selectedNode);
srListBox.SelectedIndex = -1;
-
+
var sv = FindVisualChild(srListBox);
if (sv != null)
sv.ScrollToTop();
UpdateServiceRecordListReportUrl(selectedNode);
- SetDefaultCategory();
+ SetDefaultCategory();
}
private void ServiceRecordView2_Loaded(object sender, RoutedEventArgs e)
{
- ReloadViewModel();
+ ReloadViewModel();
- if (ActualHeight > 0)
- {
- ComboBoxTreeViewControl.ParentWindowHeight = ActualHeight;
- }
+ if (ActualHeight > 0)
+ {
+ ComboBoxTreeViewControl.ParentWindowHeight = ActualHeight;
+ }
- supportConceptSelectionControl.Focus();
+ supportConceptSelectionControl.Focus();
}
private static void ServiceRecordView2_Unloaded(object sender, RoutedEventArgs e)
@@ -1744,15 +1841,16 @@ namespace BeWo.View.Detail
private void SetEmployeeComboVisibility()
{
- if ((!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember))
+ if ((!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) &&
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember))
|| chkGroupBooking.IsChecked.Value || chkMultiBooking.IsChecked.Value)
{
- lblEmployee.Visibility = Visibility.Collapsed;
+ lblEmployee.Visibility = Visibility.Collapsed;
popupedit_employee.Visibility = Visibility.Collapsed;
}
else
{
- lblEmployee.Visibility = Visibility.Visible;
+ lblEmployee.Visibility = Visibility.Visible;
popupedit_employee.Visibility = Visibility.Visible;
}
}
@@ -1773,44 +1871,46 @@ namespace BeWo.View.Detail
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
- var vm = ((TextBox)sender).Tag as ServiceRecordVM;
+ var vm = ((TextBox) sender).Tag as ServiceRecordVM;
if (vm != null)
srListBox.SelectedItem = vm;
}
private void UpdateServiceRecordListReportUrl(FlatSupportConceptTreeNodeDC selectedNode)
{
- long scOid = 0;
- long cOid = 0;
+ long scOid = 0;
+ long cOid = 0;
long cb2scOid = 0;
- var eOid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
+ var eOid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
- if (selectedNode != null && selectedNode.SupportConceptTreeNodeDC != null)
- {
- if (selectedNode.SupportConceptTreeNodeDC.SupportConcept != null)
- {
- scOid = selectedNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid;
- }
+ if (selectedNode != null && selectedNode.SupportConceptTreeNodeDC != null)
+ {
+ if (selectedNode.SupportConceptTreeNodeDC.SupportConcept != null)
+ {
+ scOid = selectedNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid;
+ }
- if (selectedNode.SupportConceptTreeNodeDC.Customer != null)
- {
- cOid = selectedNode.SupportConceptTreeNodeDC.Customer.CustomerOid;
- }
+ if (selectedNode.SupportConceptTreeNodeDC.Customer != null)
+ {
+ cOid = selectedNode.SupportConceptTreeNodeDC.Customer.CustomerOid;
+ }
- if (selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
- {
- cb2scOid = selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.CostBearer2SupportConceptOid.Value;
- }
- }
- else
- {
- if (_SelectedEmployee != null)
- {
- eOid = _SelectedEmployee.EmployeeOid;
- }
- }
+ if (selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
+ {
+ cb2scOid = selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC
+ .CostBearer2SupportConceptOid.Value;
+ }
+ }
+ else
+ {
+ if (_SelectedEmployee != null)
+ {
+ eOid = _SelectedEmployee.EmployeeOid;
+ }
+ }
- var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx" + "?eOid=" + eOid + "&scOid=" + scOid + "&cOid=" + cOid + "&cb2scOid=" + cb2scOid + "&type=" + Utils.EnumName(ReportTypes.ServiceRecordList);
+ var url = BeWoApp.SiteOfOrigin + "/ReportView.aspx" + "?eOid=" + eOid + "&scOid=" + scOid + "&cOid=" +
+ cOid + "&cb2scOid=" + cb2scOid + "&type=" + Utils.EnumName(ReportTypes.ServiceRecordList);
url = BeWoWpfUtils.GetHTMLEncodedURL(url);
linkPdfExport.NavigateUri = new Uri(url);
@@ -1825,13 +1925,14 @@ namespace BeWo.View.Detail
ViewModel.RefreshServiceRecordsForSelectedTreeNode();
});
}
-
- private void ViewModel_ServiceRecordListChanged(object sender, EventArgs e)
+
+ private void ViewModel_ServiceRecordListChanged(object sender, EventArgs e)
{
- var list = _ViewModel.ServiceRecordsForSelectedCustomer.OrderByDescending(srVM => srVM.DateAndTime).ToList();
+ var list = _ViewModel.ServiceRecordsForSelectedCustomer.OrderByDescending(srVM => srVM.DateAndTime)
+ .ToList();
- bool containsMinutenFormat = false;
+ bool containsMinutenFormat = false;
bool containsStundenFormat = false;
foreach (var a in list)
@@ -1860,12 +1961,12 @@ namespace BeWo.View.Detail
}
if (containsStundenFormat && containsMinutenFormat)
- {
+ {
RoundedDHeader.Header = "Dauer";
DutationInSTDHeader.Visible = true;
- DutationInSTDHeader.VisibleIndex = RoundedDHeader.VisibleIndex + 1;
+ DutationInSTDHeader.VisibleIndex = RoundedDHeader.VisibleIndex + 1;
- }
+ }
else if (containsMinutenFormat)
{
RoundedDHeader.Header = "Minuten";
@@ -1885,7 +1986,7 @@ namespace BeWo.View.Detail
private void BtnDelete_Click(object sender, RoutedEventArgs e)
{
- var vm = ((Button)sender).Tag as ServiceRecordVM;
+ var vm = ((Button) sender).Tag as ServiceRecordVM;
if (vm != null)
{
srListBox.SelectedItem = vm;
@@ -1903,7 +2004,7 @@ namespace BeWo.View.Detail
srListBox.SelectedItem = vm;
}
- StartEdit(GetSelectedServiceRecordFromListBox());
+ StartEdit(GetSelectedServiceRecordFromListBox());
}
private void ServiceRecordListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
@@ -1913,28 +2014,30 @@ namespace BeWo.View.Detail
return;
}
- StartEdit(GetSelectedServiceRecordFromListBox());
+ StartEdit(GetSelectedServiceRecordFromListBox());
}
- private void StartEdit(ServiceRecordVM selectedRecord)
+ private void StartEdit(ServiceRecordVM selectedRecord)
{
- if (selectedRecord != null)
- {
- var serviceRecordOid = Convert.ToInt64(selectedRecord.Id);
+ if (selectedRecord != null)
+ {
+ var serviceRecordOid = Convert.ToInt64(selectedRecord.Id);
- var record = ServiceFacade.DoOperationsServiceSync(s => s.GetServiceRecordById(serviceRecordOid));
+ var record = ServiceFacade.DoOperationsServiceSync(s => s.GetServiceRecordById(serviceRecordOid));
- if (record == null)
- {
- MessageBox.Show("Der ausgewählte Eintrag wurde in der Zwischenzeit gelöscht.", "Editieren nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error);
- ViewModel.RefreshServiceRecordsForSelectedTreeNode();
- return;
- }
+ if (record == null)
+ {
+ MessageBox.Show("Der ausgewählte Eintrag wurde in der Zwischenzeit gelöscht.",
+ "Editieren nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error);
+ ViewModel.RefreshServiceRecordsForSelectedTreeNode();
+ return;
+ }
- var sr = new ServiceRecordVM(record, ViewModel.PrototypeVM.Category2Services, selectedRecord.AllGoalCategories, selectedRecord.AllGoals);
-
- Edit(sr);
- }
+ var sr = new ServiceRecordVM(record, ViewModel.PrototypeVM.Category2Services,
+ selectedRecord.AllGoalCategories, selectedRecord.AllGoals);
+
+ Edit(sr);
+ }
}
private void BtnShowHistory_Click(object sender, RoutedEventArgs e)
@@ -1957,7 +2060,8 @@ namespace BeWo.View.Detail
{
//var lValid = ValidationTrigger.Validate(root, new Collection { "BedarfsmedikationsGrid" });
- if (BeWoApp.AppSettings.ShowRtfTextfeld) {
+ if (BeWoApp.AppSettings.ShowRtfTextfield)
+ {
SetRTFDaten();
}
@@ -1988,48 +2092,37 @@ namespace BeWo.View.Detail
private void SetRTFDaten()
{
- if (richEditControl1.Text != "")
- {
- ViewModel.PrototypeVM.Notice = richEditControl1.Text;
- ViewModel.PrototypeVM.RTFNotice = richEditControl1.RtfText;
- }
- if (richEditControl2.Text != "")
- {
- ViewModel.PrototypeVM.Notice2 = richEditControl2.Text;
- ViewModel.PrototypeVM.RTFNotice2 = richEditControl2.RtfText;
- }
- if (richEditControl3.Text != "")
- {
- ViewModel.PrototypeVM.Notice3 = richEditControl3.Text;
- ViewModel.PrototypeVM.RTFNotice3 = richEditControl3.RtfText;
- }
- if (richEditControl4.Text != "")
- {
- ViewModel.PrototypeVM.Notice4 = richEditControl4.Text;
- ViewModel.PrototypeVM.RTFNotice4 = richEditControl4.RtfText;
- }
- if (richEditControl5.Text != "")
- {
- ViewModel.PrototypeVM.Notice5 = richEditControl5.Text;
- ViewModel.PrototypeVM.RTFNotice5 = richEditControl5.RtfText;
- }
+ ViewModel.PrototypeVM.Notice = richEditControl1.Text;
+ ViewModel.PrototypeVM.RTFNotice = richEditControl1.RtfText;
+
+ ViewModel.PrototypeVM.Notice2 = richEditControl2.Text;
+ ViewModel.PrototypeVM.RTFNotice2 = richEditControl2.RtfText;
+
+ ViewModel.PrototypeVM.Notice3 = richEditControl3.Text;
+ ViewModel.PrototypeVM.RTFNotice3 = richEditControl3.RtfText;
+
+ ViewModel.PrototypeVM.Notice4 = richEditControl4.Text;
+ ViewModel.PrototypeVM.RTFNotice4 = richEditControl4.RtfText;
+
+ ViewModel.PrototypeVM.Notice5 = richEditControl5.Text;
+ ViewModel.PrototypeVM.RTFNotice5 = richEditControl5.RtfText;
+
}
- private void SetRebookingButtonVisibility()
- {
- if (Eintragumbuchunsbutton == null)
- {
- return;
- }
+ private void SetRebookingButtonVisibility()
+ {
+ if (Eintragumbuchunsbutton == null)
+ {
+ return;
+ }
- var erg = chkWithClient != null && chkWithClient.IsChecked != null && chkWithClient.IsChecked.Value &&
- chkGroupBooking != null && chkGroupBooking.IsChecked != null && !chkGroupBooking.IsChecked.Value &&
- chkMultiBooking != null && chkMultiBooking.IsChecked != null && !chkMultiBooking.IsChecked.Value;
+ var erg = chkWithClient != null && chkWithClient.IsChecked != null && chkWithClient.IsChecked.Value &&
+ chkGroupBooking != null && chkGroupBooking.IsChecked != null &&
+ !chkGroupBooking.IsChecked.Value &&
+ chkMultiBooking != null && chkMultiBooking.IsChecked != null && !chkMultiBooking.IsChecked.Value;
- Eintragumbuchunsbutton.Visibility = erg ?
- Visibility.Visible :
- Visibility.Collapsed;
- }
+ Eintragumbuchunsbutton.Visibility = erg ? Visibility.Visible : Visibility.Collapsed;
+ }
private void ChkGroupBooking_Checked(object sender, RoutedEventArgs e)
{
@@ -2044,14 +2137,14 @@ namespace BeWo.View.Detail
}
supportConceptSelectionControl.Visibility = Visibility.Collapsed;
- multiSupportConceptControl.Visibility = Visibility.Visible;
- multiEmployeeControl.Visibility = Visibility.Visible;
- panelGoalLabel.Visibility = Visibility.Collapsed;
- panelGoalTree.Visibility = Visibility.Collapsed;
+ multiSupportConceptControl.Visibility = Visibility.Visible;
+ multiEmployeeControl.Visibility = Visibility.Visible;
+ panelGoalLabel.Visibility = Visibility.Collapsed;
+ panelGoalTree.Visibility = Visibility.Collapsed;
SetEmployeeComboVisibility();
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
if (chkWithClient != null)
{
@@ -2060,12 +2153,13 @@ namespace BeWo.View.Detail
if (chkMultiBooking != null)
{
- _IgnoreGroupMultiCheck = true;
+ _IgnoreGroupMultiCheck = true;
chkMultiBooking.IsChecked = false;
- _IgnoreGroupMultiCheck = false;
+ _IgnoreGroupMultiCheck = false;
}
- SelectedItemChanged(SupportConceptService.CreateFlatSupportConceptItem(multiSupportConceptControl.SelectedItem, null));
+ SelectedItemChanged(
+ SupportConceptService.CreateFlatSupportConceptItem(multiSupportConceptControl.SelectedItem, null));
}
private void ChkGroupBooking_Unchecked(object sender, RoutedEventArgs e)
@@ -2081,13 +2175,13 @@ namespace BeWo.View.Detail
}
supportConceptSelectionControl.Visibility = Visibility.Visible;
- multiSupportConceptControl.Visibility = Visibility.Collapsed;
- multiEmployeeControl.Visibility = Visibility.Collapsed;
- panelGoalLabel.Visibility = Visibility.Visible;
- panelGoalTree.Visibility = Visibility.Visible;
+ multiSupportConceptControl.Visibility = Visibility.Collapsed;
+ multiEmployeeControl.Visibility = Visibility.Collapsed;
+ panelGoalLabel.Visibility = Visibility.Visible;
+ panelGoalTree.Visibility = Visibility.Visible;
SetEmployeeComboVisibility();
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
if (chkWithClient != null)
{
@@ -2110,13 +2204,13 @@ namespace BeWo.View.Detail
}
supportConceptSelectionControl.Visibility = Visibility.Collapsed;
- multiSupportConceptControl.Visibility = Visibility.Visible;
- multiEmployeeControl.Visibility = Visibility.Visible;
- panelGoalLabel.Visibility = Visibility.Collapsed;
- panelGoalTree.Visibility = Visibility.Collapsed;
+ multiSupportConceptControl.Visibility = Visibility.Visible;
+ multiEmployeeControl.Visibility = Visibility.Visible;
+ panelGoalLabel.Visibility = Visibility.Collapsed;
+ panelGoalTree.Visibility = Visibility.Collapsed;
SetEmployeeComboVisibility();
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
if (chkWithClient != null)
{
@@ -2130,7 +2224,8 @@ namespace BeWo.View.Detail
_IgnoreGroupMultiCheck = false;
}
- SelectedItemChanged(SupportConceptService.CreateFlatSupportConceptItem(multiSupportConceptControl.SelectedItem, null));
+ SelectedItemChanged(
+ SupportConceptService.CreateFlatSupportConceptItem(multiSupportConceptControl.SelectedItem, null));
}
private void ChkMultiBooking_Unchecked(object sender, RoutedEventArgs e)
@@ -2146,13 +2241,13 @@ namespace BeWo.View.Detail
}
supportConceptSelectionControl.Visibility = Visibility.Visible;
- multiSupportConceptControl.Visibility = Visibility.Collapsed;
- multiEmployeeControl.Visibility = Visibility.Collapsed;
- panelGoalLabel.Visibility = Visibility.Visible;
- panelGoalTree.Visibility = Visibility.Visible;
+ multiSupportConceptControl.Visibility = Visibility.Collapsed;
+ multiEmployeeControl.Visibility = Visibility.Collapsed;
+ panelGoalLabel.Visibility = Visibility.Visible;
+ panelGoalTree.Visibility = Visibility.Visible;
SetEmployeeComboVisibility();
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
if (chkWithClient != null)
{
@@ -2187,7 +2282,7 @@ namespace BeWo.View.Detail
chkMultiBooking.IsEnabled = true;
}
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
}
private void ChkWithClient_Unchecked(object sender, RoutedEventArgs e)
@@ -2211,7 +2306,7 @@ namespace BeWo.View.Detail
chkMultiBooking.IsEnabled = false;
}
- SetRebookingButtonVisibility();
+ SetRebookingButtonVisibility();
}
//CB EINKOMMENTIEREN
@@ -2283,7 +2378,8 @@ namespace BeWo.View.Detail
// btnSaveWohnheimbuchung.Visibility = Visibility.Collapsed;
//}
- private void SupportConceptSelectionControl_ItemSelected(object sender, EventArgs e)
+ private void SupportConceptSelectionControl_ItemSelected(object sender,
+ EventArgs e)
{
if (chkGroupBooking.IsChecked.Value || chkMultiBooking.IsChecked.Value)
{
@@ -2310,18 +2406,18 @@ namespace BeWo.View.Detail
var lHeaderCaptions = new List();
var lContent = new List>();
- if (BeWoApp.AppSettings.IsEndDateVisible)
- {
- lHeaderCaptions.Add("Startdatum");
- lHeaderCaptions.Add("Enddatum");
- }
- else
- {
- lHeaderCaptions.Add("Datum");
- }
-
- lHeaderCaptions.Add("Von");
- lHeaderCaptions.Add("Bis");
+ if (BeWoApp.AppSettings.IsEndDateVisible)
+ {
+ lHeaderCaptions.Add("Startdatum");
+ lHeaderCaptions.Add("Enddatum");
+ }
+ else
+ {
+ lHeaderCaptions.Add("Datum");
+ }
+
+ lHeaderCaptions.Add("Von");
+ lHeaderCaptions.Add("Bis");
lHeaderCaptions.Add(Translator.Translate("FLM"));
lHeaderCaptions.Add(Translator.Translate("FLM gerundet"));
lHeaderCaptions.Add(Translator.Translate("Mitarbeiter"));
@@ -2330,101 +2426,109 @@ namespace BeWo.View.Detail
lHeaderCaptions.Add(Translator.Translate("Kostenträger"));
lHeaderCaptions.Add("Kategorie");
lHeaderCaptions.Add("Leistung");
- if (ViewModel.AllDocTypes != null && ViewModel.AllDocTypes.Count > 0)
- {
- foreach (var dt in ViewModel.AllDocTypes)
- {
- lHeaderCaptions.Add(dt.TypeDescription);
- }
- }
- else
- {
- lHeaderCaptions.Add("Dokumentation");
- }
-
+ if (ViewModel.AllDocTypes != null && ViewModel.AllDocTypes.Count > 0)
+ {
+ foreach (var dt in ViewModel.AllDocTypes)
+ {
+ lHeaderCaptions.Add(dt.TypeDescription);
+ }
+ }
+ else
+ {
+ lHeaderCaptions.Add("Dokumentation");
+ }
+
lHeaderCaptions.Add("Ziele");
lHeaderCaptions.Add("Angelegt von");
lHeaderCaptions.Add("Angelegt am");
if (list != null)
{
- foreach (var vm in list)
- {
- var row = new List();
+ foreach (var vm in list)
+ {
+ var row = new List();
- if (BeWoApp.AppSettings.IsEndDateVisible)
- {
- row.Add(String.Format("{0:dd.MM.yyyy}", vm.StartTime));
- row.Add(String.Format("{0:dd.MM.yyyy}", vm.EndDate));
- }
- else
- {
- row.Add(String.Format("{0:dd.MM.yyyy}", vm.Date));
- }
+ if (BeWoApp.AppSettings.IsEndDateVisible)
+ {
+ row.Add(String.Format("{0:dd.MM.yyyy}", vm.StartTime));
+ row.Add(String.Format("{0:dd.MM.yyyy}", vm.EndDate));
+ }
+ else
+ {
+ row.Add(String.Format("{0:dd.MM.yyyy}", vm.Date));
+ }
- row.Add(String.Format("{0:HH:mm}", vm.StartTime != null && vm.StartTime.Value.Second == 0 ? vm.StartTime : null));
- row.Add(String.Format("{0:HH:mm}", vm.EndTime != null && vm.EndTime.Value.Second == 0 ? vm.EndTime : null));
- row.Add(vm.AssistanceDuration.ToString());
- row.Add(vm.RoundedDuration.ToString());
- row.Add(vm.Employee != null ? vm.Employee.ToString() : string.Empty);
- row.Add(vm.Customer != null ? vm.Customer.ToString() : string.Empty);
- row.Add(vm.SupportConcept != null ? vm.SupportConcept.ToString() : string.Empty);
- row.Add(vm.CostBearer != null ? vm.CostBearer.ToString() : string.Empty);
- row.Add(vm.Category != null ? vm.Category.ToString() : string.Empty);
- row.Add(vm.ServiceDescription != null ? vm.ServiceDescription.ToString() : string.Empty);
+ row.Add(String.Format("{0:HH:mm}",
+ vm.StartTime != null && vm.StartTime.Value.Second == 0 ? vm.StartTime : null));
+ row.Add(String.Format("{0:HH:mm}",
+ vm.EndTime != null && vm.EndTime.Value.Second == 0 ? vm.EndTime : null));
+ row.Add(vm.AssistanceDuration.ToString());
+ row.Add(vm.RoundedDuration.ToString());
+ row.Add(vm.Employee != null ? vm.Employee.ToString() : string.Empty);
+ row.Add(vm.Customer != null ? vm.Customer.ToString() : string.Empty);
+ row.Add(vm.SupportConcept != null ? vm.SupportConcept.ToString() : string.Empty);
+ row.Add(vm.CostBearer != null ? vm.CostBearer.ToString() : string.Empty);
+ row.Add(vm.Category != null ? vm.Category.ToString() : string.Empty);
+ row.Add(vm.ServiceDescription != null ? vm.ServiceDescription.ToString() : string.Empty);
- row.Add(vm.Notice);
- if (ViewModel.AllDocTypes != null)
- {
- if (ViewModel.AllDocTypes.Count == 2)
- {
- row.Add(vm.Notice2);
- }
- if (ViewModel.AllDocTypes.Count == 3)
- {
- row.Add(vm.Notice3);
- }
- if (ViewModel.AllDocTypes.Count == 4)
- {
- row.Add(vm.Notice4);
- }
- if (ViewModel.AllDocTypes.Count == 5)
- {
- row.Add(vm.Notice5);
- }
- }
-
- row.Add(vm.GoalString);
- row.Add(vm.InsUser);
- row.Add(vm.InsertedOn);
+ row.Add(vm.Notice);
+ if (ViewModel.AllDocTypes != null)
+ {
+ if (ViewModel.AllDocTypes.Count == 2)
+ {
+ row.Add(vm.Notice2);
+ }
+ if (ViewModel.AllDocTypes.Count == 3)
+ {
+ row.Add(vm.Notice3);
+ }
+ if (ViewModel.AllDocTypes.Count == 4)
+ {
+ row.Add(vm.Notice4);
+ }
+ if (ViewModel.AllDocTypes.Count == 5)
+ {
+ row.Add(vm.Notice5);
+ }
+ }
- //lContent.AddRange(list.Select(vm => new List
- // {
- // String.Format("{0:dd.MM.yyyy}", vm.StartTime != null ? vm.Date : null),
- // String.Format("{0:HH:mm}", vm.StartTime != null && vm.StartTime.Value.Second == 0 ? vm.StartTime : null),
- // String.Format("{0:HH:mm}", vm.EndTime != null && vm.EndTime.Value.Second == 0 ? vm.EndTime : null),
- // vm.AssistanceDuration.ToString(),
- // vm.RoundedDuration.ToString(),
- // vm.Employee != null ? vm.Employee.ToString() : string.Empty,
- // vm.Customer != null ? vm.Customer.ToString() : string.Empty,
- // vm.SupportConcept != null ? vm.SupportConcept.ToString() : string.Empty,
- // vm.CostBearer != null ? vm.CostBearer.ToString() : string.Empty,
- // vm.Category != null ? vm.Category.ToString() : string.Empty,
- // vm.ServiceDescription != null ? vm.ServiceDescription.ToString() : string.Empty,
- // vm.Notice,vm.Notice2,vm.Notice3,vm.Notice4,vm.Notice5,
- // vm.GoalString
- // }));
- lContent.Add(row);
+ row.Add(vm.GoalString);
+ row.Add(vm.InsUser);
+ row.Add(vm.InsertedOn);
+
+ //lContent.AddRange(list.Select(vm => new List
+ // {
+ // String.Format("{0:dd.MM.yyyy}", vm.StartTime != null ? vm.Date : null),
+ // String.Format("{0:HH:mm}", vm.StartTime != null && vm.StartTime.Value.Second == 0 ? vm.StartTime : null),
+ // String.Format("{0:HH:mm}", vm.EndTime != null && vm.EndTime.Value.Second == 0 ? vm.EndTime : null),
+ // vm.AssistanceDuration.ToString(),
+ // vm.RoundedDuration.ToString(),
+ // vm.Employee != null ? vm.Employee.ToString() : string.Empty,
+ // vm.Customer != null ? vm.Customer.ToString() : string.Empty,
+ // vm.SupportConcept != null ? vm.SupportConcept.ToString() : string.Empty,
+ // vm.CostBearer != null ? vm.CostBearer.ToString() : string.Empty,
+ // vm.Category != null ? vm.Category.ToString() : string.Empty,
+ // vm.ServiceDescription != null ? vm.ServiceDescription.ToString() : string.Empty,
+ // vm.Notice,vm.Notice2,vm.Notice3,vm.Notice4,vm.Notice5,
+ // vm.GoalString
+ // }));
+ lContent.Add(row);
}
-
+
}
- var path = BeWoApp.GetAndCreateUserAppDataPath() + "\\Dokumentation.xls";
+ var path = BeWoApp.GetAndCreateUserAppDataPath() + "\\Dokumentation.xls";
- var sf = new SaveFileDialog { FileName = Path.GetFileName(path), Filter = "Microsoft Excel 97-2003-Arbeitsblatt|*.xls|Alle Dateien|*.*" };
+ var sf = new SaveFileDialog
+ {
+ FileName = Path.GetFileName(path),
+ Filter = "Microsoft Excel 97-2003-Arbeitsblatt|*.xls|Alle Dateien|*.*"
+ };
if (sf.ShowDialog() != true)
return;
- ServiceFacade.DoDownloadServiceSync(s => BeWoUtils.WriteExcelFile(s.PrepareExcelFile(DownloadLinkEngine.ExcelFileId, lHeaderCaptions, lContent), sf.FileName));
+ ServiceFacade.DoDownloadServiceSync(s =>
+ BeWoUtils.WriteExcelFile(s.PrepareExcelFile(DownloadLinkEngine.ExcelFileId, lHeaderCaptions, lContent),
+ sf.FileName));
}
private void MultiSupportConceptControl_ItemSelected(object sender, EventArgs e)
@@ -2441,7 +2545,7 @@ namespace BeWo.View.Detail
private void UpdateAssessmentSheet(FlatSupportConceptTreeNodeDC selectedNode)
{
- if (assessmentSheet == null)
+ if (assessmentSheet == null)
return;
if (selectedNode != null && selectedNode.SupportConceptTreeNodeDC != null)
@@ -2456,11 +2560,11 @@ namespace BeWo.View.Detail
cb => this.Dispatch(
delegate
- {
- customerContainsAssessmentCategories.Add(customer, cb);
+ {
+ customerContainsAssessmentCategories.Add(customer, cb);
- UpdateAssessmentSheet(selectedNode.SupportConceptTreeNodeDC.Customer, cb);
- }), false);
+ UpdateAssessmentSheet(selectedNode.SupportConceptTreeNodeDC.Customer, cb);
+ }), false);
}
else
{
@@ -2476,44 +2580,45 @@ namespace BeWo.View.Detail
}
private DockLayoutManager dockLayoutManager;
- private LayoutPanel layoutPanel1;
- private LayoutPanel layoutPanel2;
- private LayoutPanel layoutPanel3;
- private Grid panel1;
- private Grid panel2;
- private Grid panel3;
+ private LayoutPanel layoutPanel1;
+ private LayoutPanel layoutPanel2;
+ private LayoutPanel layoutPanel3;
+ private Grid panel1;
+ private Grid panel2;
+ private Grid panel3;
private void CreateLayoutManager()
{
dockLayoutManager = new DockLayoutManager();
dockLayoutManager.SetValue(Grid.RowProperty, 2);
- dockLayoutManager.SetValue(Grid.ColumnSpanProperty, 2);
+ dockLayoutManager.SetValue(Grid.ColumnSpanProperty, 2);
dockLayoutManager.Margin = new Thickness(0, 5, 0, 0);
dockLayoutManager.SetValue(ThemeManager.ThemeNameProperty, "LightGray");
dockLayoutManager.Background = Brushes.Transparent;
dockLayoutManager.Visibility = Visibility.Hidden;
dockLayoutManager.ShowingDockHints += dockLayoutManager_ShowingDockHints;
-
+
var group = new LayoutGroup();
dockLayoutManager.LayoutRoot = group;
layoutPanel1 = new LayoutPanel
- {
- Caption = "Neue Leistung hinzufügen",
- ItemWidth = GridLength.Auto, ShowCloseButton = false,
- ShowPinButton = false,
- AllowDrag = false,
- AllowMove = false,
- CaptionHorizontalAlignment = HorizontalAlignment.Stretch,
- CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate")
- };
+ {
+ Caption = "Neue Leistung hinzufügen",
+ ItemWidth = GridLength.Auto,
+ ShowCloseButton = false,
+ ShowPinButton = false,
+ AllowDrag = false,
+ AllowMove = false,
+ CaptionHorizontalAlignment = HorizontalAlignment.Stretch,
+ CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate")
+ };
var border = new Border
- {
- Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
- BorderThickness = new Thickness(0),
- BorderBrush = Brushes.Gray
- };
+ {
+ Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
+ BorderThickness = new Thickness(0),
+ BorderBrush = Brushes.Gray
+ };
panel1 = new Grid {Margin = new Thickness(4)};
border.Child = panel1;
@@ -2523,23 +2628,23 @@ namespace BeWo.View.Detail
group.Items.Add(layoutPanel1);
layoutPanel2 = new LayoutPanel
- {
- Caption = "Leistungen",
- ItemWidth = new GridLength(1, GridUnitType.Star),
- ShowCloseButton = false,
- ShowPinButton = false,
- AllowDrag = false,
- AllowMove = false,
- CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate"),
- CaptionHorizontalAlignment = HorizontalAlignment.Stretch
- };
+ {
+ Caption = "Leistungen",
+ ItemWidth = new GridLength(1, GridUnitType.Star),
+ ShowCloseButton = false,
+ ShowPinButton = false,
+ AllowDrag = false,
+ AllowMove = false,
+ CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate"),
+ CaptionHorizontalAlignment = HorizontalAlignment.Stretch
+ };
border = new Border
- {
- Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
- BorderThickness = new Thickness(0),
- BorderBrush = Brushes.Gray
- };
+ {
+ Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
+ BorderThickness = new Thickness(0),
+ BorderBrush = Brushes.Gray
+ };
panel2 = new Grid {Margin = new Thickness(0)};
border.Child = panel2;
@@ -2549,23 +2654,23 @@ namespace BeWo.View.Detail
group.Items.Add(layoutPanel2);
layoutPanel3 = new LayoutPanel
- {
- Caption = "Punktebogen",
- ItemWidth = new GridLength(400, GridUnitType.Pixel),
- ShowCloseButton = false,
- ShowPinButton = false,
- AllowDrag = false,
- AllowMove = false,
- CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate"),
- CaptionHorizontalAlignment = HorizontalAlignment.Stretch
- };
+ {
+ Caption = "Punktebogen",
+ ItemWidth = new GridLength(400, GridUnitType.Pixel),
+ ShowCloseButton = false,
+ ShowPinButton = false,
+ AllowDrag = false,
+ AllowMove = false,
+ CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate"),
+ CaptionHorizontalAlignment = HorizontalAlignment.Stretch
+ };
border = new Border
- {
- Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
- BorderThickness = new Thickness(0),
- BorderBrush = Brushes.Gray
- };
+ {
+ Background = new SolidColorBrush(Color.FromRgb(195, 203, 206)),
+ BorderThickness = new Thickness(0),
+ BorderBrush = Brushes.Gray
+ };
panel3 = new Grid {Margin = new Thickness(0, 4, 0, 0)};
border.Child = panel3;
@@ -2581,7 +2686,8 @@ namespace BeWo.View.Detail
assessmentSheet.LayoutManager = dockLayoutManager;
}
- static void dockLayoutManager_ShowingDockHints(object sender, DevExpress.Xpf.Docking.Base.ShowingDockHintsEventArgs e)
+ static void dockLayoutManager_ShowingDockHints(object sender,
+ DevExpress.Xpf.Docking.Base.ShowingDockHintsEventArgs e)
{
e.DisableAll();
e.HideAll();
@@ -2594,11 +2700,11 @@ namespace BeWo.View.Detail
assessmentSheet.Visibility = Visibility.Collapsed;
customerDetailGrid.Visibility = Visibility.Visible;
-
+
if (dockLayoutManager != null)
dockLayoutManager.Visibility = Visibility.Collapsed;
- if (customerDetailGrid.Children.Count != 0)
+ if (customerDetailGrid.Children.Count != 0)
return;
if (panel1 != null)
@@ -2620,10 +2726,10 @@ namespace BeWo.View.Detail
{
if (dockLayoutManager == null)
CreateLayoutManager();
-
+
assessmentSheet.SetCustomer(customer, cats);
- if (assessmentSheet.Visibility == Visibility.Visible)
+ if (assessmentSheet.Visibility == Visibility.Visible)
return;
assessmentSheet.Visibility = Visibility.Visible;
@@ -2655,11 +2761,11 @@ namespace BeWo.View.Detail
}
private BaseLayoutItem lastPanel;
- private LayoutGroup lastParentGroup;
- private LayoutPanel emptyPanel;
- private int lastIndexWithinParent;
- private int lastIndexWithinRoot;
-
+ private LayoutGroup lastParentGroup;
+ private LayoutPanel emptyPanel;
+ private int lastIndexWithinParent;
+ private int lastIndexWithinRoot;
+
private void InitDockPanel()
{
if (assessmentSheet == null)
@@ -2683,7 +2789,8 @@ namespace BeWo.View.Detail
}
}
- foreach (var layoutPanel in dockLayoutManager.FloatGroups.SelectMany(floatGroup => floatGroup.Items.Cast()))
+ foreach (var layoutPanel in dockLayoutManager.FloatGroups.SelectMany(floatGroup =>
+ floatGroup.Items.Cast()))
{
AddMaximizeRestoreButtons(layoutPanel);
}
@@ -2703,14 +2810,14 @@ namespace BeWo.View.Detail
if (btn.Content.ToString() == "Maximieren")
{
- item.CaptionTemplate = (DataTemplate)FindResource("LayoutPanelCaptionTemplateMinimize");
+ item.CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplateMinimize");
//btn.Content = "Wiederherstellen";
//btn.ToolTip = btn.Content;
//btn.Style = (Style) FindResource("DockPanelRestoreButtonStyle");
-
+
MaximizeButtonClickHandler(item);
-
+
if (Equals(item, layoutPanel1))
{
popupedit_employee.Focus();
@@ -2723,10 +2830,10 @@ namespace BeWo.View.Detail
{
assessmentSheet.Focus();
}
- }
+ }
else
{
- item.CaptionTemplate = (DataTemplate)FindResource("LayoutPanelCaptionTemplate");
+ item.CaptionTemplate = (DataTemplate) FindResource("LayoutPanelCaptionTemplate");
//btn.Content = "Maximieren";
//btn.ToolTip = btn.Content;
@@ -2756,13 +2863,13 @@ namespace BeWo.View.Detail
var controlBox = item.ControlBoxContent as StackPanel;
foreach (var child in controlBox.Children)
{
- if (child is Button && ((Button)child).Content.ToString() == "Maximieren")
+ if (child is Button && ((Button) child).Content.ToString() == "Maximieren")
{
- ((Button)child).Visibility = Visibility.Collapsed;
+ ((Button) child).Visibility = Visibility.Collapsed;
}
- else if (child is Button && ((Button)child).Content.ToString() == "Wiederherstellen")
+ else if (child is Button && ((Button) child).Content.ToString() == "Wiederherstellen")
{
- ((Button)child).Visibility = Visibility.Visible;
+ ((Button) child).Visibility = Visibility.Visible;
}
}
}
@@ -2793,13 +2900,13 @@ namespace BeWo.View.Detail
foreach (var child in controlBox.Children)
{
- if (child is Button && ((Button)child).Content.ToString() == "Maximieren")
+ if (child is Button && ((Button) child).Content.ToString() == "Maximieren")
{
- ((Button)child).Visibility = Visibility.Visible;
+ ((Button) child).Visibility = Visibility.Visible;
}
- else if (child is Button && ((Button)child).Content.ToString() == "Wiederherstellen")
+ else if (child is Button && ((Button) child).Content.ToString() == "Wiederherstellen")
{
- ((Button)child).Visibility = Visibility.Collapsed;
+ ((Button) child).Visibility = Visibility.Collapsed;
}
}
}
@@ -2812,14 +2919,14 @@ namespace BeWo.View.Detail
return;
}
- var parent = item.GetRoot() as FloatGroup;
+ var parent = item.GetRoot() as FloatGroup;
var restoreBounds = new Rect(parent.FloatLocation, parent.FloatSize);
- var bounds = CalcMaximizedBounds(restoreBounds);
+ var bounds = CalcMaximizedBounds(restoreBounds);
DocumentPanel.SetRestoreBounds(parent, restoreBounds);
parent.FloatLocation = new Point(bounds.X, bounds.Y);
- parent.FloatSize = new Size(bounds.Width, bounds.Height);
+ parent.FloatSize = new Size(bounds.Width, bounds.Height);
}
private static void RestoreFloatButtonClickHandler(BaseLayoutItem item)
@@ -2834,7 +2941,7 @@ namespace BeWo.View.Detail
var bounds = DocumentPanel.GetRestoreBounds(parent);
parent.FloatLocation = new Point(bounds.X, bounds.Y);
- parent.FloatSize = new Size(bounds.Width, bounds.Height);
+ parent.FloatSize = new Size(bounds.Width, bounds.Height);
}
private void MaximizeDockButtonClickHandler(BaseLayoutItem item)
@@ -2848,7 +2955,7 @@ namespace BeWo.View.Detail
if (lastParentGroup is TabbedGroup)
{
lastIndexWithinParent = lastParentGroup.Items.IndexOf(item);
- emptyPanel = new LayoutPanel();
+ emptyPanel = new LayoutPanel();
dockLayoutManager.DockController.Insert(lastParentGroup, emptyPanel, lastParentGroup.Items.Count);
}
@@ -2869,17 +2976,17 @@ namespace BeWo.View.Detail
//if (lp != null)
// lp.Background = Brushes.Transparent;
- var width = dockLayoutManager.ActualWidth + 5;
+ var width = dockLayoutManager.ActualWidth + 5;
var height = dockLayoutManager.ActualHeight + 5;
- var pos = new Point(-5, -5);
+ var pos = new Point(-5, -5);
var restoreBounds = new Rect(pos, new Point(width, height));
- var bounds = CalcMaximizedBounds(restoreBounds);
+ var bounds = CalcMaximizedBounds(restoreBounds);
DocumentPanel.SetRestoreBounds(parent, restoreBounds);
parent.FloatLocation = new Point(restoreBounds.X, restoreBounds.Y);
- parent.FloatSize = new Size(restoreBounds.Width, restoreBounds.Height);
+ parent.FloatSize = new Size(restoreBounds.Width, restoreBounds.Height);
}
@@ -2897,7 +3004,7 @@ namespace BeWo.View.Detail
dockLayoutManager.DockController.RemovePanel(emptyPanel);
dockLayoutManager.DockController.Activate(item);
- emptyPanel = null;
+ emptyPanel = null;
lastIndexWithinParent = -1;
return;
@@ -2934,7 +3041,7 @@ namespace BeWo.View.Detail
private void ChkRowView_Checked(object sender, RoutedEventArgs e)
{
- if (srListBox == null)
+ if (srListBox == null)
return;
srListBox.Visibility = Visibility.Visible;
@@ -2964,20 +3071,20 @@ namespace BeWo.View.Detail
BeWoApp.SaveAppSettings();
}
-
+
private void SrTableView_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
//###Bars
var hitInfo = srTableView.CalcHitInfo(e.OriginalSource as DependencyObject);
- if (!hitInfo.InRow)
+ if (!hitInfo.InRow)
return;
-
+
ServiceRecordVM vm = GetSelectedServiceRecordFromGrid();
if (vm != null)
StartEdit(vm);
-
+
lastPosition = ViewModel.VMList.IndexOf(vm);
}
@@ -2994,15 +3101,15 @@ namespace BeWo.View.Detail
{
ServiceRecordVM vm = GetSelectedServiceRecordFromGrid();
- if (vm != null)
- {
- if (vm.EditAllowed)
- StartEdit(vm);
- }
+ if (vm != null)
+ {
+ if (vm.EditAllowed)
+ StartEdit(vm);
+ }
}
private void DxDeleteButton_OnItemClick(object sender, ItemClickEventArgs e)
- {
+ {
ServiceRecordVM vm = GetSelectedServiceRecordFromGrid();
lastPosition = ViewModel.VMList.IndexOf(vm);
@@ -3011,13 +3118,13 @@ namespace BeWo.View.Detail
Delete(vm);
}
- private void DxHistoryButton_OnItemClick(object sender, ItemClickEventArgs e)
+ private void DxHistoryButton_OnItemClick(object sender, ItemClickEventArgs e)
{
ServiceRecordVM vm = GetSelectedServiceRecordFromGrid();
if (vm != null && ServiceRecordVM.IsHistoryAllowed)
- ShowHistory(vm);
+ ShowHistory(vm);
}
-
+
public override void ModalPopUpCloseInvoked()
{
MainControl.CloseCurrentPopUp();
@@ -3026,39 +3133,42 @@ namespace BeWo.View.Detail
public override void ModalPopUpSaveInvoked()
{
if (_GroupOfPeopleModalPopUp != null)
- _GroupOfPeopleModalPopUp.SaveData();
+ _GroupOfPeopleModalPopUp.SaveData();
}
- private void MultiSupportConceptControl_EditGroupButtonClicked(object sender, EventArgs e)
+ private void MultiSupportConceptControl_EditGroupButtonClicked(object sender, EventArgs e)
{
OpenGroupEditView();
}
-
+
private void OpenGroupEditView()
{
VMFactory.CreateGroupOfPeopleListVMAsync(
- cb => this.Dispatch(
- delegate
- {
- if (cb.VMList.Count > 0)
- cb.EditVM = cb.VMList[0];
+ cb => this.Dispatch(
+ delegate
+ {
+ if (cb.VMList.Count > 0)
+ cb.EditVM = cb.VMList[0];
- _GroupOfPeopleModalPopUp = new GroupOfPeopleView(cb) {MinWidth = 900, MaxWidth = 900, Height = 600};
- _GroupOfPeopleModalPopUp.CommandBindings.Add(
- new CommandBinding(
- ApplicationCommands.Close,
- (s, e) =>
- {
- if (_GroupOfPeopleModalPopUp.DoSaveCheck())
- BeWoApp.MainControl.CloseCurrentPopUp();
- }));
- _GroupOfPeopleModalPopUp.GroupOfPeopleSavedOrUpdated += GroupOfPeopleModalPopUp_GroupOfPeopleSavedOrUpdated;
- BeWoApp.MainControl.ShowControlAsModalPopUp(_GroupOfPeopleModalPopUp);
- _GroupOfPeopleModalPopUp.Focus();
- }));
+ _GroupOfPeopleModalPopUp =
+ new GroupOfPeopleView(cb) {MinWidth = 900, MaxWidth = 900, Height = 600};
+ _GroupOfPeopleModalPopUp.CommandBindings.Add(
+ new CommandBinding(
+ ApplicationCommands.Close,
+ (s, e) =>
+ {
+ if (_GroupOfPeopleModalPopUp.DoSaveCheck())
+ BeWoApp.MainControl.CloseCurrentPopUp();
+ }));
+ _GroupOfPeopleModalPopUp.GroupOfPeopleSavedOrUpdated +=
+ GroupOfPeopleModalPopUp_GroupOfPeopleSavedOrUpdated;
+ BeWoApp.MainControl.ShowControlAsModalPopUp(_GroupOfPeopleModalPopUp);
+ _GroupOfPeopleModalPopUp.Focus();
+ }));
}
- private static void GroupOfPeopleModalPopUp_GroupOfPeopleSavedOrUpdated(object sender, EventArgs e)
+ private static void GroupOfPeopleModalPopUp_GroupOfPeopleSavedOrUpdated(object sender,
+ EventArgs e)
{
//ServiceFacade.DoCustomerServiceAsync(
// s => s.LoadPersonCompact(e.Data.DataContract.PersonOid.Value),
@@ -3071,67 +3181,83 @@ namespace BeWo.View.Detail
private void LinkPdfExport_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
- if ((chkGroupBooking.IsChecked == null || chkGroupBooking.IsChecked != null && chkGroupBooking.IsChecked.Value) ||
- (chkMultiBooking.IsChecked == null || chkMultiBooking.IsChecked != null && chkMultiBooking.IsChecked.Value))
- {
- return;
- }
+ if ((chkGroupBooking.IsChecked == null ||
+ chkGroupBooking.IsChecked != null && chkGroupBooking.IsChecked.Value) ||
+ (chkMultiBooking.IsChecked == null ||
+ chkMultiBooking.IsChecked != null && chkMultiBooking.IsChecked.Value))
+ {
+ return;
+ }
- long scOid = 0;
- long cOid = 0;
- long cb2scOid = 0;
- var eOid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
+ long scOid = 0;
+ long cOid = 0;
+ long cb2scOid = 0;
+ var eOid = BeWoApp.LoggedOnUser.Employee.EmployeeOid;
- var selectedNode = ViewModel.SelectedCustomerNode;
+ var selectedNode = ViewModel.SelectedCustomerNode;
- if (selectedNode != null && selectedNode.SupportConceptTreeNodeDC != null)
- {
- if (selectedNode.SupportConceptTreeNodeDC.SupportConcept != null)
- scOid = selectedNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid;
+ if (selectedNode != null && selectedNode.SupportConceptTreeNodeDC != null)
+ {
+ if (selectedNode.SupportConceptTreeNodeDC.SupportConcept != null)
+ scOid = selectedNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid;
- if (selectedNode.SupportConceptTreeNodeDC.Customer != null)
- cOid = selectedNode.SupportConceptTreeNodeDC.Customer.CustomerOid;
+ if (selectedNode.SupportConceptTreeNodeDC.Customer != null)
+ cOid = selectedNode.SupportConceptTreeNodeDC.Customer.CustomerOid;
- if (selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
- cb2scOid = selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.CostBearer2SupportConceptOid.Value;
- }
- else
- {
- if (_SelectedEmployee != null)
- {
- eOid = _SelectedEmployee.EmployeeOid;
- }
- }
+ if (selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
+ cb2scOid = selectedNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC
+ .CostBearer2SupportConceptOid.Value;
+ }
+ else
+ {
+ if (_SelectedEmployee != null)
+ {
+ eOid = _SelectedEmployee.EmployeeOid;
+ }
+ }
- var sr = ViewModel.ServiceRecordsForSelectedCustomer;
+ var sr = ViewModel.ServiceRecordsForSelectedCustomer;
- var earliestStartDate = sr.Any() ? sr.OrderBy(o => o.StartDate).First().StartDate.Value : DateTime.Now;
- var latestEndDate = sr.Any() ? sr.OrderByDescending(o => o.EndDate).First().EndDate.Value : DateTime.Now.AddSeconds(1);
+ var earliestStartDate = sr.Any() ? sr.OrderBy(o => o.StartDate).First().StartDate.Value : DateTime.Now;
+ var latestEndDate = sr.Any()
+ ? sr.OrderByDescending(o => o.EndDate).First().EndDate.Value
+ : DateTime.Now.AddSeconds(1);
- if (latestEndDate.Hour == 0 && latestEndDate.Minute == 0 && latestEndDate.Second == 1)
- {
- latestEndDate = latestEndDate.AddHours(23);
- latestEndDate = latestEndDate.AddMinutes(59);
- }
+ if (latestEndDate.Hour == 0 && latestEndDate.Minute == 0 && latestEndDate.Second == 1)
+ {
+ latestEndDate = latestEndDate.AddHours(23);
+ latestEndDate = latestEndDate.AddMinutes(59);
+ }
- ServiceFacade.DoReportServiceAsync(s => s.CreateServiceRecordListReport(eOid, cOid, scOid, cb2scOid, false, new DateTimeSpan { StartDate = earliestStartDate, StartHours = earliestStartDate.Hour, StartMinutes = earliestStartDate.Minute, EndDate = latestEndDate, EndHours = latestEndDate.Hour, EndMinutes = latestEndDate.Minute }), cb => this.Dispatch(() => BeWoUtils.ShowReportWindow(cb, "Dokumentation")));
+ ServiceFacade.DoReportServiceAsync(
+ s => s.CreateServiceRecordListReport(eOid, cOid, scOid, cb2scOid, false,
+ new DateTimeSpan
+ {
+ StartDate = earliestStartDate,
+ StartHours = earliestStartDate.Hour,
+ StartMinutes = earliestStartDate.Minute,
+ EndDate = latestEndDate,
+ EndHours = latestEndDate.Hour,
+ EndMinutes = latestEndDate.Minute
+ }), cb => this.Dispatch(() => BeWoUtils.ShowReportWindow(cb, "Dokumentation")));
}
private void PopupInfo_OnOpened(object sender, EventArgs e)
{
ServiceRecordVM vm = GetSelectedServiceRecordFromGrid();
- if (vm != null)
- {
- dxEditButton.IsEnabled = vm.EditAllowed;
- dxDeleteButton.IsEnabled = vm.DeleteAllowed;
- dxHistoryButton.IsVisible = ServiceRecordVM.IsHistoryAllowed;
- }
+ if (vm != null)
+ {
+ dxEditButton.IsEnabled = vm.EditAllowed;
+ dxDeleteButton.IsEnabled = vm.DeleteAllowed;
+ dxHistoryButton.IsVisible = ServiceRecordVM.IsHistoryAllowed;
+ }
}
private void Popupedit_employee_OnPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
- if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit)sender, e) || !BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
+ if (!BeWoUtils.CheckPopupEditClickableSpace((PopUpEdit) sender, e) ||
+ !BeWoApp.LoggedOnUser.HasRight(UserRightType.EmployeeView_View))
{
return;
}
@@ -3140,8 +3266,9 @@ namespace BeWo.View.Detail
VMFactory.CreateEmployeeVMAsync(employeeCompact.EmployeeOid,
cb => this.Dispatch(
- () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch(
- () => BeWoUtils.UpdateAllViews(employeeCompact)))));
+ () => BeWoUtils.OpenModalViewWindow(cb, this, () =>
+ this.Dispatch(
+ () => BeWoUtils.UpdateAllViews(employeeCompact)))));
}
private void ReloadButton_OnClick(object sender, RoutedEventArgs e)
@@ -3149,218 +3276,316 @@ namespace BeWo.View.Detail
ViewModel.BuildServiceRecordsForSelectedTreeNode(true);
}
- private void AddTextModuleToTextBox(string textToAdd, TextBox documentationTextBox)
- {
- var caretIndex = documentationTextBox.CaretIndex;
+ private void AddTextModuleToTextBox(string textToAdd, TextBox documentationTextBox)
+ {
+ if (!String.IsNullOrEmpty(textToAdd))
+ {
+ var caretIndex = documentationTextBox.CaretIndex;
- if(string.IsNullOrEmpty(documentationTextBox.Text))
- {
- documentationTextBox.Text = textToAdd;
- documentationTextBox.CaretIndex = documentationTextBox.Text.Length;
- }
- else
- {
- if(documentationTextBox.CaretIndex == 0)
- {
- documentationTextBox.Text = textToAdd + documentationTextBox.Text;
- }
- else if(documentationTextBox.CaretIndex == documentationTextBox.Text.Length)
- {
- documentationTextBox.Text = documentationTextBox.Text + textToAdd;
- }
- else
- {
- var anzahlLeerzeichen = documentationTextBox.CaretIndex - documentationTextBox.Text.Length;
+ if (string.IsNullOrEmpty(documentationTextBox.Text))
+ {
+ documentationTextBox.Text = textToAdd;
+ documentationTextBox.CaretIndex = documentationTextBox.Text.Length;
+ }
+ else
+ {
+ if (documentationTextBox.CaretIndex == 0)
+ {
+ documentationTextBox.Text = textToAdd + documentationTextBox.Text;
+ }
+ else if (documentationTextBox.CaretIndex == documentationTextBox.Text.Length)
+ {
+ documentationTextBox.Text = documentationTextBox.Text + textToAdd;
+ }
+ else
+ {
+ var anzahlLeerzeichen = documentationTextBox.CaretIndex - documentationTextBox.Text.Length;
- var leerzeichen = string.Empty;
- for(var i = 0; i < anzahlLeerzeichen; i++)
- {
- leerzeichen += " ";
- }
+ var leerzeichen = string.Empty;
+ for (var i = 0; i < anzahlLeerzeichen; i++)
+ {
+ leerzeichen += " ";
+ }
- var start = documentationTextBox.Text.Substring(0, documentationTextBox.CaretIndex - anzahlLeerzeichen);
- var ende = documentationTextBox.Text.Substring(documentationTextBox.CaretIndex - anzahlLeerzeichen);
+ var start = documentationTextBox.Text.Substring(0,
+ documentationTextBox.CaretIndex - anzahlLeerzeichen);
+ var ende = documentationTextBox.Text.Substring(
+ documentationTextBox.CaretIndex - anzahlLeerzeichen);
- documentationTextBox.Text = start + leerzeichen + textToAdd + ende;
- }
+ documentationTextBox.Text = start + leerzeichen + textToAdd + ende;
+ }
- documentationTextBox.CaretIndex = caretIndex + textToAdd.Length;
- }
+ documentationTextBox.CaretIndex = caretIndex + textToAdd.Length;
+ }
- if(grosseDokuTextBox == null)
- {
- documentationTextBox.Focus();
- }
- else
- {
- grosseDokuTextBox.Text = documentationTextBox.Text;
- }
- }
+ if (grosseDokuTextBox == null)
+ {
+ documentationTextBox.Focus();
+ }
+ else
+ {
+ grosseDokuTextBox.Text = documentationTextBox.Text;
+ }
+ }
+ }
- private static void AddTextModuleToRichEditControl(string textToAdd, IRichEditDocumentServer richEditControl)
- {
- if(string.IsNullOrEmpty(richEditControl.Text))
- {
- richEditControl.Text = textToAdd;
- richEditControl.Document.CaretPosition = richEditControl.Document.Range.End;
- }
- else
- {
- if(richEditControl.Document.CaretPosition.ToInt() == 0)
- {
- richEditControl.Text = textToAdd + richEditControl.Text;
- }
- else if(richEditControl.Document.CaretPosition == richEditControl.Document.Range.End)
- {
- richEditControl.Text = richEditControl.Text + textToAdd;
- }
- else
- {
- var anzahlLeerzeichen = richEditControl.Document.CaretPosition.ToInt() - richEditControl.Text.Length;
+ private static void AddTextModuleToRichEditControl(string textToAdd, RichEditControl richEditControl)
+ {
+ if (!String.IsNullOrWhiteSpace(textToAdd))
+ {
+ var oldPos = richEditControl.Document.CaretPosition.ToInt();
- var leerzeichen = string.Empty;
- for(var i = 0; i < anzahlLeerzeichen; i++)
- {
- leerzeichen += " ";
- }
+ var pos = richEditControl.Document.CaretPosition;
+ var doc = pos.BeginUpdateDocument();
+ doc.InsertText(pos, textToAdd);
+ richEditControl.Document.CaretPosition =
+ richEditControl.Document.CreatePosition(oldPos + textToAdd.Length);
- var start = richEditControl.Text.Substring(0, richEditControl.Document.CaretPosition.ToInt() - anzahlLeerzeichen);
- var ende = richEditControl.Text.Substring(richEditControl.Document.CaretPosition.ToInt() - anzahlLeerzeichen);
+ pos.EndUpdateDocument(doc);
- richEditControl.Text = start + leerzeichen + textToAdd + ende;
- }
-
- richEditControl.Document.CaretPosition = richEditControl.Document.Range.End;
- }
- }
+ richEditControl.Focus();
+ }
+ }
private void Combobox_category_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var serviceCategoryComboBox = (ComboBox) sender;
- var category = (ServiceCategoryDC) serviceCategoryComboBox?.SelectedItem;
+ var category = (ServiceCategoryDC) serviceCategoryComboBox?.SelectedItem;
- if (category?.ServiceCategoryOid != null)
- {
- TextModuleTreeViewControl1.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControl2.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControl3.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControl4.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControl5.ServiceCategoryOid = category.ServiceCategoryOid;
+ if (category?.ServiceCategoryOid != null)
+ {
- TextModuleTreeViewControlRTF1.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControlRTF2.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControlRTF3.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControlRTF4.ServiceCategoryOid = category.ServiceCategoryOid;
- TextModuleTreeViewControlRTF5.ServiceCategoryOid = category.ServiceCategoryOid;
- }
+ textbausteineSearchView.ServiceCategoryOid = category.ServiceCategoryOid.Value;
+
+ // TextModuleTreeViewControl1.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControl2.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControl3.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControl4.ServiceCategoryOid = category.ServiceCategoryOid;
+ // TextModuleTreeViewControl5.ServiceCategoryOid = category.ServiceCategoryOid;
+
+ //TextModuleTreeViewControlRTF1.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControlRTF2.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControlRTF3.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControlRTF4.ServiceCategoryOid = category.ServiceCategoryOid;
+ //TextModuleTreeViewControlRTF5.ServiceCategoryOid = category.ServiceCategoryOid;
+ }
}
private void EditTextbausteineClick(object sender, RoutedEventArgs e)
{
VMFactory.CreateTextModuleListVMAsync(
- textModules => this.Dispatch(delegate
+ x => this.Dispatch(delegate
{
- var tbv = new TextModuleView(textModules) {Background = FindResource("ApplicationBackground") as LinearGradientBrush};
+ var tbv = new TextbausteinView(x) { Background = FindResource("ApplicationBackground") as LinearGradientBrush };
- var window = new BeWoWindow(tbv) {rootGroupBox = {Header = "Textbausteine"}, Width = 850, MinWidth = 850 };
+ var rootGrid2 = (Grid)tbv.root.Content;
+ var zielGrid = (Grid)rootGrid2.Children[0];
+ var cb = new CheckBox
+ {
+ Content = "Nur für mich sichtbar",
+ Margin = new Thickness(3),
+ HorizontalAlignment = HorizontalAlignment.Left,
+ VerticalAlignment = VerticalAlignment.Center
+ };
- tbv.CancelButton.Click += (o, args) =>
- {
- tbv.Focus();
- tbv.DoSaveCheck();
+ if (BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineNurEigeneBearbeiten) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleBearbeiten))
+ {
+ cb.IsEnabled = false;
+ }
- window.Close();
- };
+ var IsOnlyForEmployeeBinding = new Binding("NewVM.IsOnlyForEmployee") { Source = tbv.ViewModel, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged };
+ BindingOperations.SetBinding(cb, ToggleButton.IsCheckedProperty, IsOnlyForEmployeeBinding);
- window.Show();
- }), false, true);
+ Grid.SetColumn(cb, 0);
+ Grid.SetRow(cb, 2);
+ Grid.SetColumnSpan(cb, 4);
+
+ zielGrid.Children.Add(cb);
+
+ var stackPanel = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right };
+
+ var speichernBtn = new Button
+ {
+ Content = "Speichern und schließen",
+ HorizontalAlignment = HorizontalAlignment.Right,
+ Margin = new Thickness(3),
+ VerticalAlignment = VerticalAlignment.Center
+ };
+
+ var abbrechenBtn = new Button
+ {
+ Content = "Abbrechen",
+ HorizontalAlignment = HorizontalAlignment.Right,
+ Margin = new Thickness(3),
+ VerticalAlignment = VerticalAlignment.Center
+ };
+
+ stackPanel.Children.Add(speichernBtn);
+ stackPanel.Children.Add(abbrechenBtn);
+ Grid.SetRow(stackPanel, 2);
+
+ rootGrid2.Children.Add(stackPanel);
+ tbv.root.Header = string.Empty;
+ var window = new BeWoWindow(tbv) { Width = 514, Height = 400, rootGroupBox = { Header = "Textbausteine" } };
+
+ speichernBtn.Click += (o, args) =>
+ {
+ tbv.Focus();
+ if (x.IsDirty || x.VMList.Any(vm => vm.IsDirty))
+ tbv.Save(() => { textbausteineSearchView.ServiceCategoryOid = textbausteineSearchView.ServiceCategoryOid; });
+
+ window.Close();
+ };
+
+ abbrechenBtn.Click += (o, args) =>
+ {
+ tbv.Focus();
+ tbv.DoSaveCheck();
+
+ window.Close();
+ };
+
+ window.Show();
+ }));
}
- private void EintraegeUmbuchenBtn_Click(object sender, RoutedEventArgs e)
- {
- var si = supportConceptSelectionControl.SelectedItem;
- if (si.SupportConceptTreeNodeDC == null)
- {
- MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Hilfeplan zum Umbuchen von Einträgen aus."), Translator.Translate("Kein Hilfeplan gewählt"), MessageBoxButton.OK, MessageBoxImage.Exclamation);
- return;
- }
-
- var umbuchungsView = new ServiceRecordRebookingView(si.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC) { Background = FindResource("ApplicationBackground") as LinearGradientBrush };
- if (si.SupportConceptTreeNodeDC.Customer != null)
- {
- umbuchungsView.SetSearchText(si.SupportConceptTreeNodeDC.Customer.LastNameFirstName);
- }
- var rootGrid2 = (Grid) umbuchungsView.root.Content;
- var stackPanel = new StackPanel { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom};
+ //private void EditTextbausteineClick(object sender, RoutedEventArgs e)
+ //{
+ // VMFactory.CreateTextModuleListVMAsync(
+ // textModules => this.Dispatch(delegate
+ // {
+ // var tbv = new TextModuleView(textModules)
+ // {
+ // Background = FindResource("ApplicationBackground") as LinearGradientBrush
+ // };
- var speichernBtn = new Button
- {
- Content = "Umbuchen und schließen",
- HorizontalAlignment = HorizontalAlignment.Right,
- Margin = new Thickness(3),
- VerticalAlignment = VerticalAlignment.Center
- };
+ // var window = new BeWoWindow(tbv)
+ // {
+ // rootGroupBox = {Header = "Textbausteine"},
+ // Width = 850,
+ // MinWidth = 850
+ // };
- var abbrechenBtn = new Button
- {
- Content = "Abbrechen",
- HorizontalAlignment = HorizontalAlignment.Right,
- Margin = new Thickness(3),
- VerticalAlignment = VerticalAlignment.Center
- };
+ // tbv.CancelButton.Click += (o, args) =>
+ // {
+ // tbv.Focus();
+ // tbv.DoSaveCheck();
- stackPanel.Children.Add(speichernBtn);
- stackPanel.Children.Add(abbrechenBtn);
- Grid.SetRow(stackPanel, 1);
- Grid.SetColumnSpan(stackPanel, 2);
+ // window.Close();
+ // };
- rootGrid2.Children.Add(stackPanel);
-
- var window = new BeWoWindow(umbuchungsView) { Width = 450, Height = 200, rootGroupBox = { Header = "Umbuchung" }, MinHeight = 170, ResizeMode = ResizeMode.NoResize};
-
- window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
- window.Owner = Application.Current.MainWindow;
+ // window.Show();
+ // }), false, true);
+ //}
- speichernBtn.Click += (o, args) =>
- {
- if (umbuchungsView.Zielhilfeplan == null)
- {
- MessageBox.Show(Translator.Translate("Bitte wählen Sie einen Hilfeplan auf den die Einträge umgebucht werden sollen aus."), Translator.Translate("Kein Hilfeplan gewählt"), MessageBoxButton.OK, MessageBoxImage.Exclamation);
- return;
- }
+ private void EintraegeUmbuchenBtn_Click(object sender, RoutedEventArgs e)
+ {
+ var si = supportConceptSelectionControl.SelectedItem;
+ if (si.SupportConceptTreeNodeDC == null)
+ {
+ MessageBox.Show(
+ Translator.Translate("Bitte wählen Sie einen Hilfeplan zum Umbuchen von Einträgen aus."),
+ Translator.Translate("Kein Hilfeplan gewählt"), MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ return;
+ }
- umbuchungsView.Focus();
-
- umbuchungsView.Save(records => this.Dispatch(() => ServiceFacade.DoOperationsServiceAsync(s => s.UpdateServiceRecords(records),
- () => this.Dispatch(() => ViewModel.BuildServiceRecordsForSelectedTreeNode(true)))));
+ var umbuchungsView =
+ new ServiceRecordRebookingView(si.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC)
+ {
+ Background = FindResource("ApplicationBackground") as LinearGradientBrush
+ };
+ if (si.SupportConceptTreeNodeDC.Customer != null)
+ {
+ umbuchungsView.SetSearchText(si.SupportConceptTreeNodeDC.Customer.LastNameFirstName);
+ }
+ var rootGrid2 = (Grid) umbuchungsView.root.Content;
+ var stackPanel = new StackPanel
+ {
+ Orientation = Orientation.Horizontal,
+ HorizontalAlignment = HorizontalAlignment.Right,
+ VerticalAlignment = VerticalAlignment.Bottom
+ };
- window.Close();
- };
+ var speichernBtn = new Button
+ {
+ Content = "Umbuchen und schließen",
+ HorizontalAlignment = HorizontalAlignment.Right,
+ Margin = new Thickness(3),
+ VerticalAlignment = VerticalAlignment.Center
+ };
- abbrechenBtn.Click += (o, args) =>
- {
- umbuchungsView.Focus();
+ var abbrechenBtn = new Button
+ {
+ Content = "Abbrechen",
+ HorizontalAlignment = HorizontalAlignment.Right,
+ Margin = new Thickness(3),
+ VerticalAlignment = VerticalAlignment.Center
+ };
- window.Close();
- };
+ stackPanel.Children.Add(speichernBtn);
+ stackPanel.Children.Add(abbrechenBtn);
+ Grid.SetRow(stackPanel, 1);
+ Grid.SetColumnSpan(stackPanel, 2);
- window.ShowDialog();
- }
+ rootGrid2.Children.Add(stackPanel);
- private void IncreaseFontSizeBtn_Click(object sender, RoutedEventArgs e)
- {
- if (BeWoApp.AppSettings.ShowRtfTextfeld)
- {
- richEditControl1.FontSize++;
- richEditControl2.FontSize++;
- richEditControl3.FontSize++;
- richEditControl4.FontSize++;
- richEditControl5.FontSize++;
+ var window = new BeWoWindow(umbuchungsView)
+ {
+ Width = 450,
+ Height = 200,
+ rootGroupBox = {Header = "Umbuchung"},
+ MinHeight = 170,
+ ResizeMode = ResizeMode.NoResize
+ };
- BeWoApp.AppSettings.DocumentationFontSize = richEditControl1.FontSize;
- }
- else
- {
+ window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
+ window.Owner = Application.Current.MainWindow;
+
+ speichernBtn.Click += (o, args) =>
+ {
+ if (umbuchungsView.Zielhilfeplan == null)
+ {
+ MessageBox.Show(
+ Translator.Translate(
+ "Bitte wählen Sie einen Hilfeplan auf den die Einträge umgebucht werden sollen aus."),
+ Translator.Translate("Kein Hilfeplan gewählt"), MessageBoxButton.OK,
+ MessageBoxImage.Exclamation);
+ return;
+ }
+
+ umbuchungsView.Focus();
+
+ umbuchungsView.Save(records => this.Dispatch(() => ServiceFacade.DoOperationsServiceAsync(
+ s => s.UpdateServiceRecords(records),
+ () => this.Dispatch(() => ViewModel.BuildServiceRecordsForSelectedTreeNode(true)))));
+
+ window.Close();
+ };
+
+ abbrechenBtn.Click += (o, args) =>
+ {
+ umbuchungsView.Focus();
+
+ window.Close();
+ };
+
+ window.ShowDialog();
+ }
+
+ private void IncreaseFontSizeBtn_Click(object sender, RoutedEventArgs e)
+ {
+ if (BeWoApp.AppSettings.ShowRtfTextfield)
+ {
+ //richEditControl1.FontSize++;
+ //richEditControl2.FontSize++;
+ //richEditControl3.FontSize++;
+ //richEditControl4.FontSize++;
+ //richEditControl5.FontSize++;
+
+ //BeWoApp.AppSettings.DocumentationFontSize = richEditControl1.FontSize;
+ }
+ else
+ {
dokumentationsTextBox.FontSize++;
dokumentationsTextBox2.FontSize++;
dokumentationsTextBox3.FontSize++;
@@ -3368,67 +3593,68 @@ namespace BeWo.View.Detail
dokumentationsTextBox5.FontSize++;
BeWoApp.AppSettings.DocumentationFontSize = dokumentationsTextBox.FontSize;
- }
- }
-
- private void DecreaseFontSizeBtn_Click(object sender, RoutedEventArgs e)
- {
- if (BeWoApp.AppSettings.ShowRtfTextfeld)
- {
- if (richEditControl1.FontSize <= 1 || richEditControl2.FontSize <= 1 || richEditControl3.FontSize <= 1 ||
- richEditControl4.FontSize <= 1 || richEditControl5.FontSize <= 1)
- {
- return;
- }
-
- richEditControl1.FontSize++;
- richEditControl2.FontSize++;
- richEditControl3.FontSize++;
- richEditControl4.FontSize++;
- richEditControl5.FontSize++;
-
- BeWoApp.AppSettings.DocumentationFontSize = richEditControl1.FontSize;
}
- else
- {
- if (dokumentationsTextBox.FontSize <= 1 || dokumentationsTextBox2.FontSize <= 1 || dokumentationsTextBox3.FontSize <= 1 ||
+ }
+
+ private void DecreaseFontSizeBtn_Click(object sender, RoutedEventArgs e)
+ {
+ if (BeWoApp.AppSettings.ShowRtfTextfield)
+ {
+ //if (richEditControl1.FontSize <= 1 || richEditControl2.FontSize <= 1 || richEditControl3.FontSize <= 1 ||
+ // richEditControl4.FontSize <= 1 || richEditControl5.FontSize <= 1)
+ //{
+ // return;
+ //}
+
+ //richEditControl1.FontSize--;
+ //richEditControl2.FontSize--;
+ //richEditControl3.FontSize--;
+ //richEditControl4.FontSize--;
+ //richEditControl5.FontSize--;
+
+ //BeWoApp.AppSettings.DocumentationFontSize = richEditControl1.FontSize;
+ }
+ else
+ {
+ if (dokumentationsTextBox.FontSize <= 1 || dokumentationsTextBox2.FontSize <= 1 ||
+ dokumentationsTextBox3.FontSize <= 1 ||
dokumentationsTextBox4.FontSize <= 1 || dokumentationsTextBox5.FontSize <= 1)
{
return;
}
- dokumentationsTextBox.FontSize--;
- dokumentationsTextBox2.FontSize--;
- dokumentationsTextBox3.FontSize--;
- dokumentationsTextBox4.FontSize--;
+ dokumentationsTextBox.FontSize--;
+ dokumentationsTextBox2.FontSize--;
+ dokumentationsTextBox3.FontSize--;
+ dokumentationsTextBox4.FontSize--;
dokumentationsTextBox5.FontSize--;
BeWoApp.AppSettings.DocumentationFontSize = dokumentationsTextBox.FontSize;
}
}
- //private void ZeitraumauswahlwechselBtn_Click(object sender, RoutedEventArgs e)
- //{
- // var nAlt = NDayTextbox.Visibility;
- // NDayTextbox.Visibility = TimeIntervalComboBox.Visibility;
- // TimeIntervalComboBox.Visibility = nAlt;
- // NLadenBtn.Visibility = NDayTextbox.Visibility;
+ //private void ZeitraumauswahlwechselBtn_Click(object sender, RoutedEventArgs e)
+ //{
+ // var nAlt = NDayTextbox.Visibility;
+ // NDayTextbox.Visibility = TimeIntervalComboBox.Visibility;
+ // TimeIntervalComboBox.Visibility = nAlt;
+ // NLadenBtn.Visibility = NDayTextbox.Visibility;
- // if (TimeIntervalComboBox.Visibility == Visibility.Visible)
- // {
- // var s = (KeyValuePair
+
+ FLSGroupReport.cs
+ Designer
+
+
+ FLSListReport.cs
+ Designer
+
InvoiceCustomerReport.cs
diff --git a/Service/DCEntityMapper/CompactCustomerDC_Customer.cs b/Service/DCEntityMapper/CompactCustomerDC_Customer.cs
index 2fa65d961..78c8f41c8 100644
--- a/Service/DCEntityMapper/CompactCustomerDC_Customer.cs
+++ b/Service/DCEntityMapper/CompactCustomerDC_Customer.cs
@@ -30,7 +30,7 @@ namespace BeWo.Service.DCEntityMapper
}
else if (pEntity.TerminationDate.HasValue)
{
- pDataContract.TerminationReason = String.Format("Betreuung vorzeigt beendet am {0:dd.MM.yyyy}", pEntity.TerminationDate);
+ pDataContract.TerminationReason = String.Format("Betreuung vorzeitig beendet am {0:dd.MM.yyyy}", pEntity.TerminationDate);
}
pDataContract.AssistanceBegin = pEntity.AssistanceBegin;
diff --git a/Service/DCEntityMapper/MapperFactory.cs b/Service/DCEntityMapper/MapperFactory.cs
index 00b3c404a..cb8315408 100644
--- a/Service/DCEntityMapper/MapperFactory.cs
+++ b/Service/DCEntityMapper/MapperFactory.cs
@@ -269,7 +269,9 @@ namespace BeWo.Service.DCEntityMapper
private static TextModuleDC_TextModule _TextModuleDC_TextModule;
- private static BargeldtransaktionDC_Bargeldtransaktion _BargeldtransaktionDC_Bargeldtransaktion;
+ private static TextbausteinDC_Textbaustein _TextbausteinDC_Textbaustein;
+
+ private static BargeldtransaktionDC_Bargeldtransaktion _BargeldtransaktionDC_Bargeldtransaktion;
private static BargeldkassenDC_Bargeldkasse _bargeldkassenDCBargeldkasseDCBargeldkassenDCBargeldkasse;
@@ -294,7 +296,15 @@ namespace BeWo.Service.DCEntityMapper
}
}
- public static DepotRhythmusDC_DepotRhythmus DepotRhythmusDC_DepotRhythmus
+ public static TextbausteinDC_Textbaustein TextbausteinDC_Textbaustein
+ {
+ get
+ {
+ return _TextbausteinDC_Textbaustein ?? (_TextbausteinDC_Textbaustein = new TextbausteinDC_Textbaustein());
+ }
+ }
+
+ public static DepotRhythmusDC_DepotRhythmus DepotRhythmusDC_DepotRhythmus
{
get
{
diff --git a/Service/DCEntityMapper/TextbausteinDC_Textbaustein.cs b/Service/DCEntityMapper/TextbausteinDC_Textbaustein.cs
new file mode 100644
index 000000000..5810eb5f9
--- /dev/null
+++ b/Service/DCEntityMapper/TextbausteinDC_Textbaustein.cs
@@ -0,0 +1,58 @@
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+
+using BS.Shared.DataContracts;
+
+namespace BeWo.Service.DCEntityMapper
+{
+ public class TextbausteinDC_Textbaustein : AbstractIDCEntityMapper
+ {
+ public override TextbausteinDC MergeWithDC(Textbaustein pEntity, TextbausteinDC pDataContract)
+ {
+ pDataContract.Position = pEntity.Position;
+ pDataContract.TextbausteinVersion = pEntity.Version.Value;
+ pDataContract.TextbausteinOid = pEntity.Oid.Value;
+ pDataContract.Text = pEntity.Text;
+ pDataContract.Name = pEntity.Name;
+ pDataContract.IsOnlyForEmployee = pEntity.IsOnlyForEmployee;
+
+ if (pEntity.ServiceCategory != null)
+ pDataContract.ServiceCategory = MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewDC(pEntity.ServiceCategory);
+
+ if (pEntity.Employee != null)
+ pDataContract.Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Employee);
+
+ return pDataContract;
+ }
+
+ public override Textbaustein MergeWithEntity(TextbausteinDC pDataContract, Textbaustein pEntity)
+ {
+ ConcurrencyCheck(pDataContract.TextbausteinVersion, pEntity);
+
+ pEntity.Position = pDataContract.Position;
+ pEntity.Oid = pDataContract.TextbausteinOid;
+ pEntity.Text = pDataContract.Text;
+ pEntity.Name = pDataContract.Name;
+ pEntity.IsOnlyForEmployee = pDataContract.IsOnlyForEmployee;
+
+ if (pDataContract.ServiceCategory != null)
+ {
+ pEntity.ServiceCategory = pDataContract.ServiceCategory.ServiceCategoryOid.HasValue ?
+ DAOFactory.GenericDAO.LoadByID(pDataContract.ServiceCategory.ServiceCategoryOid.Value) :
+ MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewEntity(pDataContract.ServiceCategory);
+ }
+
+ if (pDataContract.Employee != null)
+ {
+ pEntity.Employee = DAOFactory.GenericDAO.LoadByID(pDataContract.Employee.EmployeeOid);
+ }
+
+ return pEntity;
+ }
+
+ protected override bool AreDCAndEntityEqual(TextbausteinDC pDC, Textbaustein pEntity)
+ {
+ return pDC.TextbausteinOid == pEntity.Oid;
+ }
+ }
+}
diff --git a/Service/Plugins/CustomerService.cs b/Service/Plugins/CustomerService.cs
index 6a9368028..7dba3f57e 100644
--- a/Service/Plugins/CustomerService.cs
+++ b/Service/Plugins/CustomerService.cs
@@ -11,6 +11,7 @@ using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
+using Castle.Components.DictionaryAdapter;
namespace BeWo.Service.Plugins
{
@@ -154,9 +155,8 @@ namespace BeWo.Service.Plugins
pEntity.Customer2CostBearerList.DoForEach(c2cb => dc.CostBearerReferenceNumbers[c2cb.CostBearer.Oid.Value] = c2cb.ReferenceNumber);
}
- dc.IsRelatedToEmployee = IsRelatedToEmployee(currentEmployeeOid, pEntity, teamOids);
-
-
+ SetTeamAndEmployeeRelation(dc, currentEmployeeOid, pEntity, teamOids);
+
if (fetchEmployees)
{
foreach (Employee2Customer e2c in pEntity.Employee2CustomerList)
@@ -201,10 +201,10 @@ namespace BeWo.Service.Plugins
var scProcessed = new Dictionary();
var teamOids = new Dictionary();
- if (FetchTeamsForSupportConcepts())
- {
+ //if (FetchTeamsForSupportConcepts())
+ //{
teamOids = CreateTeamOidDict(currentEmployeeOid);
- }
+ //}
foreach (var item in list)
{
@@ -245,7 +245,7 @@ namespace BeWo.Service.Plugins
customerDC.TerminationReason = cust.TerminationReason.Value;
} else if (cust.TerminationDate.HasValue)
{
- customerDC.TerminationReason = String.Format("Betreuung vorzeigt beendet am {0:dd.MM.yyyy}", cust.TerminationDate);
+ customerDC.TerminationReason = String.Format("Betreuung vorzeitig beendet am {0:dd.MM.yyyy}", cust.TerminationDate);
}
if (cust.Person.Address != null)
{
@@ -296,22 +296,8 @@ namespace BeWo.Service.Plugins
dc.CostBearerRelOids.Add(iCBRel.Oid.Value);
}
}
-
- dc.IsRelatedToEmployee = IsRelatedToEmployee(currentEmployeeOid, cust, teamOids);
- //if (currentEmployeeOid != null)
- //{
- // foreach (Employee2Customer e2c in cust.Employee2CustomerList)
- // {
- // if (!dc.IsRelatedToEmployee)
- // {
- // if (currentEmployeeOid.Value == e2c.EmployeeOid.Value)
- // {
- // dc.IsRelatedToEmployee = true;
- // }
- // }
- // }
- //}
-
+ SetTeamAndEmployeeRelation(dc.Customer, currentEmployeeOid, cust, teamOids);
+ dc.IsRelatedToEmployee = dc.Customer.IsRelatedToEmployee;
return dc;
}
@@ -341,7 +327,7 @@ namespace BeWo.Service.Plugins
return teamOids;
}
- private bool IsRelatedToEmployee(long? employeeOid, Customer customer, Dictionary teamOids)
+ private void SetTeamAndEmployeeRelation(CompactCustomerDC customerDc, long? employeeOid, Customer customer, Dictionary teamOids)
{
if (employeeOid != null)
{
@@ -349,30 +335,34 @@ namespace BeWo.Service.Plugins
{
if (employeeOid == e2c.EmployeeOid.Value)
{
- return true;
+ customerDc.IsRelatedToEmployee = true;
}
}
-
- if (teamOids != null && teamOids.Count > 0)
- {
-
-
- foreach (var t2c in customer.Team2CustomerList)
- {
- if (teamOids.ContainsKey(t2c.TeamOid.Value))
- {
- return true;
- }
-
- }
- }
-
}
- return false;
- }
+
+ if (teamOids != null && teamOids.Count > 0)
+ {
- private List CreateFlatSupportConceptCostBearerDCList(IEnumerable pEntityList, bool onlyWithAssignedCostbearer, long? employeeOid)
+ foreach (var t2c in customer.Team2CustomerList)
+ {
+ if (customerDc.RelatedTeamOids == null)
+ {
+ customerDc.RelatedTeamOids = new List();
+ }
+ customerDc.RelatedTeamOids.Add(t2c.TeamOid.Value);
+
+ if (teamOids.ContainsKey(t2c.TeamOid.Value))
+ {
+ customerDc.IsRelatedToTeam = true;
+ }
+
+ }
+ }
+ }
+
+
+ private List CreateFlatSupportConceptCostBearerDCList(IEnumerable pEntityList, bool onlyWithAssignedCostbearer, long? employeeOid)
{
var list = new List();
var customerOIDs = new Dictionary();
@@ -392,10 +382,10 @@ namespace BeWo.Service.Plugins
}
}
- if (FetchTeamsForSupportConcepts())
- {
+ //if (FetchTeamsForSupportConcepts())
+ //{
teamOids = CreateTeamOidDict(employeeOid.Value);
- }
+ //}
}
//var t = new List();
var c2sOids = new Dictionary();
@@ -414,17 +404,27 @@ namespace BeWo.Service.Plugins
dc.IsRelatedToEmployee = true;
dc.Customer.IsRelatedToEmployee = true;
}
- else if (teamOids.Count > 0)
+
+ if (teamOids != null && teamOids.Count > 0)
{
+
foreach (var t2c in sc.Customer.Team2CustomerList)
{
+ if (dc.Customer.RelatedTeamOids == null)
+ {
+ dc.Customer.RelatedTeamOids = new List();
+ }
+ dc.Customer.RelatedTeamOids.Add(t2c.TeamOid.Value);
+
if (teamOids.ContainsKey(t2c.TeamOid.Value))
{
- dc.IsRelatedToEmployee = true;
- dc.Customer.IsRelatedToEmployee = true;
+ dc.Customer.IsRelatedToTeam = true;
}
+
}
}
+
+
list.Add(dc);
c2sOids.Add(cb2sc.Oid.Value, true);
}
@@ -535,7 +535,7 @@ namespace BeWo.Service.Plugins
}
else
{
- dc.TerminationReason = String.Format("Betreuung vorzeigt beendet am {0:dd.MM.yyyy}", pEntity.TerminationDate);
+ dc.TerminationReason = String.Format("Betreuung vorzeitig beendet am {0:dd.MM.yyyy}", pEntity.TerminationDate);
}
}
dc.Sex = pEntity.Person.Sex;
diff --git a/Service/Plugins/GroupDurationCalculator.cs b/Service/Plugins/GroupDurationCalculator.cs
index b3fbfa4e4..a80669b20 100644
--- a/Service/Plugins/GroupDurationCalculator.cs
+++ b/Service/Plugins/GroupDurationCalculator.cs
@@ -58,7 +58,7 @@ namespace BeWo.Service.Plugins
}
else
{
- durationForSingleRecord = Math.Round(durationForGroup /group.CustomerCount, MidpointRounding.AwayFromZero);
+ durationForSingleRecord = Math.Round(durationForGroup /group.CustomerCount, 2, MidpointRounding.AwayFromZero);
}
foreach (var sr in group.ServiceRecordList)
diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs
index e19f33956..7c5238a21 100644
--- a/Service/Plugins/PluginLoader.cs
+++ b/Service/Plugins/PluginLoader.cs
@@ -40,7 +40,7 @@ namespace BeWo.Service.Plugins
//t = "5805202339"; // Wegweiser Betreuungsdienst
//t = "2301474784"; // Hauskrankenpflege Leiendecker
//t = "8243565510"; // Der Karren
- //t = "7709306800"; // Der Karren SBD
+ //t = "7709306800"; // Der Karren SBD
//t = "2499262621"; // HPH Bersenbrück
//t = "4950382346"; // Holsinger
//t = "5973016645"; // Verein Lebensgestaltung Hanau
@@ -139,7 +139,7 @@ namespace BeWo.Service.Plugins
//t = "8828216586"; // Caritas Aachen
//t = "7062943632"; // ABW Elsebrock
//t = "3956369664"; // LH Wetterau
- t = "3984525482"; // API Berlin
+ //t = "3984525482"; // API Berlin
//t = "9975231461"; // Selwo
//t = "8181286349"; // BeWo am Rhein
//t = "4595275645"; // Eigenständig
diff --git a/Service/Plugins/TranslationDictionary.cs b/Service/Plugins/TranslationDictionary.cs
index bb5675bc4..aa070954c 100644
--- a/Service/Plugins/TranslationDictionary.cs
+++ b/Service/Plugins/TranslationDictionary.cs
@@ -21,6 +21,29 @@ namespace BeWo.Service.Plugins
AddOrReplaceTranslation(dict, "MitarbeiterSingular", "Mitarbeiter");
AddOrReplaceTranslation(dict, "MitarbeiterPlural", "Mitarbeiter");
+
+ AddOrReplaceTranslation(dict, "ZeiterfassungMenuItem", "Zeiterfassung");
+ AddOrReplaceTranslation(dict, "Ergänzende DiensteMenuItem", "Ergänzende Dienste");
+ AddOrReplaceTranslation(dict, "VertretungenMenuItem", "Vertretungen");
+ AddOrReplaceTranslation(dict, "FinanzenMenuItem", "Finanzen");
+ AddOrReplaceTranslation(dict, "KalenderMenuItem", "Kalender");
+ AddOrReplaceTranslation(dict, "RessourcenMenuItem", "Ressourcen");
+ AddOrReplaceTranslation(dict, "AuswertungenMenuItem", "Auswertungen");
+ AddOrReplaceTranslation(dict, "HilfepläneMenuItem", "Hilfepläne");
+ AddOrReplaceTranslation(dict, "KlientenMenuItem", "Klienten");
+ AddOrReplaceTranslation(dict, "KliententeamsMenuItem", "Kliententeams");
+ AddOrReplaceTranslation(dict, "WohnheimeMenuItem", "Wohnheime");
+ AddOrReplaceTranslation(dict, "OrganisationenMenuItem", "Organisationen");
+ AddOrReplaceTranslation(dict, "PersonenMenuItem", "Personen");
+ AddOrReplaceTranslation(dict, "MitarbeiterMenuItem", "Mitarbeiter");
+ AddOrReplaceTranslation(dict, "TeamsMenuItem", "Teams");
+ AddOrReplaceTranslation(dict, "BenutzerMenuItem", "Benutzer");
+ AddOrReplaceTranslation(dict, "BenutzergruppenMenuItem", "Benutzergruppen");
+ AddOrReplaceTranslation(dict, "VerwaltungMenuItem", "Verwaltung");
+ AddOrReplaceTranslation(dict, "SupportMenuItem", "Support");
+
+
+
return dict;
}
diff --git a/Service/Service.csproj b/Service/Service.csproj
index c03464ec6..eb0994477 100644
--- a/Service/Service.csproj
+++ b/Service/Service.csproj
@@ -232,6 +232,7 @@
+
diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs
index 2fd7c4d5f..a06fa6e3e 100644
--- a/Service/ServiceContracts/IOperationsService.cs
+++ b/Service/ServiceContracts/IOperationsService.cs
@@ -707,5 +707,25 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
Dictionary GetTranslationDictionary();
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ IList GetAllTextbausteine();
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ IList InsertNewTextbausteine(IEnumerable pTextbausteine);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void UpdateTextbausteine(List pTextbausteine);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void DeleteTextbausteine(Dictionary pOid2Version);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ IList GetTextbausteineByServiceCategory(long pServiceCategoryOid);
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs
index 2c6748af6..c02889a78 100644
--- a/Service/ServiceImplementations/CustomerServiceImp.cs
+++ b/Service/ServiceImplementations/CustomerServiceImp.cs
@@ -2000,7 +2000,7 @@ namespace BeWo.Service.ServiceImplementations
}
else if (cust.TerminationDate.HasValue)
{
- customerDC.TerminationReason = String.Format("Betreuung vorzeigt beendet am {0:dd.MM.yyyy}", cust.TerminationDate);
+ customerDC.TerminationReason = String.Format("Betreuung vorzeitig beendet am {0:dd.MM.yyyy}", cust.TerminationDate);
}
if (cust.Person.Address != null)
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index 8d8e8bb3a..0b147b3bc 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -3072,7 +3072,7 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
- return MapperFactory.TextModuleDC_TextModule.MapToNewDCs(DAOFactory.SearchDAO.GetActiveTextbausteineByServiceCategory(pServiceCategoryOid));
+ return MapperFactory.TextModuleDC_TextModule.MapToNewDCs(DAOFactory.SearchDAO.GetActiveTextModuleByServiceCategory(pServiceCategoryOid));
}
catch (Exception e)
{
@@ -4859,6 +4859,76 @@ namespace BeWo.Service.ServiceImplementations
return null;
}
+ public IList GetAllTextbausteine()
+ {
+ try
+ {
+ return MapperFactory.TextbausteinDC_Textbaustein.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive());
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public IList GetTextbausteineByServiceCategory(long pServiceCategoryOid)
+ {
+ try
+ {
+ return MapperFactory.TextbausteinDC_Textbaustein.MapToNewDCs(DAOFactory.SearchDAO.GetActiveTextbausteineByServiceCategory(pServiceCategoryOid));
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public IList InsertNewTextbausteine(IEnumerable pTextbausteine)
+ {
+ try
+ {
+ var lTextbausteine = MapperFactory.TextbausteinDC_Textbaustein.MapToNewEntities(pTextbausteine);
+ DAOFactory.GenericDAO.Insert(lTextbausteine);
+
+ return lTextbausteine.Select(asb => asb.Oid.Value).ToList();
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public void UpdateTextbausteine(List pTextbausteine)
+ {
+ try
+ {
+ var lOriginals = DAOFactory.GenericDAO.LoadByIDs(pTextbausteine.Select(sc => sc.TextbausteinOid.Value));
+
+ MapperFactory.TextbausteinDC_Textbaustein.MergeWithEntitys(pTextbausteine, lOriginals);
+
+ DAOFactory.GenericDAO.Update(lOriginals);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ public void DeleteTextbausteine(Dictionary pOid2Version)
+ {
+ try
+ {
+ List lOriginals = DAOFactory.GenericDAO.LoadByIDs(pOid2Version.Select(e => e.Key));
+ lOriginals.DoForEach(or => MapperFactory.TextbausteinDC_Textbaustein.ConcurrencyCheck(pOid2Version[or.Oid.Value], or));
+
+ DAOFactory.GenericDAO.Delete(lOriginals);
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
#endregion
}
}
\ No newline at end of file
diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs
index 0a9d5a3f2..bf1cad38f 100644
--- a/Shared/Core/EnumTranslations.cs
+++ b/Shared/Core/EnumTranslations.cs
@@ -96,10 +96,10 @@ namespace BS.Shared.Core
UserRightType.CustomerView_View, Translator.Translate("Klienten ansehen (alle)")
},
{
- UserRightType.Customer_ViewMyCustomers, Translator.Translate("Klienten ansehen (Nur vom Mitarbeiter betreute)")
+ UserRightType.Customer_ViewMyCustomers, Translator.Translate("Klienten ansehen (von Mitarbeiter betreut)")
},
{
- UserRightType.Customer_ViewMyTeams, Translator.Translate("Klienten meines Teams ansehen")
+ UserRightType.Customer_ViewMyTeams, Translator.Translate("Klienten ansehen (von Teams betreut)")
},
{
UserRightType.DeleteAll, Translator.Translate("Alles löschen")
@@ -330,7 +330,7 @@ namespace BS.Shared.Core
UserRightType.SupportConceptView_Edit, Translator.Translate("Hilfepläne ändern")
},
{
- UserRightType.SupportConceptView_View, Translator.Translate("Hilfepläne von betreuten Klienten ansehen")
+ UserRightType.SupportConceptView_View, Translator.Translate("Hilfepläne ansehen (von Mitarbeiter betreut)")
},
{
UserRightType.SupportConcept_AllowEditGoals, Translator.Translate("Hilfepläne Ziele bearbeiten")
@@ -342,7 +342,7 @@ namespace BS.Shared.Core
UserRightType.SupportConcept_ViewAllSupportConcepts, Translator.Translate("Hilfepläne ansehen (alle)")
},
{
- UserRightType.SupportConcept_ViewMyTeams, Translator.Translate("Hilfepläne meines Teams ansehen")
+ UserRightType.SupportConcept_ViewMyTeams, Translator.Translate("Hilfepläne ansehen (von Teams betreut)")
},
{
UserRightType.SupportConcept_AllowGoalOrientedSupportConcepts, Translator.Translate("Hilfepläne zielorientiert planen")
diff --git a/Shared/DataContracts/ClientPartials/TextbausteinDC.cs b/Shared/DataContracts/ClientPartials/TextbausteinDC.cs
new file mode 100644
index 000000000..1b5ff40d9
--- /dev/null
+++ b/Shared/DataContracts/ClientPartials/TextbausteinDC.cs
@@ -0,0 +1,51 @@
+using System.Windows.Media;
+
+namespace BS.Shared.DataContracts
+{
+ public partial class TextbausteinDC : IFilterableDC
+ {
+ public override bool Equals(object obj)
+ {
+ if (obj is TextbausteinDC)
+ {
+ var y = (TextbausteinDC)obj;
+ if (TextbausteinOid == null && y.TextbausteinOid == null)
+ {
+ return GetHashCode() == y.GetHashCode();
+ }
+
+ if (TextbausteinOid != null && y.TextbausteinOid != null)
+ {
+ return TextbausteinOid == y.TextbausteinOid;
+ }
+ }
+
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return GetType().Name.GetHashCode() ^ TextbausteinOid.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+
+ public ActivationTypeId ActivationType { get; set; }
+ public string DetailDescription { get { return Text; } }
+ public string FilterRelevants { get { return Name + Text; } }
+ public string IconPath { get; private set; }
+ public string SimpleDescription { get { return Name; } }
+ public bool SupportsActivationType { get; private set; }
+
+ public long Version
+ {
+ get { return TextbausteinVersion == null ? 0 : TextbausteinVersion.Value; }
+ set { TextbausteinVersion = value; }
+ }
+
+ public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
+ }
+}
\ No newline at end of file
diff --git a/Shared/DataContracts/Compact/CompactCustomerDC.cs b/Shared/DataContracts/Compact/CompactCustomerDC.cs
index 46e34fed4..e3786accf 100644
--- a/Shared/DataContracts/Compact/CompactCustomerDC.cs
+++ b/Shared/DataContracts/Compact/CompactCustomerDC.cs
@@ -133,5 +133,8 @@ namespace BS.Shared.DataContracts.Compact
[DataMember]
public string TerminationReason { get; set; }
+
+ [DataMember]
+ public bool IsRelatedToTeam { get; set; }
}
}
\ No newline at end of file
diff --git a/Shared/DataContracts/Compact/CompactSupportConceptDC.cs b/Shared/DataContracts/Compact/CompactSupportConceptDC.cs
index fbbeb1de6..f52f42155 100644
--- a/Shared/DataContracts/Compact/CompactSupportConceptDC.cs
+++ b/Shared/DataContracts/Compact/CompactSupportConceptDC.cs
@@ -64,7 +64,7 @@ namespace BS.Shared.DataContracts.Compact
[DataMember]
public bool IsRelatedToEmployee { get; set; }
-
+
[DataMember]
public long SupportConceptOid { get; set; }
diff --git a/Shared/DataContracts/TextbausteinDC.cs b/Shared/DataContracts/TextbausteinDC.cs
new file mode 100644
index 000000000..7be5d3d5a
--- /dev/null
+++ b/Shared/DataContracts/TextbausteinDC.cs
@@ -0,0 +1,34 @@
+using System.Runtime.Serialization;
+
+using BS.Shared.DataContracts.Compact;
+
+namespace BS.Shared.DataContracts
+{
+ [DataContract]
+ public partial class TextbausteinDC : IDataContract
+ {
+ [DataMember]
+ public long? TextbausteinOid { get; set; }
+
+ [DataMember]
+ public long? TextbausteinVersion { get; set; }
+
+ [DataMember]
+ public string Text { get; set; }
+
+ [DataMember]
+ public ServiceCategoryDC ServiceCategory { get; set; }
+
+ [DataMember]
+ public int Position { get; set; }
+
+ [DataMember]
+ public string Name { get; set; }
+
+ [DataMember]
+ public CompactEmployeeDC Employee { get; set; }
+
+ [DataMember]
+ public bool IsOnlyForEmployee { get; set; }
+ }
+}
diff --git a/Shared/Services/Calculations.cs b/Shared/Services/Calculations.cs
index bb54a026a..1a0dd8ab1 100644
--- a/Shared/Services/Calculations.cs
+++ b/Shared/Services/Calculations.cs
@@ -43,11 +43,11 @@ namespace BS.Shared.Services
public virtual decimal? GetApprovedAmount(SupportConceptApprovalPeriodDC scap, List costRatePeriods)
{
- decimal t1;
- decimal t2;
+ decimal t1;
+ decimal t2;
return scap.ApprovedFixedAmount.HasValue
- ? this.GetApprovedFixedAmount(scap, out t1 , out t2)
+ ? this.GetApprovedFixedAmount(scap, out t1, out t2)
: this.GetApprovedAmountDefaultHourlyRate(scap, costRatePeriods);
}
@@ -66,27 +66,27 @@ namespace BS.Shared.Services
return null;
}
- if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEPerInterval.HasValue)
- {
- if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly && !scap.IsApprovedBEShifting)
- {
- var totalMonths = GetTotalMonths(start.Value, end.Value);
- var approvedHours = totalMonths*scap.ApprovedBEPerInterval.Value;
+ if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEPerInterval.HasValue)
+ {
+ if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly && !scap.IsApprovedBEShifting)
+ {
+ var totalMonths = GetTotalMonths(start.Value, end.Value);
+ var approvedHours = totalMonths * scap.ApprovedBEPerInterval.Value;
-
- var hourlyRate = costRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.HourlyRate, start.Value);
- var rateFactor = costRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.RateFactor, start.Value);
- decimal amount = 0;
- if (hourlyRate != null && hourlyRate.CostRateValue.HasValue)
- amount = approvedHours * hourlyRate.CostRateValue.Value;
- if (rateFactor != null && rateFactor.CostRateValue.HasValue)
- {
- amount = amount + (amount * rateFactor.CostRateValue.Value / 100);
- }
- return amount;
- }
- }
+ var hourlyRate = costRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.HourlyRate, start.Value);
+ var rateFactor = costRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.RateFactor, start.Value);
+ decimal amount = 0;
+ if (hourlyRate != null && hourlyRate.CostRateValue.HasValue)
+ amount = approvedHours * hourlyRate.CostRateValue.Value;
+ if (rateFactor != null && rateFactor.CostRateValue.HasValue)
+ {
+ amount = amount + (amount * rateFactor.CostRateValue.Value / 100);
+ }
+
+ return amount;
+ }
+ }
var approvedHoursPerDay = this.GetApprovedHoursPerDay(scap, costRatePeriods);
@@ -252,15 +252,15 @@ namespace BS.Shared.Services
.GetHoursInBE(this.GetApprovedHoursTotal(scap, costRatePeriods));
}
- public virtual decimal? GetApprovedFixedAmount(SupportConceptApprovalPeriodDC scap, out decimal amountPerUnit, out decimal unitCount)
+ public virtual decimal? GetApprovedFixedAmount(SupportConceptApprovalPeriodDC scap, out decimal amountPerUnit, out decimal unitCount)
{
return this.GetApprovedFixedAmountForPeriod(scap, scap.StartDate, scap.EndDate, out amountPerUnit, out unitCount);
}
public virtual decimal? GetApprovedFixedAmountForPeriod(SupportConceptApprovalPeriodDC scap, DateTime? pStart, DateTime? pEnd, out decimal amountPerUnit, out decimal unitCount)
{
- amountPerUnit = 0;
- unitCount = 0;
+ amountPerUnit = 0;
+ unitCount = 0;
if (!pStart.HasValue || !pEnd.HasValue || !scap.ApprovedFixedAmount.HasValue || !scap.ApprovedFixedAmountInterval.HasValue)
{
@@ -301,8 +301,8 @@ namespace BS.Shared.Services
DateTimeUnit du = pStart.Value.Date.GetDateTimeUnit(pEnd.Value.Date, tu);
amount = scap.ApprovedFixedAmount.Value * du.UnitCount;
- amountPerUnit = scap.ApprovedFixedAmount.Value;
- unitCount = du.UnitCount;
+ amountPerUnit = scap.ApprovedFixedAmount.Value;
+ unitCount = du.UnitCount;
if (du.RestDays > 0)
{
@@ -386,13 +386,13 @@ namespace BS.Shared.Services
{
return null;
}
- if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEPerInterval.HasValue)
- {
- if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
- {
- var months = GetTotalMonths(pStart.Value, pEnd.Value);
- return months*scap.ApprovedBEPerInterval.Value;
- }
+ if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEPerInterval.HasValue)
+ {
+ if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
+ {
+ var months = GetTotalMonths(pStart.Value, pEnd.Value);
+ return months * scap.ApprovedBEPerInterval.Value;
+ }
else if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Quarterly)
{
var qs = GetTotalQuarters(pStart.Value, pEnd.Value);
@@ -405,8 +405,8 @@ namespace BS.Shared.Services
return this.GetApprovedHoursPerDay(scap, costRatePeriods) * periodInDays;
}
- public virtual decimal GetTotalMonths(DateTime start, DateTime end)
- {
+ public virtual decimal GetTotalMonths(DateTime start, DateTime end)
+ {
var am = DateTimeUtils.GetTotalMonths(start, end);
return am.AnzahlMonateGesamt;
@@ -438,7 +438,7 @@ namespace BS.Shared.Services
while (startDt <= endDt)
{
startDt = startDt.AddMonths(3);
-
+
if (startDt <= endDt.AddDays(1))
{
startTemp = startDt;
@@ -486,39 +486,39 @@ namespace BS.Shared.Services
}
else if (scap.ApprovedBEPerInterval.HasValue)
{
- decimal approvedBEPerDay = 0;
- if (scap.ApprovedBEInterval.HasValue)
- {
- if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Yearly)
- {
- var totalDays = (scap.EndDate.Value - scap.StartDate.Value).Days + 1;
+ decimal approvedBEPerDay = 0;
+ if (scap.ApprovedBEInterval.HasValue)
+ {
+ if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Yearly)
+ {
+ var totalDays = (scap.EndDate.Value - scap.StartDate.Value).Days + 1;
- int totalYears = 0;
- DateTime start = scap.StartDate.Value.AddYears(1);
+ int totalYears = 0;
+ DateTime start = scap.StartDate.Value.AddYears(1);
- //Anzahl Jahre ausrechnen. Nur wenn das Enddatum genau auf das Datum eines Jahres fällt
- while (start <= scap.EndDate.Value.AddDays(1))
- {
- totalYears++;
+ //Anzahl Jahre ausrechnen. Nur wenn das Enddatum genau auf das Datum eines Jahres fällt
+ while (start <= scap.EndDate.Value.AddDays(1))
+ {
+ totalYears++;
- start = start.AddYears(1);
- if (start > scap.EndDate.Value.AddDays(1) && start != scap.EndDate.Value.AddDays(1).AddYears(1))
- totalYears = 0;
+ start = start.AddYears(1);
+ if (start > scap.EndDate.Value.AddDays(1) && start != scap.EndDate.Value.AddDays(1).AddYears(1))
+ totalYears = 0;
- }
+ }
- if (totalYears > 0)
- {
- approvedBEPerDay = (scap.ApprovedBEPerInterval.Value*totalYears)/totalDays;
+ if (totalYears > 0)
+ {
+ approvedBEPerDay = (scap.ApprovedBEPerInterval.Value * totalYears) / totalDays;
- return serviceUnit.GetBEInMinutes(approvedBEPerDay) / 60m;
- }
- }
-
- approvedBEPerDay = this.ConvertPerIntervall2PerDay(scap.ApprovedBEPerInterval.Value,
- scap.ApprovedBEInterval.Value);
- }
- return serviceUnit.GetBEInMinutes(approvedBEPerDay) / 60m;
+ return serviceUnit.GetBEInMinutes(approvedBEPerDay) / 60m;
+ }
+ }
+
+ approvedBEPerDay = this.ConvertPerIntervall2PerDay(scap.ApprovedBEPerInterval.Value,
+ scap.ApprovedBEInterval.Value);
+ }
+ return serviceUnit.GetBEInMinutes(approvedBEPerDay) / 60m;
}
return null;
@@ -723,16 +723,16 @@ namespace BS.Shared.Services
if (flatRate != null)
{
- if (record.DistanceInMeter.HasValue && record.DistanceInMeter.Value > 0)
- {
- data.UnitCount = record.DistanceInMeter.Value;
- }
- else
- {
- data.UnitCount = 1;
- }
- data.AmountPerUnit = flatRate.CostRateValue;
- data.AmountTotal = data.UnitCount * data.AmountPerUnit;
+ if (record.DistanceInMeter.HasValue && record.DistanceInMeter.Value > 0)
+ {
+ data.UnitCount = record.DistanceInMeter.Value;
+ }
+ else
+ {
+ data.UnitCount = 1;
+ }
+ data.AmountPerUnit = flatRate.CostRateValue;
+ data.AmountTotal = data.UnitCount * data.AmountPerUnit;
data.AccountingInterval = AccountingIntervalType.FlatRate;
}
else
@@ -740,16 +740,16 @@ namespace BS.Shared.Services
if (hourlyRate == null)
hourlyRate = this.GetHourlyRatePeriodForServiceRecord(record);
- decimal rdMinutes = this.GetBillableDurationInMinutes(record);
- data.UnitCount = rdMinutes / 60m;
+ decimal rdMinutes = this.GetBillableDurationInMinutes(record);
+ data.UnitCount = rdMinutes / 60m;
- if (hourlyRate != null)
- data.AmountPerUnit = hourlyRate.CostRateValue;
+ if (hourlyRate != null)
+ data.AmountPerUnit = hourlyRate.CostRateValue;
+
+ data.AmountTotal = data.AmountPerUnit * data.UnitCount;
+ data.AccountingInterval = AccountingIntervalType.Hourly;
- data.AmountTotal = data.AmountPerUnit * data.UnitCount;
- data.AccountingInterval = AccountingIntervalType.Hourly;
-
}
if (useRatefactor)
@@ -932,10 +932,10 @@ namespace BS.Shared.Services
var minuteInterval = costRates.GetCostRatePeriodForDate(CostRatePeriodType.MinutesIntervall, iRecord.Start.Value);
var duration = Convert.ToDecimal((iRecord.End - iRecord.Start).Value.TotalMinutes);
- //###CB 5min
+ //###CB 5min
if (minuteInterval != null && minuteInterval.CostRateValue.HasValue && minuteInterval.CostRateValue.Value > 0)
{
- iRecord.RoundedDuration = GetRoundedDuration((int)minuteInterval.CostRateValue.Value, duration);
+ iRecord.RoundedDuration = GetRoundedDuration((int)minuteInterval.CostRateValue.Value, duration);
}
absenceTimes[absenceSpan] = 0;
@@ -1087,7 +1087,7 @@ namespace BS.Shared.Services
decimal days = Convert.ToDecimal((endDate - period.StartDate.Value).Days + 1);
if (relDC.CostBearer.IsCalculatingWithFactor && relDC.CostBearer.CostRatePeriods != null)
- {
+ {
var rateFactorsInSpan = relDC.CostBearer.CostRatePeriods.GetSpans(CostRatePeriodType.RateFactor, period.StartDate.Value.Date, endDate).ToList();
if (rateFactorsInSpan.Count > 1)
@@ -1126,44 +1126,44 @@ namespace BS.Shared.Services
return totalApproved;
}
- public virtual decimal? GetApprovedHoursTillNow(SupportConceptApprovalPeriodDC scap, List costRates, DateTime? appointedDate, bool excludeRateFactor)
- {
+ public virtual decimal? GetApprovedHoursTillNow(SupportConceptApprovalPeriodDC scap, List costRates, DateTime? appointedDate, bool excludeRateFactor)
+ {
- decimal? totalApproved = null;
+ decimal? totalApproved = null;
- DateTime calcDate = (appointedDate.HasValue && appointedDate.Value < DateTime.Now.Date)
- ? appointedDate.Value
- : DateTime.Now.Date;
+ DateTime calcDate = (appointedDate.HasValue && appointedDate.Value < DateTime.Now.Date)
+ ? appointedDate.Value
+ : DateTime.Now.Date;
- if (scap.StartDate.HasValue && scap.EndDate.HasValue && calcDate >= scap.StartDate)
- {
- decimal days;
- var approvedHoursPerDay =
- GetApprovedHoursPerDay(scap, costRates) ?? 0;
+ if (scap.StartDate.HasValue && scap.EndDate.HasValue && calcDate >= scap.StartDate)
+ {
+ decimal days;
+ var approvedHoursPerDay =
+ GetApprovedHoursPerDay(scap, costRates) ?? 0;
- if (excludeRateFactor)
- {
- decimal? rateFactor = costRates.GetCurrentlyValidRateValue(CostRatePeriodType.RateFactor);
- if (rateFactor.HasValue && rateFactor.Value > 0)
- approvedHoursPerDay = (approvedHoursPerDay * 100) / (rateFactor.Value + 100);
- }
+ if (excludeRateFactor)
+ {
+ decimal? rateFactor = costRates.GetCurrentlyValidRateValue(CostRatePeriodType.RateFactor);
+ if (rateFactor.HasValue && rateFactor.Value > 0)
+ approvedHoursPerDay = (approvedHoursPerDay * 100) / (rateFactor.Value + 100);
+ }
- if (calcDate >= scap.EndDate.Value)
- {
- days = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).Days + 1);
- }
- else
- {
- days = Convert.ToDecimal((calcDate - scap.StartDate.Value).Days + 1);
- }
+ if (calcDate >= scap.EndDate.Value)
+ {
+ days = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).Days + 1);
+ }
+ else
+ {
+ days = Convert.ToDecimal((calcDate - scap.StartDate.Value).Days + 1);
+ }
- totalApproved = (days * approvedHoursPerDay);
- }
-
+ totalApproved = (days * approvedHoursPerDay);
+ }
- return totalApproved;
- }
+
+ return totalApproved;
+ }
#endregion
@@ -1177,7 +1177,7 @@ namespace BS.Shared.Services
return null;
}
-
+
public virtual decimal? GetDurationInWeeksTillNow(SupportConceptCostBearerRelDC relDC, DateTime? appointedDate)
{
@@ -1204,23 +1204,23 @@ namespace BS.Shared.Services
if (dtStart.HasValue && dtEnd.HasValue)
{
- decimal amountPerUnit;
- decimal unitCount;
+ decimal amountPerUnit;
+ decimal unitCount;
- decimal? approvalPeriodFixedAmount = GetApprovedFixedAmountForPeriod(supportConceptApprovalPeriod, dtStart, dtEnd, out amountPerUnit, out unitCount);
+ decimal? approvalPeriodFixedAmount = GetApprovedFixedAmountForPeriod(supportConceptApprovalPeriod, dtStart, dtEnd, out amountPerUnit, out unitCount);
if (approvalPeriodFixedAmount.HasValue)
{
billingDatas.Add(new BillingData()
- {
- AmountTotal = approvalPeriodFixedAmount,
- GrossAmountTotal = approvalPeriodFixedAmount,
- BillingPeriodStart = dtStart,
- BillingPeriodEnd = dtEnd,
- AccountingInterval = AccountingIntervalType.FlatRate,
- AmountPerUnit = amountPerUnit,
- UnitCount = unitCount
+ {
+ AmountTotal = approvalPeriodFixedAmount,
+ GrossAmountTotal = approvalPeriodFixedAmount,
+ BillingPeriodStart = dtStart,
+ BillingPeriodEnd = dtEnd,
+ AccountingInterval = AccountingIntervalType.FlatRate,
+ AmountPerUnit = amountPerUnit,
+ UnitCount = unitCount
- });
+ });
}
else if (supportConceptApprovalPeriod.ServiceCategory != null)
{
@@ -1232,7 +1232,7 @@ namespace BS.Shared.Services
DateTime intervalEnd = dtStart.Value;
while (intervalStart < dtEnd)
{
-
+
switch (ai.Value)
{
case AccountingIntervalType.Daily:
@@ -1259,9 +1259,9 @@ namespace BS.Shared.Services
case AccountingIntervalType.FlatRate:
intervalEnd = dtEnd.Value;
break;
- default:
- intervalEnd = dtEnd.Value;
- break;
+ default:
+ intervalEnd = dtEnd.Value;
+ break;
}
@@ -1286,48 +1286,48 @@ namespace BS.Shared.Services
}
}
-
+
return billingDatas;
}
public virtual List GetAccountingPeriods(SupportConceptCostBearerRelDC relDC, List recordDCS, DateTimeSpan span)
{
- Dictionary groupBookingDict = new Dictionary();
+ Dictionary groupBookingDict = new Dictionary();
List apList = new List();
- Dictionary ap2apDict = new Dictionary();
+ Dictionary ap2apDict = new Dictionary();
- foreach (var sr in recordDCS)
- {
- if (sr.ServiceDescription.Category.IsBillable && sr.Start.HasValue)
- {
- if (sr.GroupOid == null || !groupBookingDict.ContainsKey(sr.GroupOid.Value))
- {
- if (sr.Start.Value >= new DateTime(2015, 1, 1))
- {
- int test = 0;
- }
- AccountingPeriod ap = GetAccountingPeriodForServiceRecord(relDC, sr, span);
-
- if (ap != null)
- {
- if (ap2apDict.ContainsKey(ap))
- {
- ap2apDict[ap].ServiceRecordsInPeriod.Add(sr);
- }
- else
- {
- ap2apDict.Add(ap, ap);
- apList.Add(ap);
- }
- }
- if (sr.GroupOid != null && !groupBookingDict.ContainsKey(sr.GroupOid.Value))
- {
- groupBookingDict.Add(sr.GroupOid.Value, true);
- }
- }
- }
- }
- return apList;
+ foreach (var sr in recordDCS)
+ {
+ if (sr.ServiceDescription.Category.IsBillable && sr.Start.HasValue)
+ {
+ if (sr.GroupOid == null || !groupBookingDict.ContainsKey(sr.GroupOid.Value))
+ {
+ if (sr.Start.Value >= new DateTime(2015, 1, 1))
+ {
+ int test = 0;
+ }
+ AccountingPeriod ap = GetAccountingPeriodForServiceRecord(relDC, sr, span);
+
+ if (ap != null)
+ {
+ if (ap2apDict.ContainsKey(ap))
+ {
+ ap2apDict[ap].ServiceRecordsInPeriod.Add(sr);
+ }
+ else
+ {
+ ap2apDict.Add(ap, ap);
+ apList.Add(ap);
+ }
+ }
+ if (sr.GroupOid != null && !groupBookingDict.ContainsKey(sr.GroupOid.Value))
+ {
+ groupBookingDict.Add(sr.GroupOid.Value, true);
+ }
+ }
+ }
+ }
+ return apList;
}
public virtual AccountingPeriod GetAccountingPeriodForServiceRecord(SupportConceptCostBearerRelDC relDC, ServiceRecordDC sr, DateTimeSpan span)
@@ -1458,17 +1458,17 @@ namespace BS.Shared.Services
private CostRatePeriodDC GetPreviousCrp(CostRatePeriodDC crp, List allCrpList)
{
var oldList = allCrpList.GetOldRates(crp.CostRateType).OrderBy(i => i.EndDate);
-
+
if (!crp.EndDate.HasValue)
return oldList.LastOrDefault(c => c.EndDate.HasValue);
else
return oldList.LastOrDefault(c => c.EndDate < crp.EndDate);
-
+
}
public virtual void CalculateApprovedAmounts(AccountingPeriod ap, SupportConceptApprovalPeriodDC scap)
{
- ap.SupportConceptApprovalPeriod = scap;
+ ap.SupportConceptApprovalPeriod = scap;
if (scap.ApprovedBETotal.HasValue)
{
@@ -1519,8 +1519,8 @@ namespace BS.Shared.Services
public virtual decimal? GetApprovedAmount(AccountingPeriod ap, SupportConceptApprovalPeriodDC scap)
{
- decimal t1, t2;
-
+ decimal t1, t2;
+
return scap.ApprovedFixedAmount.HasValue
? this.GetApprovedFixedAmountForPeriod(scap, ap.PeriodStart, ap.PeriodEnd, out t1, out t2)
: this.GetApprovedAmountDefaultHourlyRateForPeriod(scap, ap.CostRatesInPeriod, ap.PeriodStart, ap.PeriodEnd);
@@ -1537,46 +1537,46 @@ namespace BS.Shared.Services
- public virtual int GetRoundedDuration(DataContracts.Compact.CompactOrganisationDC org, decimal durationInMinutes)
- {
- int minuteInterval = org.ActualMinuteIntervall;
- return GetRoundedDuration(minuteInterval, durationInMinutes);
- }
+ public virtual int GetRoundedDuration(DataContracts.Compact.CompactOrganisationDC org, decimal durationInMinutes)
+ {
+ int minuteInterval = org.ActualMinuteIntervall;
+ return GetRoundedDuration(minuteInterval, durationInMinutes);
+ }
- public virtual int GetRoundedDuration(int minuteInterval, decimal durationInMinutes)
- {
- decimal lRoundedDuration = durationInMinutes;
+ public virtual int GetRoundedDuration(int minuteInterval, decimal durationInMinutes)
+ {
+ decimal lRoundedDuration = durationInMinutes;
- if (minuteInterval > 0)
- {
- lRoundedDuration = durationInMinutes % minuteInterval != 0
- ? durationInMinutes + (minuteInterval - (durationInMinutes % minuteInterval))
- : durationInMinutes;
- }
+ if (minuteInterval > 0)
+ {
+ lRoundedDuration = durationInMinutes % minuteInterval != 0
+ ? durationInMinutes + (minuteInterval - (durationInMinutes % minuteInterval))
+ : durationInMinutes;
+ }
- return (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
- }
+ return (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
+ }
- public static AccountingIntervalType ConvertApprovalToAccountingIntervalType(SupportConceptApprovalInterval supportConceptApprovalInterval)
- {
- switch (supportConceptApprovalInterval)
- {
- case SupportConceptApprovalInterval.Daily:
- return AccountingIntervalType.Daily;
- case SupportConceptApprovalInterval.Weekly:
- return AccountingIntervalType.Weekly;
- case SupportConceptApprovalInterval.Fortnightly:
- return AccountingIntervalType.Fortnightly;
- case SupportConceptApprovalInterval.Monthly:
- return AccountingIntervalType.Monthly;
- case SupportConceptApprovalInterval.Quarterly:
- return AccountingIntervalType.Quarterly;
- case SupportConceptApprovalInterval.HalfYearly:
- return AccountingIntervalType.HalfYearly;
- default:
- return AccountingIntervalType.Yearly;
- }
- }
+ public static AccountingIntervalType ConvertApprovalToAccountingIntervalType(SupportConceptApprovalInterval supportConceptApprovalInterval)
+ {
+ switch (supportConceptApprovalInterval)
+ {
+ case SupportConceptApprovalInterval.Daily:
+ return AccountingIntervalType.Daily;
+ case SupportConceptApprovalInterval.Weekly:
+ return AccountingIntervalType.Weekly;
+ case SupportConceptApprovalInterval.Fortnightly:
+ return AccountingIntervalType.Fortnightly;
+ case SupportConceptApprovalInterval.Monthly:
+ return AccountingIntervalType.Monthly;
+ case SupportConceptApprovalInterval.Quarterly:
+ return AccountingIntervalType.Quarterly;
+ case SupportConceptApprovalInterval.HalfYearly:
+ return AccountingIntervalType.HalfYearly;
+ default:
+ return AccountingIntervalType.Yearly;
+ }
+ }
public virtual Dictionary GetAbsencesTimesNotBillable(IList absenceTimeDcs)
{
@@ -1585,11 +1585,11 @@ namespace BS.Shared.Services
{
DateTimeSpan span = new DateTimeSpan();
- if (at.Start.HasValue)
+ if (at.Start.HasValue && at.Start.Value <= DateTime.MaxValue.AddDays(-1))
{
span.StartDateTime = at.Start.Value.AddDays(1).Date;
}
- if (at.End.HasValue)
+ if (at.End.HasValue && at.End.Value > DateTime.MinValue.AddDays(1))
{
span.EndDateTime = at.End.Value.AddDays(-1).Date;
}
@@ -1618,13 +1618,17 @@ namespace BS.Shared.Services
var lResult = new List();
DateTime startDate = span.StartDate;
- DateTime endDate = span.StartDate.AddDays(6);
+ DateTime endDate = span.StartDate;
+ if (span.StartDate < DateTime.MaxValue.AddDays(-6))
+ {
+ endDate = span.StartDate.AddDays(6);
+ }
DateTime totalEnddate = span.EndDate;
- if (totalEnddate == DateTime.MaxValue.Date)
+ if (totalEnddate == DateTime.MaxValue.Date && span.StartDate < DateTime.MaxValue.AddYears(-1))
totalEnddate = span.StartDate.AddYears(1);
- while (startDate <= totalEnddate)
+ while (startDate <= totalEnddate && startDate < DateTime.MaxValue)
{
var lCurrentWorkWeek = new DateTimeSpan
{
@@ -1637,8 +1641,16 @@ namespace BS.Shared.Services
}
lResult.Add(lCurrentWorkWeek);
- startDate = endDate.AddDays(1);
- endDate = startDate.AddDays(6);
+ if (endDate < DateTime.MaxValue.Date.AddDays(-7))
+ {
+ startDate = endDate.AddDays(1);
+ endDate = startDate.AddDays(6);
+ }
+ else
+ {
+ startDate = DateTime.MaxValue;
+ }
+
}
return lResult;
diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj
index 14885db06..e1e23b0e3 100644
--- a/Shared/Shared.csproj
+++ b/Shared/Shared.csproj
@@ -158,6 +158,7 @@
+
@@ -188,6 +189,7 @@
+