Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

This commit is contained in:
Christian
2021-04-20 13:23:18 +02:00
14 changed files with 2005 additions and 2264 deletions

View File

@@ -595,7 +595,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8808</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -127,12 +127,7 @@ namespace BeWoPlanerMobil.Controllers
Model.Zeitraum = zeitraum;
}
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()
{
@@ -2456,241 +2429,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<ServiceRecordDC> { 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 +2509,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 +2581,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 +2667,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<ServiceRecordDC> { Model.NewServiceRecord });
if(Model.IsInEditingMode)
{
if(Model.SelectedSupportConcepts.Count > 1)
{
return UpdateGroupBooking();
}
OperationsService.UpdateServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
}
else
{
if(Model.SelectedSupportConcepts.Count > 1)
{
return SaveGroupBooking();
}
OperationsService.InsertNewServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
}
Model.NewServiceRecord = new ServiceRecordDC();
@@ -2883,41 +2698,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");
}
}
}

View File

@@ -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;
}
}
}
}

View File

@@ -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<SelectListItem> CustomerFilter
{
get
{
var result = new List<SelectListItem>();
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;
}
}
}
}

View File

@@ -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; }

View File

@@ -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(
'<div class="row">' +
'<div class="col text-secondary">' + header2values.header + "</div>" +
'<div class="col-auto">' + header2values.value + "</div>" +
'<div class="col text-secondary">' + header2Values.header + "</div>" +
'<div class="col-auto">' + header2Values.value + "</div>" +
"</div>");
});
$("#period-statistics-container").append("<hr/>");
if(index < (scStatistics.statisticPeriods.length - 1)) {
$("#period-statistics-container").append("<hr/>");
}
});
if (scStatistics.showDiagram === true) {

View File

@@ -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);
}

View File

@@ -6,328 +6,343 @@
}
<div class="container-fluid mt-3">
@using(Html.BeginForm("SelectCustomer", "Customer", FormMethod.Post, new { id = "select-customer-form" }))
{
<div class="row align-items-center">
<div class="col-sm-2 col-md-auto">
@Html.LabelFor(m => m.SelectedCustomerOid)
</div>
<div class="col-sm-10 col-md">
@Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "custom-select" })
</div>
</div>
}
@if (Model?.SelectedJsonCustomer != null)
{
<div class="row my-3">
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Eigenschaften
</div>
<div class="row">
<div class="col text-secondary">
Vorname:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Vorname
</div>
</div>
<div class="row">
<div class="col text-secondary">
Nachname:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Nachname
</div>
</div>
<div class="row">
<div class="col text-secondary">
Geburtstag:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Geburtstag
</div>
</div>
<div class="row">
<div class="col text-secondary">
Geschlecht:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Geschlecht
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
<a href="@Model.SelectedJsonCustomer.GoogleMapsLink" target="_blank" class="text-bewo-customer-card-header">Adresse<i class="fas fa-map-marker-alt ml-3"></i></a>
</div>
<div class="row">
<div class="col text-secondary">
Adresszusatz:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Adresszusatz
</div>
</div>
<div class="row">
<div class="col text-secondary">
Straße:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Strasse
</div>
</div>
<div class="row">
<div class="col text-secondary">
PLZ:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Postleitzahl
</div>
</div>
<div class="row">
<div class="col text-secondary">
Ort:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Ort
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Rechnungsadresse
</div>
<div class="row">
<div class="col text-secondary">
Name:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseName
</div>
</div>
<div class="row">
<div class="col text-secondary">
Straße:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseStrasse
</div>
</div>
<div class="row">
<div class="col text-secondary">
PLZ:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadressePostleitzahl
</div>
</div>
<div class="row">
<div class="col text-secondary">
Ort:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseOrt
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Kontakt
</div>
<div class="row">
<div class="col text-secondary">
Handy:
</div>
<div class="col-auto text-right">
<a href="tel:@Model.SelectedJsonCustomer.Handy">@Model.SelectedJsonCustomer.Handy</a>
</div>
</div>
<div class="row">
<div class="col text-secondary">
Telefon:
</div>
<div class="col-auto text-right">
<a href="tel:@Model.SelectedJsonCustomer.Telefon">@Model.SelectedJsonCustomer.Telefon</a>
</div>
</div>
<div class="row">
<div class="col text-secondary">
Fax:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Fax
</div>
</div>
<div class="row">
<div class="col text-secondary">
Mail:
</div>
<div class="col-auto text-right">
<a href="mailto:@Model.SelectedJsonCustomer.EMail">@Model.SelectedJsonCustomer.EMail</a>
</div>
</div>
</div>
</div>
</div>
<!-- Kommentar, falls vorhanden -->
@if(Model.SelectedJsonCustomer.Kommentar != null)
@if(AbstractModel.IsAllowedToSeeCustomerFilter)
{
<div class="col-12 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Kommentar</h5>
using(Html.BeginForm("SetCustomerFilter", "Customer", FormMethod.Post))
{
<div class="row mb-3 align-items-center">
<div class="col-sm-2 col-md-1">
@Html.LabelFor(m => m.SelectedCustomerFilter)
</div>
<div class="card-body">
<div class="container-fluid">
@Model.SelectedJsonCustomer.Kommentar
</div>
<div class="col-sm-10 col-md-11">
@Html.DropDownListFor(m => m.SelectedCustomerFilter, Model.CustomerFilter, new { onchange = "submitForm(this)", @class = "custom-select" })
</div>
</div>
}
}
@using(Html.BeginForm("SelectCustomer", "Customer", FormMethod.Post, new { id = "select-customer-form" }))
{
<div class="row align-items-center">
<div class="col-sm-2 col-md-1">
@Html.LabelFor(m => m.SelectedCustomerOid)
</div>
<div class="col-sm-10 col-md-11">
@Html.DropDownListFor(m => m.SelectedCustomerOid, Model.CustomerListItems, new { onchange = "submitCustomerSelectionForm();", @class = "custom-select" })
</div>
</div>
}
<!-- Aktenzeichen -->
@if(Model.SelectedJsonCustomer.ReferenceNumbers.Any())
@if(Model?.SelectedJsonCustomer != null)
{
<div class="col-md-6 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Aktenzeichen pro Kostenträger</h5>
</div>
<div class="row my-3">
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="container-fluid">
<table class="table">
<thead>
<tr>
<th class="text-left">
Kostenträger
</th>
<th class="text-right">
Aktenzeichen
</th>
</tr>
</thead>
<tbody>
@foreach(var x in Model.SelectedJsonCustomer.ReferenceNumbers)
{
<tr>
<td class="text-left">
@x.Costbearer
</td>
<td class="text-right">
@x.ReferenceNumber
</td>
</tr>
}
</tbody>
</table>
<div class="card-title text-bewo-customer-card-header">
Eigenschaften
</div>
<div class="row">
<div class="col text-secondary">
Vorname:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Vorname
</div>
</div>
<div class="row">
<div class="col text-secondary">
Nachname:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Nachname
</div>
</div>
<div class="row">
<div class="col text-secondary">
Geburtstag:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Geburtstag
</div>
</div>
<div class="row">
<div class="col text-secondary">
Geschlecht:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Geschlecht
</div>
</div>
</div>
</div>
</div>
}
<!-- Umfeld -->
@if(Model.SelectedJsonCustomer.Umfeldpersonen.Any())
{
<div class="col-md-6 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Umfeld</h5>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
<a href="@Model.SelectedJsonCustomer.GoogleMapsLink" target="_blank" class="text-bewo-customer-card-header">Adresse<i class="fas fa-map-marker-alt ml-3"></i></a>
</div>
<div class="row">
<div class="col text-secondary">
Adresszusatz:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Adresszusatz
</div>
</div>
<div class="row">
<div class="col text-secondary">
Straße:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Strasse
</div>
</div>
<div class="row">
<div class="col text-secondary">
PLZ:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Postleitzahl
</div>
</div>
<div class="row">
<div class="col text-secondary">
Ort:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Ort
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="container-fluid px-0">
@foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen)
{
<div class="card w-100 mb-3">
<div class="card-header" onclick="cardHeaderClick('#chevron-umfeldperson-@umfeldPerson.Customer2PersonOid', '#collapse-umfeldperson-@umfeldPerson.Customer2PersonOid')">
<div class="d-inline-flex">
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-umfeldperson-@umfeldPerson.Customer2PersonOid"></i>
</div>
<div class="p2 d-inline-flex text-primary h-100">
<button type="button" class="btn btn-link">
@umfeldPerson.FormattedName
</button>
</div>
</div>
<div class="collapse" id="collapse-umfeldperson-@umfeldPerson.Customer2PersonOid">
<div class="card-body">
<div class="container-fluid">
<div class="row mb-3">
<div class="col text-secondary text-left">
Rolle:
</div>
<div class="col-auto text-right">
@umfeldPerson.Rolle
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Rechnungsadresse
</div>
<div class="row">
<div class="col text-secondary">
Name:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseName
</div>
</div>
<div class="row">
<div class="col text-secondary">
Straße:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseStrasse
</div>
</div>
<div class="row">
<div class="col text-secondary">
PLZ:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadressePostleitzahl
</div>
</div>
<div class="row">
<div class="col text-secondary">
Ort:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.RechnungsadresseOrt
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6 col-lg-3 mt-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Kontakt
</div>
<div class="row">
<div class="col text-secondary">
Handy:
</div>
<div class="col-auto text-right">
<a href="tel:@Model.SelectedJsonCustomer.Handy">@Model.SelectedJsonCustomer.Handy</a>
</div>
</div>
<div class="row">
<div class="col text-secondary">
Telefon:
</div>
<div class="col-auto text-right">
<a href="tel:@Model.SelectedJsonCustomer.Telefon">@Model.SelectedJsonCustomer.Telefon</a>
</div>
</div>
<div class="row">
<div class="col text-secondary">
Fax:
</div>
<div class="col-auto text-right">
@Model.SelectedJsonCustomer.Fax
</div>
</div>
<div class="row">
<div class="col text-secondary">
Mail:
</div>
<div class="col-auto text-right">
<a href="mailto:@Model.SelectedJsonCustomer.EMail">@Model.SelectedJsonCustomer.EMail</a>
</div>
</div>
</div>
</div>
</div>
<!-- Kommentar, falls vorhanden -->
@if(Model.SelectedJsonCustomer.Kommentar != null)
{
<div class="col-12 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Kommentar</h5>
</div>
<div class="card-body">
<div class="container-fluid">
@Model.SelectedJsonCustomer.Kommentar
</div>
</div>
</div>
</div>
}
<!-- Aktenzeichen -->
@if(Model.SelectedJsonCustomer.ReferenceNumbers.Any())
{
<div class="col-md-6 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Aktenzeichen pro Kostenträger</h5>
</div>
<div class="card-body">
<div class="container-fluid">
<table class="table">
<thead>
<tr>
<th class="text-left">
Kostenträger
</th>
<th class="text-right">
Aktenzeichen
</th>
</tr>
</thead>
<tbody>
@foreach(var x in Model.SelectedJsonCustomer.ReferenceNumbers)
{
<tr>
<td class="text-left">
@x.Costbearer
</td>
<td class="text-right">
@x.ReferenceNumber
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
}
<!-- Umfeld -->
@if(Model.SelectedJsonCustomer.Umfeldpersonen.Any())
{
<div class="col-md-6 my-3">
<div class="card w-100">
<div class="card-header">
<h5 class="text-bewo-customer-card-header">Umfeld</h5>
</div>
<div class="card-body">
<div class="container-fluid px-0">
@foreach(var umfeldPerson in Model.SelectedJsonCustomer.Umfeldpersonen)
{
<div class="card w-100 mb-3">
<div class="card-header" onclick="cardHeaderClick('#chevron-umfeldperson-@umfeldPerson.Customer2PersonOid', '#collapse-umfeldperson-@umfeldPerson.Customer2PersonOid')">
<div class="d-inline-flex">
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-umfeldperson-@umfeldPerson.Customer2PersonOid"></i>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Adresse:
</div>
<div class="col-auto text-right">
@umfeldPerson.StrNameNr<br/>@umfeldPerson.PLZOrt
</div>
<div class="p2 d-inline-flex text-primary h-100">
<button type="button" class="btn btn-link">
@umfeldPerson.FormattedName
</button>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Tel.:
</div>
<div class="col-auto text-right">
<a href="tel:@umfeldPerson.TelNr">@umfeldPerson.TelNr</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Mobil:
</div>
<div class="col-auto text-right">
<a href="tel:@umfeldPerson.Mobil">@umfeldPerson.Mobil</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
E-Mail:
</div>
<div class="col-auto text-right">
<a href="mailto:@umfeldPerson.EMail">@umfeldPerson.EMail</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Fax:
</div>
<div class="col-auto text-right">
@umfeldPerson.Fax
</div>
<div class="collapse" id="collapse-umfeldperson-@umfeldPerson.Customer2PersonOid">
<div class="card-body">
<div class="container-fluid">
<div class="row mb-3">
<div class="col text-secondary text-left">
Rolle:
</div>
<div class="col-auto text-right">
@umfeldPerson.Rolle
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Adresse:
</div>
<div class="col-auto text-right">
@umfeldPerson.StrNameNr<br />@umfeldPerson.PLZOrt
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Tel.:
</div>
<div class="col-auto text-right">
<a href="tel:@umfeldPerson.TelNr">@umfeldPerson.TelNr</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Mobil:
</div>
<div class="col-auto text-right">
<a href="tel:@umfeldPerson.Mobil">@umfeldPerson.Mobil</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
E-Mail:
</div>
<div class="col-auto text-right">
<a href="mailto:@umfeldPerson.EMail">@umfeldPerson.EMail</a>
</div>
</div>
<div class="row mb-3">
<div class="col text-secondary text-left">
Fax:
</div>
<div class="col-auto text-right">
@umfeldPerson.Fax
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
}
</div>
</div>
</div>
</div>
}
</div>
}
</div>
}
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -407,5 +407,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<long> FindTeamCustomers(long? teamOid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<CompactCustomerDC> GetActiveCustomersForEmployee(long? employeeOid, CustomerFilterEnum customerFilter);
}
}

View File

@@ -1832,5 +1832,19 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(exception);
}
}
public List<CompactCustomerDC> GetActiveCustomersForEmployee(long? employeeOid, CustomerFilterEnum customerFilter)
{
try
{
var customers = DAOFactory.SearchDAO.GetActiveCustomersForEmployee(employeeOid, customerFilter);
return MapperFactory.CompactCustomerDC_Customer.MapToNewDCs(customers);
}
catch(Exception exception)
{
throw Utils.CreateBeWoFaultException(exception);
}
}
}
}