Modale Fenster sind beim Update nicht mehr in einer Endlosschleife gefangen, wenn man z.B. zwei vom gleichen Mitarbeiter offen hat und speichert.

Die Statistik in der mobilen Version ist jetzt gleich der der Windows-Version.
This commit is contained in:
Lyndon
2018-02-23 14:42:53 +01:00
parent 420c440335
commit bbc75f1dca
14 changed files with 1282 additions and 1263 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -379,17 +379,18 @@ namespace BeWo.View.Detail
internal override bool DoSaveCheck()
{
if (this.IsDirty)
if(IsDirty)
{
CustomerDC cdc = ViewModel.CommitToDataContract();
var cdc = ViewModel.CommitToDataContract();
var message = ServiceFacade.DoCustomerServiceSync(s => s.AllowSavingCustomer(cdc));
if (!String.IsNullOrEmpty(message))
if(!string.IsNullOrEmpty(message))
{
MessageBox.Show(message, "Änderungen speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
return false;
}
}
return base.DoSaveCheck();
}
@@ -408,17 +409,15 @@ namespace BeWo.View.Detail
ViewModel.EmployeeRelations.IsDirty
|| ViewModel.TerminationDate != ViewModel.DataContract.TerminationDate)
{
DoOwnChatSync = true;
}
}
CustomerDC cdc = ViewModel.CommitToDataContract();
var cdc = ViewModel.CommitToDataContract();
//var lDataContract = ViewModel.CommitToDataContract();
try
{
long oid = 0;
IsDoneWithInsertOrUpdate = false;
if (ViewModel.IsNew)
@@ -438,6 +437,7 @@ namespace BeWo.View.Detail
MessageBox.Show("Dieser Datensatz wurde in der Zwischenzeit von einem anderen Benutzer geändert. Klicken Sie Ok, um den Datansatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
ReloadViewModel(cdc.CustomerOid.Value);
}
_saveInProgress = false;
}
}
@@ -534,10 +534,7 @@ namespace BeWo.View.Detail
// reload to update version information and oid
VMFactory.CreateCustomerVMAsync(pCustomerOID, cb => this.Dispatch(delegate { ViewModel = cb; UpdateUris(); }));
if (ModalEditViewUpdateCallback != null)
{
ModalEditViewUpdateCallback();
}
ModalEditViewUpdateCallback?.Invoke();
IsDoneWithInsertOrUpdate = true;
}
@@ -556,7 +553,9 @@ namespace BeWo.View.Detail
GroupBoxAbsenceTimes.Content = grid_AbsenceTimes;
if (ViewModel.AbsenceTimes != null && grid_AbsenceTimes != null)
{
grid_AbsenceTimes.Columns["Reason"].EditSettings = new ComboBoxEditSettings { ItemsSource = ViewModel.AbsenceTimes.PossibleReasons };
}
}
// private void ComboBox_Loaded(object sender, RoutedEventArgs e)
@@ -588,10 +587,10 @@ namespace BeWo.View.Detail
grid_EmployeeRelation.Columns["Role"].EditSettings = new ComboBoxEditSettings { ItemsSource = ViewModel.EmployeeRelations.PossibleRoles };
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ChatSettings))
{
//grid_EmployeeRelation.Columns["Chatpartner"].Visible = false;
}
//if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ChatSettings))
//{
// grid_EmployeeRelation.Columns["Chatpartner"].Visible = false;
//}
}
if (grid_TeamRelation == null)
@@ -602,7 +601,9 @@ namespace BeWo.View.Detail
teamGrid.Children.Add(grid_TeamRelation);
//if (ViewModel.TeamRelations != null)
//{
// grid_TeamRelation.Columns["Role"].EditSettings = new ComboBoxEditSettings { ItemsSource = ViewModel.EmployeeRelations.PossibleRoles };
//}
}
}
@@ -969,7 +970,6 @@ namespace BeWo.View.Detail
popupedit_environmentOrganisationSearch.Focus();
}
//######################## Neu ####################################
private void ansprechpartnersearchview_EnvironmentPersonSelected(object sender, EventArgs<CompactPersonDC> e)
{
popup_ansprechpartner.IsOpen = false;
@@ -986,8 +986,6 @@ namespace BeWo.View.Detail
popupedit_environmentPersonOrganisationSearch.Focus();
}
//###################################################################
private void popupedit_costBearer_PopUpClick(object sender, RoutedEventArgs e)
{
popup_costBearer.IsOpen = true;
@@ -1039,7 +1037,6 @@ namespace BeWo.View.Detail
popup_person.IsOpen = true;
}
// ##################### Neu ######################
private void popupedit_environmentPersonOrganisationSearch_PopUpClick(object sender, RoutedEventArgs e)
{
personOrganisationsearchview.ItemSelected += PersonOrganisationsearchview_EnvironmentPersonSelected;
@@ -1052,8 +1049,6 @@ namespace BeWo.View.Detail
popup_ansprechpartner.IsOpen = true;
}
//#################################################
private void popupedit_environmentOrganisationSearch_PopUpClick(object sender, RoutedEventArgs e)
{
organisationsearchview.ItemSelected += organisationsearchview_EnvironmentOrganisationSelected;
@@ -1273,7 +1268,7 @@ namespace BeWo.View.Detail
VMFactory.CreateEmployeeVMAsync((pDC as CompactEmployeeDC).EmployeeOid,
cb => this.Dispatch(
() => BeWoUtils.OpenModalViewWindow<EmployeeVM, EmployeeDC, CustomerView>(cb, this, () => this.Dispatch(
() => BeWoUtils.UpdateAllViews(ViewModel.EmployeeRelations.NewVM.Employee ?? (pDC as CompactEmployeeDC))), allowSaveIfParentDirty: true)));
() => BeWoUtils.UpdateAllViews(ViewModel.EmployeeRelations.NewVM.Employee ?? pDC as CompactEmployeeDC)), allowSaveIfParentDirty: true)));
}
if (pDCType == typeof(CompactOrganisationDC))
@@ -1283,7 +1278,7 @@ namespace BeWo.View.Detail
() => BeWoUtils.OpenModalViewWindow<OrganisationVM, OrganisationDC, CustomerView>(cb, this, () => this.Dispatch(
delegate
{
CompactOrganisationDC selectedOrganisation = (isCostBearer ? ViewModel.CostBearers.NewVM.CostBearer : ViewModel.EnvironmentOrganisations.NewVM.Organisation) ?? (pDC as CompactOrganisationDC);
CompactOrganisationDC selectedOrganisation = (isCostBearer ? ViewModel.CostBearers.NewVM.CostBearer : ViewModel.EnvironmentOrganisations.NewVM.Organisation) ?? pDC as CompactOrganisationDC;
BeWoUtils.UpdateAllViews(selectedOrganisation);
}), (s, args) => this.Dispatch(delegate { }), allowSaveIfParentDirty: true)));
}
@@ -1293,7 +1288,7 @@ namespace BeWo.View.Detail
VMFactory.CreatePersonVMAsync((pDC as CompactPersonDC).PersonOid,
cb => this.Dispatch(
() => BeWoUtils.OpenModalViewWindow<PersonVM, PersonDC, CustomerView>(cb, this, () => this.Dispatch(
() => BeWoUtils.UpdateAllViews(ViewModel.EnvironmentPersons.NewVM.Person ?? (pDC as CompactPersonDC))), personSavedOrUpdated: (s, args) => this.Dispatch(delegate{}), allowSaveIfParentDirty: true)));
() => BeWoUtils.UpdateAllViews(ViewModel.EnvironmentPersons.NewVM.Person ?? pDC as CompactPersonDC)), personSavedOrUpdated: (s, args) => this.Dispatch(delegate{}), allowSaveIfParentDirty: true)));
}
if (pDCType == typeof(CompactTeamDC))
@@ -1301,7 +1296,7 @@ namespace BeWo.View.Detail
VMFactory.CreateTeamVMAsync((pDC as CompactTeamDC).TeamOid,
cb => this.Dispatch(
() => BeWoUtils.OpenModalViewWindow<TeamVM, TeamDC, CustomerView>(cb, this, () => this.Dispatch(
() => BeWoUtils.UpdateAllViews(ViewModel.TeamRelations.NewVM.Team ?? (pDC as CompactTeamDC))), allowSaveIfParentDirty: true)));
() => BeWoUtils.UpdateAllViews(ViewModel.TeamRelations.NewVM.Team ?? pDC as CompactTeamDC)), allowSaveIfParentDirty: true)));
}
}
@@ -1888,5 +1883,4 @@ namespace BeWo.View.Detail
}
}
}
}

View File

@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using BeWo.Core;
using BeWo.Core.Service;
using BeWo.ownChat;
@@ -27,8 +24,6 @@ using BS.Shared.Extensions;
using DevExpress.Xpf.Editors.Settings;
using DevExpress.Xpf.Grid;
using Button = System.Windows.Controls.Button;
using Color = System.Drawing.Color;
using Image = System.Windows.Controls.Image;
using MessageBox = System.Windows.MessageBox;
using Point = System.Windows.Point;
@@ -234,29 +229,28 @@ namespace BeWo.View.Detail
return new[] {UserRightType.EditAll, UserRightType.EmployeeView_Edit, UserRightType.Employee_AllowEditOwnEmployees};
return new[] {UserRightType.EditAll, UserRightType.EmployeeView_Edit};
}
protected override void Save()
{
if (!ValidateContracts())
if(!ValidateContracts())
{
return;
}
if (BeWoApp.AppSettings.IsChatAllowed)
if(BeWoApp.AppSettings.IsChatAllowed)
{
if (ViewModel.DataContract.FirstName != ViewModel.FirstName ||
ViewModel.DataContract.LastName != ViewModel.LastName)
if (ViewModel.DataContract.FirstName != ViewModel.FirstName || ViewModel.DataContract.LastName != ViewModel.LastName)
{
DoOwnChatSync = true;
}
}
EmployeeDC lDataContract = ViewModel.CommitToDataContract();
var lDataContract = ViewModel.CommitToDataContract();
try
{
if (ViewModel.IsNew)
if(ViewModel.IsNew)
{
IsDoneWithInsertOrUpdate = false;
DoOwnChatSync = true;
@@ -272,7 +266,7 @@ namespace BeWo.View.Detail
Cache.GetInstance().ClearEmployees();
BeWoApp.MainControl.ResetView(UIContext.Employee);
}
catch (FaultException<BeWoFault>)
catch(FaultException<BeWoFault>)
{
MessageBox.Show("Dieser Datensatz wurde in der Zwischenzeit von einem anderen Benutzer geändert. Klicken Sie Ok, um den Datansatz erneut zu laden. Ihre Änderungen gehen dabei leider verloren.");
ReloadViewModel(lDataContract.EmployeeOid.Value);
@@ -315,8 +309,7 @@ namespace BeWo.View.Detail
this.Dispatch(
delegate
{
MessageBox.Show("Leider besitzen Sie nicht genügend Lizenzen, um einen neuen Benutzer anzulegen!",
"Benutzer anlegen", MessageBoxButton.OK, MessageBoxImage.Information);
MessageBox.Show("Leider besitzen Sie nicht genügend Lizenzen, um einen neuen Benutzer anzulegen!", "Benutzer anlegen", MessageBoxButton.OK, MessageBoxImage.Information);
});
}
else
@@ -338,8 +331,6 @@ namespace BeWo.View.Detail
}
IsDoneWithInsertOrUpdate = true;
}
private void PreselectEmployeeBrush()
@@ -626,7 +617,6 @@ namespace BeWo.View.Detail
PreselectEmployeeBrush();
}
private void Img_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
BeWoUtils.ShowImageForm(Img.Source);

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
@@ -14,6 +15,8 @@ namespace BeWo.View.Detail
{
private readonly bool _AllowSaveIfParentDirty;
public Action ModalEditViewUpdateCallback;
public BeWoView DetailView { get; set; }
public BeWoView ParentView { get; set; }
public Grid RootGrid => rootGrid;

View File

@@ -3259,7 +3259,17 @@ namespace BeWo.View.Detail
var employeeCompact = ViewModel.SelectedEmployee ?? BeWoApp.LoggedOnUser.Employee;
VMFactory.CreateEmployeeVMAsync(employeeCompact.EmployeeOid, cb => this.Dispatch(() => BeWoUtils.OpenModalViewWindow<EmployeeVM, EmployeeDC, ServiceRecordView2>(cb, this, () => this.Dispatch(() => BeWoUtils.UpdateAllViews(employeeCompact)))));
VMFactory.CreateEmployeeVMAsync(
employeeCompact.EmployeeOid,
employeeVM => this.Dispatch(
() => BeWoUtils.OpenModalViewWindow<EmployeeVM, EmployeeDC, ServiceRecordView2>(
employeeVM,
this,
() => this.Dispatch(
() =>
{
BeWoUtils.UpdateAllViews(employeeCompact);
}))));
}
private void ReloadButton_OnClick(object sender, RoutedEventArgs e)

View File

@@ -196,6 +196,7 @@
<Content Include="Content\images\toggle-icon-u.svg" />
<Content Include="Content\images\unterschriften-icon.svg" />
<Content Include="Content\images\zeiterfassungsicon.svg" />
<Content Include="Content\statisticsStyle.css" />
<Content Include="Global.asax" />
<Content Include="Scripts\appointment.js" />
<Content Include="Scripts\calendar.js" />
@@ -204,6 +205,7 @@
<Content Include="Scripts\localServiceRecord.js" />
<Content Include="Scripts\mainView.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Scripts\statistics.js" />
<Content Include="Scripts\utils.js" />
<Content Include="TestWebService.asmx" />
<Content Include="Web.config">

View File

@@ -50,7 +50,7 @@ a, a:active, a:visited, a:hover {
position: relative;
line-height: 14px;
display: block;
margin: 0 0 0.1em 0;
margin: 0 0 .1em 0;
}
.cell-content {

View File

@@ -0,0 +1,19 @@
#statisticsChartContainer {
margin-top: 1em;
}
#myChart {
margin-top: 1em;
margin-bottom: 1em;
}
fieldset {
color: #555;
border: 1px solid #bbb;
margin-right: .45em;
margin-top: .5em;
}
p {
color: #555;
}

View File

@@ -434,14 +434,14 @@ namespace BeWoPlanerMobil.Controllers
{
try
{
if (Model == null)
if(Model == null)
{
return "SessionTimeout";
}
var parents = OperationsService.CreateSupportConceptStatistics(oid,DateTime.Now);
var supportConceptStatistics = OperationsService.CreateSupportConceptStatistics(oid, DateTime.Now);
return SerializeObject(parents);
return SerializeObject(supportConceptStatistics);
}
catch (Exception e)
{

View File

@@ -886,164 +886,6 @@ function showKalender() {
initCalendar();
}
var ChartAnz;
var ArrayStatistika;
var StringProvided = "Geleistet diese Woche";
var StringProvidedTotal = "Gesamt";
var StringApproved = "Bewilligt pro Woche";
var StringApprovedTotal = "Gesamt";
var StringFree = "Frei pro Woche (Ø)";
var StringFreeTotal = "Gesamt";
function showStatistics() {
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
$("#zeiterfassung").css("display", "none");
$("#KalenderNavigation").css("display", "none");
$("#Kalender").css("display", "none");
$("#klienten").css("display", "none");
$("#colorRibbon").css("background-color", "#04b4d0");
$("#UnterschriftBereich").css("display", "none");
$("#Statistics").css("display","none");
$("#SupportStatistik").css("display", "block");
const zahl = $("#scDropDown").val();
if (zahl >= 0) {
$("#StatisticUberschrift").val("Hilfeplan Statistik: " + $(`#scDropDown option[value='${zahl}']`).text());
loadSupportConceptStatistics(zahl);
} else {
$("#StatisticUberschrift").val("Hilfeplan Statistik: Es wurde kein Hilfeplan ausgewählt");
$("#Statistic1").val("Keine Datensätze gefunden ");
$("#Statistic2").val("Keine Datensätze gefunden ");
$("#Statistic3").val("Keine Datensätze gefunden ");
document.getElementById("Statistic1").onclick = "";
document.getElementById("Statistic2").onclick = "";
document.getElementById("Statistic3").onclick = "";
StatisticDesign(100, 200);
$("#LegendStatistic2").val(100);
$("#LegendStatistic1").val(200);
}
}
function StatisticDesign(wert1, wert2, string1, string2) {
const data = [
{
value: wert1,
color: "#F7464A",
highlight: "#FF5A5E",
label: string1
},
{
value: wert2,
color: "#00FF00",
highlight: "#99FF00",
label: string2
}];
const options = {
scaleShowLabelBackdrop: true,
scaleBackdropColor: "rgba(255,255,255,0.75)",
scaleBeginAtZero: true,
scaleBackdropPaddingY: 2,
scaleBackdropPaddingX: 2,
scaleShowLine: true,
segmentShowStroke: true,
segmentStrokeColor: "#fff",
segmentStrokeWidth: 1,
animationSteps: 150,
animationEasing: "easeOutBounce",
responsive: true,
animateRotate: true,
animateScale: true,
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
}
const ctx = document.getElementById("myChart").getContext("2d");
if(ChartAnz != null) {
ChartAnz.destroy();
}
ChartAnz = new Chart(ctx).Doughnut(data, options);
}
function loadSupportConceptStatistics(oid) {
$.ajax({
type: "GET",
url: LoadStatisticsUrl,
data: {oid:oid },
success: function (jsonServiceRecord) {
var KalenderRec = $.parseJSON(jsonServiceRecord);
var Description = KalenderRec.Subject;
var Provided = KalenderRec.MinutesProvidedThisWeek;
var Approved = KalenderRec.MinutesApprovedPerWeek;
var FreeWeek = KalenderRec.MinutesFreePerWeekAverage;
var ProvidedTotal = KalenderRec.MinutesProvidedTotalRounded;
var ApprovedTotal = KalenderRec.MinutesApprovedTotal;
var FreeWeekTotal = ApprovedTotal - ProvidedTotal;
Provided = (Provided / 60).toFixed(2);
Approved = (Approved / 60).toFixed(2);
FreeWeek = (FreeWeek / 60).toFixed(2);
ProvidedTotal = (ProvidedTotal / 60).toFixed(2);
ApprovedTotal = (ApprovedTotal / 60).toFixed(2);
FreeWeekTotal = (FreeWeekTotal / 60).toFixed(2);
ArrayStatistika = new Array();
ArrayStatistika[0] = Provided;
ArrayStatistika[1] = Approved;
ArrayStatistika[2] = FreeWeek;
ArrayStatistika[3] = ProvidedTotal;
ArrayStatistika[4] = ApprovedTotal;
ArrayStatistika[5] = FreeWeekTotal;
var berechne = ArrayStatistika[3] - ArrayStatistika[0];
if (berechne < 0)berechne = 0;
StatisticDesign(ArrayStatistika[0], berechne, StringProvided, StringProvidedTotal);
$("#LegendStatistic2").val(ArrayStatistika[0] + " / " + StringProvided);
$("#LegendStatistic1").val(ArrayStatistika[3] + " / " + StringProvidedTotal);
loadDataIntoTextField(ArrayStatistika);
}
});
}
function loadDataIntoTextField(ArrayStatistika) {
if ($("#Statistic1").val() == "") {
$("#Statistic1").val(StringProvided + ": " + ArrayStatistika[0] + " / Gesamt: " + ArrayStatistika[3]);
$("#Statistic2").val(StringApproved + ": " + ArrayStatistika[1] + " / Gesamt: " + ArrayStatistika[4]);
$("#Statistic3").val(StringFree + ": " + ArrayStatistika[2] + " / Gesamt: " + ArrayStatistika[5]);
}
}
function StatisticÄnderung(value) {
const value1 = ArrayStatistika[value + 2];
const value2 = ArrayStatistika[value - 1];
var difference = value1 - value2;
if (difference < 0) {
difference = 0;
}
StatisticDesign(value2, difference, StringProvided, StringProvidedTotal);
$("#LegendStatistic2").val(value2 + " / " + StringProvided);
$("#LegendStatistic1").val(value1 + " / " + StringProvidedTotal);
}
function showUsAendern() {
$("#TerminSpeichern").prop('disabled', false);
$("#AenderePopupDivSchalter").val("true");
@@ -1063,21 +905,23 @@ function initCalendar() {
$("html, body").animate({ scrollTop: 0 }, "fast");
var newtoday;
var datumStr = $("#KalenderDatum").val();
const datumStr = $("#KalenderDatum").val();
var nextdatum;
if (datumStr === "") {
nextdatum = new Date();
var ddi0 = nextdatum.getDate();
var mmi0 = nextdatum.getMonth() + 1;
var yyyyi0 = nextdatum.getFullYear();
const ddi0 = nextdatum.getDate();
const mmi0 = nextdatum.getMonth() + 1;
const yyyyi0 = nextdatum.getFullYear();
var ddStri0 = ddi0 < 10 ? "0" + ddi0 : ddi0;
var mmStri0 = mmi0 < 10 ? "0" + mmi0 : mmi0;
const ddStri0 = ddi0 < 10 ? "0" + ddi0 : ddi0;
const mmStri0 = mmi0 < 10 ? "0" + mmi0 : mmi0;
$("#KalenderDatum").val(yyyyi0 + "-" + mmStri0 + "-" + ddStri0);
newtoday = ddStri0 + '.' + mmStri0 + "." + yyyyi0;
$("#KalenderDatumFormat").val(newtoday);
loadAppointments(newtoday);
@@ -1085,15 +929,15 @@ function initCalendar() {
}
function initAppointmentEditForm() {
var currTime = new Date();
const currTime = new Date();
if (currTime.getMinutes() <= 30) {
var k = 30 - currTime.getMinutes();
const k = 30 - currTime.getMinutes();
currTime.setMinutes(currTime.getMinutes() + k);
}
if (currTime.getMinutes() > 30) {
var j = 60 - currTime.getMinutes();
const j = 60 - currTime.getMinutes();
currTime.setMinutes(currTime.getMinutes() + j);
}
@@ -1132,12 +976,12 @@ function hideEditForm() {
}
function nextDayButtonClick() {
var nextdatum = new Date($("#KalenderDatum").val());
const nextdatum = new Date($("#KalenderDatum").val());
nextdatum.setDate((nextdatum.getDate() + 1));
$("#KalenderDatum").val(toDateStringYearMonthDay(nextdatum));
var newtoday = getDateStringWithLeadingZeros(nextdatum);
const newtoday = getDateStringWithLeadingZeros(nextdatum);
$("#KalenderDatumFormat").val(newtoday);

View File

@@ -0,0 +1,116 @@
var chartAnz;
function showStatistics() {
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
$("#zeiterfassung").css("display", "none");
$("#KalenderNavigation").css("display", "none");
$("#Kalender").css("display", "none");
$("#klienten").css("display", "none");
$("#colorRibbon").css("background-color", "#04b4d0");
$("#UnterschriftBereich").css("display", "none");
$("#Statistics").css("display", "none");
$("#SupportStatistik").css("display", "block");
const supportConceptOid = $("#scDropDown").val();
if(supportConceptOid >= 0) {
$("#StatisticUberschrift").html(`Hilfeplan Statistik: ${$(`#scDropDown option[value='${supportConceptOid}']`).text()}`);
loadSupportConceptStatistics(supportConceptOid);
} else {
$("#StatisticUberschrift").html("Hilfeplan Statistik: Es wurde kein Hilfeplan ausgewählt");
statisticDesign(0, 0);
$("#LegendStatistic2").val(0);
$("#LegendStatistic1").val(0);
}
}
function statisticDesign(wert1, wert2, string1, string2) {
const data = [
{
value: wert1,
color: "#F7464A",
highlight: "#FF5A5E",
label: string1
},
{
value: wert2,
color: "#00FF00",
highlight: "#99FF00",
label: string2
}];
const options = {
scaleShowLabelBackdrop: true,
scaleBackdropColor: "rgba(255,255,255,0.75)",
scaleBeginAtZero: true,
scaleBackdropPaddingY: 2,
scaleBackdropPaddingX: 2,
scaleShowLine: true,
segmentShowStroke: true,
segmentStrokeColor: "#fff",
segmentStrokeWidth: 1,
animationSteps: 1,
animationEasing: "easeOutBounce",
responsive: true,
animateRotate: false,
animateScale: false,
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\">" +
"<% for (var i=0; i<segments.length; i++){%>" +
"<li>" +
"<span style=\"background-color:<%=segments[i].fillColor%>\"></span>" +
"<%if(segments[i].label){%><%=segments[i].label%><%}%>" +
"</li><%}%>" +
"</ul>"
}
const ctx = $("#myChart").get(0).getContext("2d");
if(chartAnz != null) {
chartAnz.destroy();
}
chartAnz = new Chart(ctx).Doughnut(data, options);
}
/*
Geleistet diese Woche / Gesamt 0,00 34,00
Bewilligt pro Woche / Gesamt 0,97 101,25
Frei pro Woche(O) / Gesamt 1,27 67,25
*/
function loadSupportConceptStatistics(oid) {
$.ajax({
type: "GET",
url: loadStatisticsUrl,
data: { oid: oid },
success: function(jsonServiceRecord) {
const supportConceptStatistics = $.parseJSON(jsonServiceRecord);
var provided = supportConceptStatistics.MinutesProvidedThisWeek;
var approved = supportConceptStatistics.MinutesApprovedPerWeek;
var freePerWeek = supportConceptStatistics.MinutesFreePerWeekAverage;
var providedTotal = supportConceptStatistics.MinutesProvidedTotalRounded;
var approvedTotal = supportConceptStatistics.MinutesApprovedTotal;
var freePerWeekTotal = approvedTotal - providedTotal;
provided = (provided / 60).toFixed(2);
approved = (approved / 60).toFixed(2);
freePerWeek = (freePerWeek / 60).toFixed(2);
providedTotal = (providedTotal / 60).toFixed(2);
approvedTotal = (approvedTotal / 60).toFixed(2);
freePerWeekTotal = (freePerWeekTotal / 60).toFixed(2);
statisticDesign(providedTotal, approvedTotal, "Bewilligt gesamt", "Geleistet gesamt");
$("#LegendStatistic2").val(`Bewilligt gesamt: ${approvedTotal}`);
$("#LegendStatistic1").val(`Geleistet gesamt: ${providedTotal}`);
$("#supportConceptStatisticsProvided").html(`Geleistet diese Woche/Gesamt: ${provided} / ${providedTotal}`);
$("#supportConceptStatisticsApproved").html(`Bewilligt pro Woche/Gesamt: ${approved} / ${approvedTotal}`);
$("#supportConceptStatisticsFree").html(`Frei pro Woche(Ø)/Gesamt: ${freePerWeek} / ${freePerWeekTotal}`);
}
});
}

View File

@@ -797,48 +797,28 @@
</div>
<div id="SupportStatistik" style="display: none" align="center" >
<div>
<input id="StatisticUberschrift" readonly name="uberschrift" />
<div>
<h5 id="StatisticUberschrift" name="uberschrift"></h5>
<p id="supportConceptStatisticsProvided"></p>
<p id="supportConceptStatisticsApproved"></p>
<p id="supportConceptStatisticsFree"></p>
</div>
<div id="statisticsChartContainer">
<div style=" width: 100%; margin: 2px;">
<fieldset>
<legend>Legende</legend>
<hr style="border: none; width: 8%; height: 30px; margin: 1px; color: #48FF31; background: #48FF31; float:left;" /><input type="text" style="width:90%; float:right; height:35px; text-align:center;" id="LegendStatistic1" readonly>
<br />
<br />
<hr style="width: 8%; height: 30px; margin: 1px; color: #EE4345; background: #EE4345; float:left;" /><input type="text" style="width:90%; float:right; height:35px; text-align:center;" id="LegendStatistic2" readonly>
</fieldset>
</div>
<table>
<tr>
<td colspan="2">
<div class="input-wrapper cell-content" style="margin-top: 0.25em;">
<input id="Statistic1" name="Statistic1" readonly value="" onclick="StatisticÄnderung(1)"/>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="input-wrapper cell-content" style="margin-top: 0.25em;">
<input id="Statistic2" name="Statistic2" readonly value="" onclick="StatisticÄnderung(2)"/>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="input-wrapper cell-content" style="margin-top: 0.25em;">
<input id="Statistic3" name="Statistic3" readonly value=" " onclick="StatisticÄnderung(3)"/>
</div>
</td>
</tr>
</table>
<div>
<input type="button" value="Zurück" onclick="goBackToZeiterfassung(), location.reload()" style="width: 100px; float:left;" />
<div style=" width: 65%; float:right; zoom:0.75; -moz-transform: scale(0.75); margin: 2px;">
<fieldset>
<legend>Legende</legend>
<hr style="width: 5%; height: 30px; margin: 1px; color: green; background: #4cff00; float:left;" /><input type="text" style="width:90%; float:right; height:35px; text-align:center;" id="LegendStatistic1" readonly>
<br />
<br />
<hr style="width: 5%; height: 30px; margin: 1px; color: red; background: red; float:left;" /><input type="text" style="width:90%; float:right; height:35px; text-align:center;" id="LegendStatistic2" readonly>
</fieldset>
</div>
<canvas id="myChart" scaleheight="50%" scalewidth="50%" ></canvas>
</div>
<canvas id="myChart" scaleheight="65%" scalewidth="65%"></canvas>
<input type="button" value="Zurück" onclick="goBackToZeiterfassung(), location.reload()" style="width: 100%;" />
</div>
</div>
<script>
@@ -862,8 +842,8 @@
redirectLink = '@Url.Action("Index", "Login")';
getSupportConceptCustomerUrl = '@Url.Action("GetSelectedSupportConceptCustomer")';
getSelectedRecordInformationUrlWithOid = '@Url.Action("GetSelectedRecordInformationWithOid")';
LoadStatisticsUrl = '@Url.Action("LoadStatistics")';
UpdateKalenderUrl = '@Url.Action("UpdateAppointment")';
loadStatisticsUrl = '@Url.Action("LoadStatistics")';
updateAppointmentUrl = '@Url.Action("UpdateAppointment")';
saveZeiterfassungAfterCrashUrl = '@Url.Action("SaveZeiterfassungAfterCrash")';
CheckRightsAfterCrashUrl = '@Url.Action("CheckRightsAfterCrash")';
ErrorZeiterfassungAnzeigenUrl = '@Url.Action("ErrorZeiterfassungAnzeigen")';

View File

@@ -9,7 +9,8 @@
<link rel="stylesheet" href="~/Content/datepicker_jQM.css" />
<link rel="stylesheet" href="~/Content/datepicker.css" />
<link rel="stylesheet" href="~/Content/BeWoMobileStyle.css" />
<link rel="stylesheet" href="~/Content/BeWoMobileStyle.css" />
<link rel="stylesheet" href="~/Content/statisticsStyle.css" />
<script src="~/Scripts/appointment.js"></script>
<script src="~/Scripts/utils.js"></script>
@@ -18,6 +19,7 @@
<script src="~/Scripts/initialization.js"></script>
<script src="~/Scripts/Chart.min.js"></script>
<script src="~/Scripts/calendar.js"></script>
<script src="~/Scripts/statistics.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/knockout/knockout-3.0.0.js"></script>
<script>$(function(){$(".date-input-css").datepicker();})</script>
</head>

View File

@@ -2,14 +2,11 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using BS.Shared.Core;
namespace BS.Shared.DataContracts
{
[DataContract]
public class SupportConceptStatisticsDC : IDataContract
{
[DataMember]
public DateTime DateOfCreation { get; set; }