diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index f6a418f29..3f072212f 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -43,12 +43,12 @@ de-DE BeWoPlaner beyondSoft GmbH - 2.0.1.198 + 2.0.1.200 true publish.htm false true - 199 + 201 2.0.1.%2a false true @@ -1112,6 +1112,7 @@ DokumenteView.xaml + TwoFactorAuthMessageDialog.xaml @@ -2480,392 +2481,392 @@ False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly False + Include + True - Include - True Assembly diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 97865f383..9979f2844 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -47,8 +47,8 @@ namespace BeWo public static LoginControl LoginControl; public static MainControl MainControl; - public static string ShortVersion = "3.2"; - public static string Version = "Version 3.2"; + public static string ShortVersion = "3.3"; + public static string Version = "Version 3.3"; public static int RenderTier = 0; diff --git a/BeWo/View/Controls/DPCtrlEmployee.cs b/BeWo/View/Controls/DPCtrlEmployee.cs index 0268bb423..c05a54d42 100644 --- a/BeWo/View/Controls/DPCtrlEmployee.cs +++ b/BeWo/View/Controls/DPCtrlEmployee.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; +using BS.Shared.Translation; namespace BeWo.View.Controls { @@ -155,7 +156,7 @@ namespace BeWo.View.Controls } else { - return "Besetzungsstatus"; + return Translator.Translate("Besetzungsstatus"); } return null; diff --git a/BeWo/View/Detail/AbsenceTimesView.xaml b/BeWo/View/Detail/AbsenceTimesView.xaml index 2d8d50eea..28e53daf5 100644 --- a/BeWo/View/Detail/AbsenceTimesView.xaml +++ b/BeWo/View/Detail/AbsenceTimesView.xaml @@ -117,7 +117,7 @@ + NavigationStyle="Cell" AllowBestFit="True" BestFitMode="Smart"/> diff --git a/BeWo/View/Detail/AbsenceTimesView.xaml.cs b/BeWo/View/Detail/AbsenceTimesView.xaml.cs index be1fdb1d0..4f3ab4a74 100644 --- a/BeWo/View/Detail/AbsenceTimesView.xaml.cs +++ b/BeWo/View/Detail/AbsenceTimesView.xaml.cs @@ -47,127 +47,64 @@ namespace BeWo.View.Detail private void AddAbsenceTimes() { + bool doSave = true; + var ueberschneidungen = PruefeAufUeberschneidungen(); - AbwesenheitenMitUeberschneidungenFaerben(ueberschneidungen); - - if (ueberschneidungen.Count == 0) + + if (ueberschneidungen.Count > 0) + { + doSave = false; + if (MessageBox.Show( + "Die Abwesenheit überschneidet sich mit mindestens einer bereits vorhandenen Abwesenheit.\nMöchten Sie trotzdem speichern?", + "BeWo Planer", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) + { + doSave = true; + } + } + + if (doSave) { AbsenceTimes?.NewVM.ValidateDates(() => { AbsenceTimes?.AddNewVMToList(); }); } - else - { - MessageBox.Show("Die Fehlzeit konnte aufgrund von einer Überschneidung mit mindestens einer anderen Fehlzeit nicht gespeichert werden.", - "BeWo Planer", MessageBoxButton.OK, MessageBoxImage.Information); - } + } private List PruefeAufUeberschneidungen() { - bool ueberschneidung = false; + var neu = AbsenceTimes.NewVM; - if(neu.End == null) - { - neu.End = neu.Start.Value.AddDays(1).AddTicks(-1); - } + + DateTime neuStart = neu.Start ?? DateTime.MinValue; + DateTime neuEnd = neu.End ?? DateTime.MaxValue; + List abwesenheitenMitUeberschneidungen = new List(); - foreach (var time in AbsenceTimes.VMList) + foreach (var alt in AbsenceTimes.VMList) { - if (time.End != null) - { - if (neu.Start > time.Start && neu.Start < time.End) //Starttag liegt genau in aktuellem Zeitraum - { - ueberschneidung = true; - } - else if (neu.Start == time.Start) //neuer Start gleicher Tag wie aktueller - { - ueberschneidung = true; - } - else if (time.Start > neu.Start && time.Start < neu.End) //aktueller Start innerhalb der neuen Abwesenheit - { - ueberschneidung = true; - } - } - else - { - if (neu.End != null) - { - if (neu.End > time.Start && neu.End < time.End) //Endtag liegt genau in aktuellem Zeitraum - { - ueberschneidung = true; - } - } + DateTime altStart = alt.Start ?? DateTime.MinValue; + DateTime altEnd = alt.End ?? DateTime.MaxValue; - if (neu.Start == time.Start) //neuer Start gleicher Tag wie aktueller - { - ueberschneidung = true; - } - else if(time.Start > neu.Start && time.Start < neu.End) //aktueller Start innerhalb der neuen Abwesenheit - { - ueberschneidung = true; - } - } - - if (ueberschneidung) + if (neuEnd >= altStart && neuStart <= altEnd) { - abwesenheitenMitUeberschneidungen.Add(time); - ueberschneidung = false; + abwesenheitenMitUeberschneidungen.Add(alt); + } } return abwesenheitenMitUeberschneidungen; } - private void AbwesenheitenMitUeberschneidungenFaerben(List abwesenheitenMitUeberschneidungen) - { - string color = ServiceFacade.DoOperationsServiceSync(s => s.GetColorForServiceRecordView2()); - string white = "#FFFFFF"; - foreach (var vm in AbsenceTimes.VMList) - { - vm.BackgroundColor = white; - } - foreach (var vm in abwesenheitenMitUeberschneidungen) - { - vm.BackgroundColor = color; - } - //foreach (var item in abwesenheitenMitUeberschneidungen) - //{ - // foreach (var vm in AbsenceTimes.VMList) - // { - // if (vm.DataContract.AbsenceTimeOid == item.DataContract.AbsenceTimeOid) - // item.BackgroundColor = color; - // else - // item.BackgroundColor = white; - // } - - //} - - } - + private void RemoveAbsenceTime() { AbsenceTimes?.VMList.Remove(DataGridAbsenceTimes.GetCurrentValue()); BeWoWpfUtils.RefreshDXGrid(DataGridAbsenceTimes); } - private void TableView_CustomRowAppearance(object sender, DevExpress.Xpf.Grid.CustomRowAppearanceEventArgs e) - { - if (e.Property != null && e.Property.Name == "Background") - { - var at = DataGridAbsenceTimes.GetRow(e.RowHandle) as AbsenceTimeVM; - if (at != null && !String.IsNullOrEmpty(at.BackgroundColor)) - { - e.Result = new SolidColorBrush((Color)ColorConverter.ConvertFromString(at.BackgroundColor)); - e.Handled = true; - } - - - } - } } } diff --git a/BeWo/View/Navigation/Filter/PersonNavigationFilter.cs b/BeWo/View/Navigation/Filter/PersonNavigationFilter.cs new file mode 100644 index 000000000..718238f81 --- /dev/null +++ b/BeWo/View/Navigation/Filter/PersonNavigationFilter.cs @@ -0,0 +1,32 @@ +using BS.Shared.DataContracts; +using BS.Shared.DataContracts.Compact; + +namespace BeWo.View.Navigation.Filter +{ + public class PersonNavigationFilter : CustomFilter + { + public PersonFilterEnum PersonFilter { get; set; } + + + public override bool IsValid(IFilterableDC dc) + { + var pdc = dc as CompactPersonDC; + if (pdc != null) + { + if (PersonFilter == PersonFilterEnum.Family) + { + return pdc.IsFamilyMember; + } + + if (PersonFilter == PersonFilterEnum.ContactPersons) + { + return !pdc.IsFamilyMember; + } + } + + return true; + } + + } +} + diff --git a/BeWo/View/Navigation/PersonNavigationView.xaml.cs b/BeWo/View/Navigation/PersonNavigationView.xaml.cs index b2cd10035..590672ffc 100644 --- a/BeWo/View/Navigation/PersonNavigationView.xaml.cs +++ b/BeWo/View/Navigation/PersonNavigationView.xaml.cs @@ -2,6 +2,7 @@ using System.IO; using System.Linq; using System.Windows; +using System.Windows.Controls; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; @@ -10,6 +11,7 @@ using BS.Shared.Extensions; using BeWo.Core; using BeWo.ServiceProxy; using BeWo.View.Detail; +using BeWo.View.Navigation.Filter; using BeWo.View.Navigation.Sorter; using BeWo.ViewModel; using Microsoft.Win32; @@ -21,6 +23,8 @@ namespace BeWo.View.Navigation /// public partial class PersonNavigationView { + private readonly ComboBox filterComboBox; + private IEnumerable objectList; private IEnumerable recentList; @@ -32,6 +36,68 @@ namespace BeWo.View.Navigation mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Person_AllowArchiving); mainNavigationView.ShowArchivedObjectsVisible = true; + + filterComboBox = new ComboBox(); + + filterComboBox.FontSize = 12; + filterComboBox.Margin = new Thickness(10, 0, 0, 0); + filterComboBox.MinWidth = 100; + filterComboBox.Style = FindResource("SortComboBox") as Style; + + var lbl = new TextBlock + { + Text = "Filter:", + FontSize = 12, + Margin = new Thickness(8, 2, -3, 0) + }; + + PersonFilterItem selectedItem = null; + if (BeWoApp.LoggedOnUser.HasRight(UserRightType.Person_FamilyView)) + { + filterComboBox.Items.Add(new PersonFilterItem(PersonFilterEnum.All)); + filterComboBox.Items.Add(new PersonFilterItem(PersonFilterEnum.ContactPersons)); + filterComboBox.Items.Add(new PersonFilterItem(PersonFilterEnum.Family)); + selectedItem = new PersonFilterItem(PersonFilterEnum.All); ; + } + else + { + filterComboBox.Visibility = Visibility.Collapsed; + lbl.Visibility = Visibility.Collapsed; + filterComboBox.Items.Add(new PersonFilterItem(PersonFilterEnum.ContactPersons)); + selectedItem = new PersonFilterItem(PersonFilterEnum.ContactPersons); ; + } + + + filterComboBox.SelectedItem = selectedItem; + filterComboBox.SelectionChanged += SupportConceptFilterComboBoxOnSelectionChanged; + + + + mainNavigationView.sortPanel.Children.Insert(3, lbl); + mainNavigationView.sortPanel.Children.Insert(4, filterComboBox); + + UpdateCustomFilter(); + } + + private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs) + { + //BeWoApp.AppSettings.CustomerFilterSupportConcepts = ((PersonFilterItem)filterComboBox.SelectedItem)?.CustomerFilter ?? CustomerFilterEnum.MyCustomer; + + //BeWoApp.SaveAppSettings(); + + UpdateCustomFilter(); + } + + private void UpdateCustomFilter() + { + mainNavigationView.CustomFilter = CreateNewPersonFilter(); + } + + private PersonNavigationFilter CreateNewPersonFilter() + { + var filter = new PersonNavigationFilter { PersonFilter = ((PersonFilterItem)filterComboBox.SelectedItem)?.Filter ?? PersonFilterEnum.ContactPersons }; + + return filter; } private void OnLoaded(object sender, RoutedEventArgs e) diff --git a/BeWoAllReports.sln b/BeWoAllReports.sln index 69073383e..3a3cc83cd 100644 --- a/BeWoAllReports.sln +++ b/BeWoAllReports.sln @@ -623,6 +623,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VereinSozialmedizinStade", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsbFassbacherHof", "ReportImp\AsbFassbacherHof\AsbFassbacherHof.csproj", "{1C43301E-860F-4691-B159-06E1C85C67D5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamPfeil", "ReportImp\TeamPfeil\TeamPfeil.csproj", "{B0C86A71-94ED-4F0D-98B3-49DB04056882}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -4994,6 +4996,22 @@ Global {1C43301E-860F-4691-B159-06E1C85C67D5}.Release|Mixed Platforms.Build.0 = Release|Any CPU {1C43301E-860F-4691-B159-06E1C85C67D5}.Release|x86.ActiveCfg = Release|Any CPU {1C43301E-860F-4691-B159-06E1C85C67D5}.Release|x86.Build.0 = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|.NET.ActiveCfg = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|.NET.Build.0 = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|x86.ActiveCfg = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Debug|x86.Build.0 = Debug|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|.NET.ActiveCfg = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|.NET.Build.0 = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|Any CPU.Build.0 = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|x86.ActiveCfg = Release|Any CPU + {B0C86A71-94ED-4F0D-98B3-49DB04056882}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -5301,6 +5319,7 @@ Global {976CC5EF-26C9-4415-84C6-33A450222F04} = {D8A691C5-146D-4613-86CC-438F02FE9106} {45D0F06F-7F3A-452A-B12B-1FC51B47493F} = {D8A691C5-146D-4613-86CC-438F02FE9106} {1C43301E-860F-4691-B159-06E1C85C67D5} = {D8A691C5-146D-4613-86CC-438F02FE9106} + {B0C86A71-94ED-4F0D-98B3-49DB04056882} = {D8A691C5-146D-4613-86CC-438F02FE9106} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FBE985BB-9F0F-4DBB-8F94-ABC37A803FF9} diff --git a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs index d827ac189..edaf22f2e 100644 --- a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs +++ b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs @@ -4,6 +4,8 @@ using System.Web.Security; using BeWo.Service.ServiceContracts; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; +using BS.Shared; +using BS.Shared.Core; using BS.Shared.DataContracts; namespace BeWoPlanerMobil.Controllers @@ -60,5 +62,22 @@ namespace BeWoPlanerMobil.Controllers return System.Web.HttpContext.Current.Session.Timeout; } } + + [Authorize] + public ActionResult UpdateSettings(string pKey, string pValue) + { + var userSettings = GetUser().Settings; + + UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, pKey, pValue, userSettings); + + var loggedInUser = GetUser(); + + if(loggedInUser?.UserOid.HasValue ?? false) + { + UserService.UpdateUserSettings(loggedInUser.UserOid.Value, userSettings); + } + + return RedirectToAction("Main"); + } } } diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index 75c8bbd62..6facbcc8f 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -2,16 +2,13 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; - +using BeWo.View.Navigation.Filter; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; -using BS.Shared; -using BS.Shared.DataContracts; +using BS.Shared.Core; using BS.Shared.DataContracts.Compact; -using static BeWoPlanerMobil.Util.MobileUtils; - namespace BeWoPlanerMobil.Controllers { public class CustomerController : AbstractBaseController @@ -49,6 +46,10 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } + var customerFilter = MobileUserSettingsUtils.GetSettingValueAsEnum(AbstractModel.UserSettings, SettingsKeys.CustomerFilterCustomers, CustomerFilterEnum.MyCustomer); + + Model.SelectedCustomerFilter = customerFilter; + InitViewModel(); return View(Model); @@ -56,14 +57,15 @@ namespace BeWoPlanerMobil.Controllers private void InitViewModel() { - if(Model == null) + if(Model == null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer")) { Logout(); } if(Model.Employee?.EmployeeOid.HasValue ?? false) { - Model.Customers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(customer => customer.LastName).ToList(); + //Model.Customers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(customer => customer.LastName).ToList(); + Model.Customers = EmployeeService.GetActiveCustomersForEmployee(Model.Employee.EmployeeOid.Value, Model.SelectedCustomerFilter).OrderBy(customer => customer.LastName).ToList(); } else { @@ -74,7 +76,7 @@ namespace BeWoPlanerMobil.Controllers [Authorize] public ActionResult PreselectCustomer(long? customerOid) { - if (!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer")) + if (Model == null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer")) { return Logout(); } @@ -96,7 +98,7 @@ namespace BeWoPlanerMobil.Controllers { try { - if (Model == null) + if (Model == null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer")) { return Logout(); } @@ -118,5 +120,26 @@ namespace BeWoPlanerMobil.Controllers return RedirectToActionPermanent("Customer"); } + + [HttpPost] + [Authorize] + public ActionResult SetCustomerFilter(FormCollection formCollection) + { + if(Model == null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer")) + { + return Logout(); + } + + var selectedCustomerFilter = formCollection[nameof(Model.SelectedCustomerFilter)]; + + if(!Enum.TryParse(selectedCustomerFilter, out CustomerFilterEnum customerFilter)) + { + customerFilter = CustomerFilterEnum.MyCustomer; + } + + UpdateSettings(SettingsKeys.CustomerFilterCustomers, customerFilter.ToString()); + + return RedirectToActionPermanent("Customer"); + } } } diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 21440c31e..71281144f 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -124,15 +124,10 @@ namespace BeWoPlanerMobil.Controllers break; } - Model.Zeitraum = zeitraum; + Model.Zeitraum = 7; } - var customerFilterRaw = UserSettingsUtils.GetSettingValue(userSettings, SettingsKeys.CustomerFilterInZeiterfassung); - - if(!Enum.TryParse(customerFilterRaw, out CustomerFilterEnum customerFilter)) - { - customerFilter = CustomerFilterEnum.MyCustomer; - } + var customerFilter = MobileUserSettingsUtils.GetSettingValueAsEnum(userSettings, SettingsKeys.CustomerFilterInZeiterfassung, CustomerFilterEnum.MyCustomer); Model.SelectedSupportConceptFilter = customerFilter; @@ -278,28 +273,6 @@ namespace BeWoPlanerMobil.Controllers return UpdateSettings(SettingsKeys.ShowExpiredSupportConcepts, newValue ? "1" : "0"); } - [Authorize] - public ActionResult UpdateSettings(string pKey, string pValue) - { - if (Model == null) - { - return Logout(); - } - - var userSettings = GetUser().Settings; - - UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, pKey, pValue, userSettings); - - var loggedInUser = GetUser(); - - if(loggedInUser?.UserOid.HasValue ?? false) - { - UserService.UpdateUserSettings(loggedInUser.UserOid.Value, userSettings); - } - - return RedirectToAction("Main"); - } - [HttpPost] public new ActionResult Logout() { @@ -523,7 +496,7 @@ namespace BeWoPlanerMobil.Controllers var providedTotal = supportConceptStatistics.MinutesProvidedTotalRounded / 60; var approvedTotal = supportConceptStatistics.MinutesApprovedTotal / 60; - var freePerWeekTotal = (approvedTotal - providedTotal) / 60; + var freePerWeekTotal = (approvedTotal - providedTotal); decimal percentage = 0; @@ -541,12 +514,15 @@ namespace BeWoPlanerMobil.Controllers var statisticPeriod = new StatisticPeriod(); - statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligungszeitraum:", "Gesamt")); - statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Geleistet diese Woche/gesamt:", $"{provided:0.00}/{providedTotal:0.00}")); - statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligt pro Woche/gesamt:", $"{approved:0.00}/{approvedTotal:0.00}")); - statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Frei pro Woche(Ø)/gesamt:", $"{freePerWeek:0.00}/{freePerWeekTotal:0.00}")); + if(supportConceptStatistics.PeriodStatistics.Count == 0) + { + statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligungszeitraum:", "Gesamt")); + statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Geleistet diese Woche/gesamt:", $"{provided:0.00}/{providedTotal:0.00}")); + statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligt pro Woche/gesamt:", $"{approved:0.00}/{approvedTotal:0.00}")); + statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Frei pro Woche(Ø)/gesamt:", $"{freePerWeek:0.00}/{freePerWeekTotal:0.00}")); - supportConceptStatisticsData.StatisticPeriods.Add(statisticPeriod); + supportConceptStatisticsData.StatisticPeriods.Add(statisticPeriod); + } foreach(var periodStatistics in supportConceptStatistics.PeriodStatistics) { @@ -556,10 +532,20 @@ namespace BeWoPlanerMobil.Controllers providedTotal = periodStatistics.MinutesProvidedTotalRounded / 60; approvedTotal = periodStatistics.MinutesApprovedTotal / 60; - freePerWeekTotal = (approvedTotal - providedTotal) / 60; + freePerWeekTotal = (approvedTotal - providedTotal); - var span = periodStatistics.SupportConceptApprovalPeriod.Span.ToDateString(); - var serviceCategoryName = periodStatistics.SupportConceptApprovalPeriod.ServiceCategory.Name + ":"; + var supportConceptApprovalPeriodSpan = periodStatistics.SupportConceptApprovalPeriod.Span; + var minVal = DateTime.Now.AddYears(-50); + var maxVal = DateTime.Now.AddYears(50); + + var sd = supportConceptApprovalPeriodSpan.StartDate; + var ed = supportConceptApprovalPeriodSpan.EndDate; + + var start = sd > minVal && sd < maxVal ? $"{sd:dd.MM.yy} " : string.Empty; + var end = ed > minVal && ed < maxVal ? $" {ed:dd.MM.yy}" : string.Empty; + + var span = $"{start}-{end}"; + var serviceCategoryName = periodStatistics.SupportConceptApprovalPeriod.ServiceCategory != null ? periodStatistics.SupportConceptApprovalPeriod.ServiceCategory.Name + ":" : "Bewilligungszeitraum:"; statisticPeriod = new StatisticPeriod(); @@ -2456,241 +2442,75 @@ namespace BeWoPlanerMobil.Controllers return signatureServiceRecordHeader + ";" + ApplyWatermark(signatureImage, Server.MapPath("../Content/images/bewoplaner_logo_big.png")); } - + [HttpPost] - [Authorize] - public ActionResult CreateGroupBooking(FormCollection formCollection) + public ActionResult LogOutAfterSessionTimeout() { - try - { - if(Model == null) - { - return Logout(); - } + Logout(); - if(Model.SelectedConceptCostBearerRelations.Count == 1) - { - var cb2ScOids = (from scDc in Model.SelectedSupportConcepts - where scDc.CostBearerRelations != null && scDc.CostBearerRelations.Count > 0 - let costBearer2SupportConceptOid = scDc.CostBearerRelations[0].CostBearer2SupportConceptOid - where costBearer2SupportConceptOid != null - select costBearer2SupportConceptOid.Value).ToList(); - - var cb2ScOidsCount = cb2ScOids.Count; - - if (cb2ScOidsCount == 1) - { - Model.CostBearer2SupportConceptOid = cb2ScOids[0]; - } - else - { - return RedirectToActionPermanent("Main"); - } - } - - string doku1; - - if(Model.Dokutypes != null && Model.Dokutypes.Length > 0) - { - doku1 = formCollection[FormCollectionConstants.Dokumentation1Key]; - } - else - { - doku1 = formCollection[FormCollectionConstants.Dokumentation6Key]; - } - - Log.Info($"CreateServiceRecord: datum:{formCollection[FormCollectionConstants.DateKey]}; start:{formCollection[FormCollectionConstants.StartKey]}; ende:{formCollection[FormCollectionConstants.EndKey]}; dauer:{formCollection[FormCollectionConstants.DurationKey]}; doku:{doku1}; aktion:{formCollection[FormCollectionConstants.HiddenInputKey]}"); - - if(string.IsNullOrEmpty(formCollection[FormCollectionConstants.DateKey])) - { - return View("Main", Model); - } - - var distanz = formCollection[FormCollectionConstants.DistanceKey]; - var distanceInMeters = 0; - - if(!string.IsNullOrEmpty(distanz)) - { - if(int.TryParse(distanz, out var parsedDistance)) - { - distanceInMeters = parsedDistance; - } - } - - var selectedCostbearerScRelOid = Model.CostBearer2SupportConceptOid < 1 ? null : Model.CostBearer2SupportConceptOid; - var datum = Convert.ToDateTime(formCollection[FormCollectionConstants.DateKey]); - - var enddatum = datum; - - var endDateString = formCollection[FormCollectionConstants.EndDateKey]; - if(endDateString != null) - { - enddatum = Convert.ToDateTime(endDateString); - } - - var start = formCollection[FormCollectionConstants.StartKey]; - var ende = formCollection[FormCollectionConstants.EndKey]; - var dauer = 0; - - if(datum > enddatum) - { - enddatum = datum; - } - - if(!string.IsNullOrEmpty(formCollection[FormCollectionConstants.DurationKey])) - { - int.TryParse(formCollection[FormCollectionConstants.DurationKey], out dauer); - } - - var doku2 = formCollection[FormCollectionConstants.Dokumentation2Key]; - var doku3 = formCollection[FormCollectionConstants.Dokumentation3Key]; - var doku4 = formCollection[FormCollectionConstants.Dokumentation4Key]; - var doku5 = formCollection[FormCollectionConstants.Dokumentation5Key]; - - var zeitenFeld = new DateTime[2]; - - if(start == string.Empty && ende == string.Empty) - { - zeitenFeld[0] = new DateTime(datum.Year, datum.Month, datum.Day, 0, 0, 1); - - if(enddatum == datum) - { - zeitenFeld[1] = new DateTime(datum.Year, datum.Month, datum.Day, 0, 0, 1).AddMinutes(dauer); - } - else - { - zeitenFeld[1] = new DateTime(enddatum.Year, enddatum.Month, enddatum.Day, 0, 0, 1).AddMinutes(dauer); - } - } - else - { - zeitenFeld = enddatum == datum ? ConvertRecordTimes(start, ende, datum, dauer) : ConvertRecordTimesWithEndDate(start, ende, datum, enddatum, dauer); - } - - if(dauer == 0 || zeitenFeld[1] != zeitenFeld[0]) - { - dauer = (int)(zeitenFeld[1] - zeitenFeld[0]).TotalMinutes; - } - - if(Model.NewServiceRecord == null) - { - return RedirectToActionPermanent("Main"); - } - - Model.NewServiceRecord.IP = Request.UserHostAddress; - - Model.NewServiceRecord.Goals = Model.SelectedGoals; - Model.NewServiceRecord.Start = zeitenFeld[0]; - Model.NewServiceRecord.End = zeitenFeld[1]; - - Model.NewServiceRecord.DistanceInMeter = distanceInMeters; - - if(Model.Employee.EmployeeOid != null) - { - if(Model.SelectedEmployee != null) - { - Model.NewServiceRecord.Employee = Model.SelectedEmployee; - } - - var sc = Model.SupportConcepts.FirstOrDefault(fod => fod.CostBearerRelations.Any(a => a.CostBearer2SupportConceptOid.HasValue && a.CostBearer2SupportConceptOid.Value.Equals(selectedCostbearerScRelOid))); - if(sc != null) - { - if(sc.SupportConceptOid != null) - { - Model.NewServiceRecord.SupportConcept = CustomerService.LoadCompactSupportConceptDC(sc.SupportConceptOid.Value, Model.Employee.EmployeeOid); - } - - Model.NewServiceRecord.Customer = sc.Customer; - - var cb2ScRel = sc.CostBearerRelations.First(f => f.CostBearer2SupportConceptOid.HasValue && f.CostBearer2SupportConceptOid.Equals(selectedCostbearerScRelOid)); - Model.NewServiceRecord.CostBearer = cb2ScRel.CostBearer; - - var intervall = Model.NewServiceRecord.CostBearer.ActualMinuteIntervall; - - if(intervall > 0) - { - Model.NewServiceRecord.RoundedDuration = dauer % intervall != 0 ? dauer + (intervall - dauer % intervall) : dauer; - } - else - { - Model.NewServiceRecord.RoundedDuration = dauer; - } - - Model.NewServiceRecord.CostBearer2SupportConceptOid = selectedCostbearerScRelOid; - } - else - { - Model.NewServiceRecord.RoundedDuration = dauer; - } - } - - Model.NewServiceRecord.DurationInStunden = ZeiterfassungsDauer.Minuten; - - Model.NewServiceRecord.ServiceRecordFormat = ServiceRecordFormate.OriginaleZeiterfassung; - - Model.NewServiceRecord.Notice = string.IsNullOrEmpty(doku1) ? null : doku1; - - Model.NewServiceRecord.Notice2 = string.IsNullOrEmpty(doku2) ? null : doku2; - Model.NewServiceRecord.Notice3 = string.IsNullOrEmpty(doku3) ? null : doku3; - Model.NewServiceRecord.Notice4 = string.IsNullOrEmpty(doku4) ? null : doku4; - Model.NewServiceRecord.Notice5 = string.IsNullOrEmpty(doku5) ? null : doku5; - - var serviceDescOid = 0L; - - if(!string.IsNullOrEmpty(formCollection[FormCollectionConstants.ServiceDescriptionKey])) - { - serviceDescOid = Convert.ToInt64(formCollection[FormCollectionConstants.ServiceDescriptionKey]); - } - else if(Model.SelectedServiceDescriptionOid.HasValue) - { - serviceDescOid = Model.SelectedServiceDescriptionOid.Value; - } - - if(serviceDescOid > 0) - { - Model.NewServiceRecord.ServiceDescription = OperationsService.GetServiceDescription(serviceDescOid); - } - - if(Model.NewServiceRecord.RoundedDuration == 0) - { - Model.NewServiceRecord.RoundedDuration = dauer; - } - - Model.NewServiceRecord.IP = Request.UserHostAddress; - Model.NewServiceRecord.InsertedOn = DateTime.Now; - Model.NewServiceRecord.InsUser = $"{MobileSessionFacade.LoggedInEmployee.FirstName} {MobileSessionFacade.LoggedInEmployee.LastName}"; - Model.NewServiceRecord.IsCreatedInMobileClient = true; - - if(Model.IsInGroupBookingMode && Model.SelectedSupportConcepts.Count > 1) - { - return SaveGroupBooking(); - } - - var oidList = OperationsService.InsertNewServiceRecords(new List { Model.NewServiceRecord }); - - Model.ServiceRecordOid = oidList[0]; - - Model.NewServiceRecord = new ServiceRecordDC(); - } - catch(Exception e) - { - Log.Error(e.Message, e); - } - - return ResetEditingMode(); + return RedirectToActionPermanent("Index", "Login", new { isSessionTimedOut = true}); } - // Wird zum Bearbeiten von Gruppenbuchungen benutzt [HttpPost] [Authorize] - public ActionResult EditServiceRecord(FormCollection formCollection) + public ActionResult SetSupportConceptFilter(FormCollection formCollection) { if(Model == null) { return Logout(); } + + var selectedSupportConceptFilter = formCollection[nameof(Model.SelectedSupportConceptFilter)]; + + if(!Enum.TryParse(selectedSupportConceptFilter, out CustomerFilterEnum customerFilter)) + { + customerFilter = CustomerFilterEnum.MyCustomer; + } + + UpdateSettings("CustomerFilterInZeiterfassung", customerFilter.ToString()); + + return RedirectToActionPermanent("Main"); + } + + [Authorize] + [HttpPost] + public ActionResult CreateOrUpdateGroupBooking(FormCollection formCollection) + { + if(Model == null) + { + return Logout(); + } + try { + if(!Model.IsInEditingMode) + { + if(Model.SelectedConceptCostBearerRelations.Count == 1) + { + var cb2ScOids = (from scDc in Model.SelectedSupportConcepts + where scDc.CostBearerRelations != null && scDc.CostBearerRelations.Count > 0 + let costBearer2SupportConceptOid = scDc.CostBearerRelations[0].CostBearer2SupportConceptOid + where costBearer2SupportConceptOid != null + select costBearer2SupportConceptOid.Value).ToList(); + + var cb2ScOidsCount = cb2ScOids.Count; + + if(cb2ScOidsCount == 1) + { + Model.CostBearer2SupportConceptOid = cb2ScOids[0]; + } + else + { + return RedirectToActionPermanent("Main"); + } + } + } + else + { + var selectedRecordOid = Model.SelectedServiceRecordOid ?? Model.SelectedServiceRecord.ServiceRecordOid; + Model.NewServiceRecord = OperationsService.GetServiceRecordById(selectedRecordOid.Value); + } + string doku1; if(Model.Dokutypes != null && Model.Dokutypes.Length > 0) @@ -2702,8 +2522,7 @@ namespace BeWoPlanerMobil.Controllers doku1 = formCollection[FormCollectionConstants.Dokumentation6Key]; } - Log.Info($"EditServiceRecord: datum:{formCollection[FormCollectionConstants.DateKey]}; start:{formCollection[FormCollectionConstants.StartKey]}; ende:{formCollection[FormCollectionConstants.EndKey]}; dauer:{formCollection[FormCollectionConstants.DurationKey]}; doku:{doku1}; aktion:Speichern"); - + // Wenn kein Datum angegeben wurde, wird die Main-Seite geladen und abgebrochen if(string.IsNullOrEmpty(formCollection[FormCollectionConstants.DateKey])) { return View("Main", Model); @@ -2775,9 +2594,6 @@ namespace BeWoPlanerMobil.Controllers dauer = (int)(zeitenFeld[1] - zeitenFeld[0]).TotalMinutes; } - var selectedRecordOid = Model.SelectedServiceRecordOid ?? Model.SelectedServiceRecord.ServiceRecordOid; - Model.NewServiceRecord = OperationsService.GetServiceRecordById(selectedRecordOid.Value); - if(Model.NewServiceRecord == null) { return RedirectToActionPermanent("Main"); @@ -2864,17 +2680,29 @@ namespace BeWoPlanerMobil.Controllers Model.NewServiceRecord.RoundedDuration = dauer; } - Model.NewServiceRecord.IP = Request.UserHostAddress; Model.NewServiceRecord.InsertedOn = DateTime.Now; Model.NewServiceRecord.InsUser = $"{MobileSessionFacade.LoggedInEmployee.FirstName} {MobileSessionFacade.LoggedInEmployee.LastName}"; Model.NewServiceRecord.IsCreatedInMobileClient = true; - if(Model.IsInGroupBookingMode && Model.SelectedSupportConcepts.Count > 1) - { - return UpdateGroupBooking(); - } - OperationsService.UpdateServiceRecords(new List { Model.NewServiceRecord }); + if(Model.IsInEditingMode) + { + if(Model.SelectedSupportConcepts.Count > 1) + { + return UpdateGroupBooking(); + } + + OperationsService.UpdateServiceRecords(new List { Model.NewServiceRecord }); + } + else + { + if(Model.SelectedSupportConcepts.Count > 1) + { + return SaveGroupBooking(); + } + + OperationsService.InsertNewServiceRecords(new List { Model.NewServiceRecord }); + } Model.NewServiceRecord = new ServiceRecordDC(); @@ -2883,41 +2711,12 @@ namespace BeWoPlanerMobil.Controllers Model.ServiceRecords = OperationsService.FindServiceRecordsForLastDays(selectedCostbearer2SupportConceptRelOid, Model.Zeitraum, Model.Employee.EmployeeOid).ToList(); } } - catch(Exception e) + catch(Exception exception) { - Log.Error(e.Message, e); + Log.Error(exception.Message, exception); } return ResetEditingMode(); } - - [HttpPost] - public ActionResult LogOutAfterSessionTimeout() - { - Logout(); - - return RedirectToActionPermanent("Index", "Login", new { isSessionTimedOut = true}); - } - - [HttpPost] - [Authorize] - public ActionResult SetSupportConceptFilter(FormCollection formCollection) - { - if(Model == null) - { - return Logout(); - } - - var selectedSupportConceptFilter = formCollection[nameof(Model.SelectedSupportConceptFilter)]; - - if(!Enum.TryParse(selectedSupportConceptFilter, out CustomerFilterEnum customerFilter)) - { - customerFilter = CustomerFilterEnum.MyCustomer; - } - - UpdateSettings("CustomerFilterInZeiterfassung", customerFilter.ToString()); - - return RedirectToActionPermanent("Main"); - } } } diff --git a/BeWoPlanerMobil/Models/AbstractModel.cs b/BeWoPlanerMobil/Models/AbstractModel.cs index 42e3dc77a..7b61b0cb0 100644 --- a/BeWoPlanerMobil/Models/AbstractModel.cs +++ b/BeWoPlanerMobil/Models/AbstractModel.cs @@ -78,5 +78,22 @@ namespace BeWoPlanerMobil.Models return user?.SettingList.FirstOrDefault(f => f.Type.Equals(SettingsType.ApplicationSettings))?.Value; } } + + public static bool IsAllowedToSeeCustomerFilter + { + get + { + var user = MobileSessionFacade.LoggedInUser; + + if(user != null) + { + return + user.CheckForRight(UserRightType.ViewAll) || + user.CheckForRight(UserRightType.Customer_ViewMyTeams); + } + + return false; + } + } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/CustomerModel.cs b/BeWoPlanerMobil/Models/CustomerModel.cs index 5ec621465..8a583eafe 100644 --- a/BeWoPlanerMobil/Models/CustomerModel.cs +++ b/BeWoPlanerMobil/Models/CustomerModel.cs @@ -2,7 +2,10 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.Mvc; +using BeWo.View.Navigation.Filter; +using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; +using BS.Shared; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; @@ -29,5 +32,47 @@ namespace BeWoPlanerMobil.Models } public JsonCustomer SelectedJsonCustomer => SelectedCustomer != null ? new JsonCustomer(SelectedCustomer) : null; + + [Display(Name = "Filter")] + public CustomerFilterEnum SelectedCustomerFilter { get; set; } + + public List CustomerFilter + { + get + { + var result = new List(); + + var user = MobileSessionFacade.LoggedInUser; + + const string allCustomers = "Alle Klienten anzeigen"; + const string myCustomersOnly = "Nur meine Klienten anzeigen"; + const string myTeamsCustomersOnly = "Nur Klienten meiner Teams anzeigen"; + + const string allCustomersValue = "0"; + const string myCustomersValue = "1"; + const string myTeamsCustomersValue = "2"; + + if(user != null) + { + if(user.CheckForRight(UserRightType.ViewAll)) + { + result.Add(new SelectListItem { Text = allCustomers, Value = allCustomersValue }); + result.Add(new SelectListItem { Text = myCustomersOnly, Value = myCustomersValue }); + + if(user.CheckForRight(UserRightType.Customer_ViewMyTeams)) + { + result.Add(new SelectListItem {Text = myTeamsCustomersOnly, Value = myTeamsCustomersValue }); + } + } + else if(user.CheckForRight(UserRightType.Customer_ViewMyTeams)) + { + result.Add(new SelectListItem { Text = myCustomersOnly, Value = myCustomersValue }); + result.Add(new SelectListItem { Text = myTeamsCustomersOnly, Value = myTeamsCustomersValue }); + } + } + + return result; + } + } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/MainModel.cs b/BeWoPlanerMobil/Models/MainModel.cs index dec6229f0..a502a9c9d 100644 --- a/BeWoPlanerMobil/Models/MainModel.cs +++ b/BeWoPlanerMobil/Models/MainModel.cs @@ -176,8 +176,6 @@ namespace BeWoPlanerMobil.Models public int Zeitraum { get; set; } - public bool SaveSignature { get; set; } - public int ErrorWert { get; set; } public bool ShowSignature { get; set; } diff --git a/BeWoPlanerMobil/Scripts/support-concept-statistics.js b/BeWoPlanerMobil/Scripts/support-concept-statistics.js index 9608c96eb..64a6c2f64 100644 --- a/BeWoPlanerMobil/Scripts/support-concept-statistics.js +++ b/BeWoPlanerMobil/Scripts/support-concept-statistics.js @@ -20,18 +20,20 @@ function getSupportConceptStatistics(cb2ScRRelOid) { try { var scStatistics = $.parseJSON(jsonObject); - $("#period-statistics-container").html(""); + $("#period-statistics-container").empty(); $.each(scStatistics.statisticPeriods, function(index, period) { - $.each(period.header2values, function(index, header2values) { + $.each(period.header2values, function(index, header2Values) { $("#period-statistics-container").append( '
' + - '
' + header2values.header + "
" + - '
' + header2values.value + "
" + + '
' + header2Values.header + "
" + + '
' + header2Values.value + "
" + "
"); }); - $("#period-statistics-container").append("
"); + if(index < (scStatistics.statisticPeriods.length - 1)) { + $("#period-statistics-container").append("
"); + } }); if (scStatistics.showDiagram === true) { diff --git a/BeWoPlanerMobil/Scripts/view-scripts/main.js b/BeWoPlanerMobil/Scripts/view-scripts/main.js index 2fb9b9381..375c58d94 100644 --- a/BeWoPlanerMobil/Scripts/view-scripts/main.js +++ b/BeWoPlanerMobil/Scripts/view-scripts/main.js @@ -266,6 +266,12 @@ function submitGroupBookingEditForm() { validateForm($("#groupBookingEditingForm")); } +function submitGroupBookingForm() { + showSpinner(); + + validateForm($("#groupBookingForm")); +} + function deactivateGroupBookingForm() { $("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button").prop("disabled", true); } diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index e171f2a44..2d91b3abf 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -6,328 +6,343 @@ }
-@using(Html.BeginForm("SelectCustomer", "Customer", FormMethod.Post, new { id = "select-customer-form" })) -{ -
-
- @Html.LabelFor(m => m.SelectedCustomerOid) -
-
- @Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "custom-select" }) -
-
-} - -@if (Model?.SelectedJsonCustomer != null) -{ -
-
-
-
-
- Eigenschaften -
-
-
- Vorname: -
-
- @Model.SelectedJsonCustomer.Vorname -
-
-
-
- Nachname: -
-
- @Model.SelectedJsonCustomer.Nachname -
-
-
-
- Geburtstag: -
-
- @Model.SelectedJsonCustomer.Geburtstag -
-
-
-
- Geschlecht: -
-
- @Model.SelectedJsonCustomer.Geschlecht -
-
-
-
-
-
-
-
-
- Adresse -
-
-
- Adresszusatz: -
-
- @Model.SelectedJsonCustomer.Adresszusatz -
-
-
-
- Straße: -
-
- @Model.SelectedJsonCustomer.Strasse -
-
-
-
- PLZ: -
-
- @Model.SelectedJsonCustomer.Postleitzahl -
-
-
-
- Ort: -
-
- @Model.SelectedJsonCustomer.Ort -
-
-
-
-
-
-
-
-
- Rechnungsadresse -
-
-
- Name: -
-
- @Model.SelectedJsonCustomer.RechnungsadresseName -
-
-
-
- Straße: -
-
- @Model.SelectedJsonCustomer.RechnungsadresseStrasse -
-
-
-
- PLZ: -
-
- @Model.SelectedJsonCustomer.RechnungsadressePostleitzahl -
-
-
-
- Ort: -
-
- @Model.SelectedJsonCustomer.RechnungsadresseOrt -
-
-
-
-
-
-
-
-
- Kontakt -
-
-
- Handy: -
- -
-
-
- Telefon: -
- -
-
-
- Fax: -
-
- @Model.SelectedJsonCustomer.Fax -
-
-
-
- Mail: -
- -
-
-
-
- - - @if(Model.SelectedJsonCustomer.Kommentar != null) + @if(AbstractModel.IsAllowedToSeeCustomerFilter) { -
-
-
-
Kommentar
+ using(Html.BeginForm("SetCustomerFilter", "Customer", FormMethod.Post)) + { +
+
+ @Html.LabelFor(m => m.SelectedCustomerFilter)
-
-
- @Model.SelectedJsonCustomer.Kommentar -
+
+ @Html.DropDownListFor(m => m.SelectedCustomerFilter, Model.CustomerFilter, new { onchange = "submitForm(this)", @class = "custom-select" })
+ } + } + + @using(Html.BeginForm("SelectCustomer", "Customer", FormMethod.Post, new { id = "select-customer-form" })) + { +
+
+ @Html.LabelFor(m => m.SelectedCustomerOid) +
+
+ @Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "custom-select" }) +
} - - @if(Model.SelectedJsonCustomer.ReferenceNumbers.Any()) + @if(Model?.SelectedJsonCustomer != null) { -
-
-
-
Aktenzeichen pro Kostenträger
-
+
+
+
-
- - - - - - - - - @foreach(var x in Model.SelectedJsonCustomer.ReferenceNumbers) - { - - - - - } - -
- Kostenträger - - Aktenzeichen -
- @x.Costbearer - - @x.ReferenceNumber -
+
+ Eigenschaften +
+
+
+ Vorname: +
+
+ @Model.SelectedJsonCustomer.Vorname +
+
+
+
+ Nachname: +
+
+ @Model.SelectedJsonCustomer.Nachname +
+
+
+
+ Geburtstag: +
+
+ @Model.SelectedJsonCustomer.Geburtstag +
+
+
+
+ Geschlecht: +
+
+ @Model.SelectedJsonCustomer.Geschlecht +
- } - - - @if(Model.SelectedJsonCustomer.Umfeldpersonen.Any()) - { -
-
-
-
Umfeld
+
+
+
+
+ Adresse +
+
+
+ Adresszusatz: +
+
+ @Model.SelectedJsonCustomer.Adresszusatz +
+
+
+
+ Straße: +
+
+ @Model.SelectedJsonCustomer.Strasse +
+
+
+
+ PLZ: +
+
+ @Model.SelectedJsonCustomer.Postleitzahl +
+
+
+
+ Ort: +
+
+ @Model.SelectedJsonCustomer.Ort +
+
+
-
-
- @foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen) - { -
-
-
- -
-
- -
-
-
-
-
-
-
- Rolle: -
-
- @umfeldPerson.Rolle -
+
+
+
+
+
+ Rechnungsadresse +
+
+
+ Name: +
+
+ @Model.SelectedJsonCustomer.RechnungsadresseName +
+
+
+
+ Straße: +
+
+ @Model.SelectedJsonCustomer.RechnungsadresseStrasse +
+
+
+
+ PLZ: +
+
+ @Model.SelectedJsonCustomer.RechnungsadressePostleitzahl +
+
+
+
+ Ort: +
+
+ @Model.SelectedJsonCustomer.RechnungsadresseOrt +
+
+
+
+
+
+
+
+
+ Kontakt +
+
+
+ Handy: +
+ +
+
+
+ Telefon: +
+ +
+
+
+ Fax: +
+
+ @Model.SelectedJsonCustomer.Fax +
+
+
+
+ Mail: +
+ +
+
+
+
+ + + @if(Model.SelectedJsonCustomer.Kommentar != null) + { +
+
+
+
Kommentar
+
+
+
+ @Model.SelectedJsonCustomer.Kommentar +
+
+
+
+ } + + + @if(Model.SelectedJsonCustomer.ReferenceNumbers.Any()) + { +
+
+
+
Aktenzeichen pro Kostenträger
+
+
+
+ + + + + + + + + @foreach(var x in Model.SelectedJsonCustomer.ReferenceNumbers) + { + + + + + } + +
+ Kostenträger + + Aktenzeichen +
+ @x.Costbearer + + @x.ReferenceNumber +
+
+
+
+
+ } + + + @if(Model.SelectedJsonCustomer.Umfeldpersonen.Any()) + { +
+
+
+
Umfeld
+
+
+
+ @foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen) + { +
+
+
+
-
-
- Adresse: -
-
- @umfeldPerson.StrNameNr
@umfeldPerson.PLZOrt -
+
+
-
-
- Tel.: -
- -
-
-
- Mobil: -
- -
-
-
- E-Mail: -
- -
-
-
- Fax: -
-
- @umfeldPerson.Fax +
+
+
+
+
+
+ Rolle: +
+
+ @umfeldPerson.Rolle +
+
+
+
+ Adresse: +
+
+ @umfeldPerson.StrNameNr
@umfeldPerson.PLZOrt +
+
+
+
+ Tel.: +
+ +
+
+
+ Mobil: +
+ +
+
+
+ E-Mail: +
+ +
+
+
+ Fax: +
+
+ @umfeldPerson.Fax +
+
-
+ }
- } +
-
+ }
} -
- }
\ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index ec25f6cd4..e46d6d08f 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -5,7 +5,7 @@ @{ ViewBag.Title = "BeWoPlaner Mobil"; - if (TempData[MobileUtils.TempDataLoginStateKey] is BeWoLoginState loginState && loginState.Message != null) + if(TempData[MobileUtils.TempDataLoginStateKey] is BeWoLoginState loginState && loginState.Message != null) { var loginStateMessage = new HtmlString(loginState.Message.Replace("\n", "
").Replace("\"", "\\")); @@ -16,8 +16,6 @@ } - + - - - - + + + + - - - - - - - - + + + + + + + +