Konflikte gelöst
This commit is contained in:
@@ -313,13 +313,22 @@
|
||||
<Compile Include="Controllers\ReportViewerController.cs" />
|
||||
<Compile Include="Controllers\SchedulerController.cs" />
|
||||
<Compile Include="Models\AbstractModel.cs" />
|
||||
<Compile Include="Models\SchedulerSessionModel.cs" />
|
||||
<Compile Include="Models\MainSessionModel.cs" />
|
||||
<Compile Include="Models\ReportSessionModel .cs" />
|
||||
<Compile Include="Models\ReportViewerSessionModel.cs" />
|
||||
<Compile Include="Models\CustomerSessionModel.cs" />
|
||||
<Compile Include="Models\CustomerModel.cs" />
|
||||
<Compile Include="Models\DebuggingToolsModel.cs" />
|
||||
<Compile Include="Models\DevExpressSchedulerModel.cs" />
|
||||
<Compile Include="Models\ExternalSignatureModel.cs" />
|
||||
<Compile Include="Models\ISessionModel.cs" />
|
||||
<Compile Include="Models\ReportModel.cs" />
|
||||
<Compile Include="Models\ReportViewerModel.cs" />
|
||||
<Compile Include="Models\SchedulerModel.cs" />
|
||||
<Compile Include="Util\DcToMokMapper.cs" />
|
||||
<Compile Include="Util\MokMandator.cs" />
|
||||
<Compile Include="Util\MokSettings.cs" />
|
||||
<Compile Include="Util\AppointmentListItem.cs" />
|
||||
<Compile Include="Util\BeWoLoginState.cs" />
|
||||
<Compile Include="Util\BootstrapTreeViewItem.cs" />
|
||||
@@ -360,6 +369,7 @@
|
||||
<Compile Include="Util\ReferenceNumberWithNotice.cs" />
|
||||
<Compile Include="Util\ReportUtils\ConfirmationReceiptObject.cs" />
|
||||
<Compile Include="Util\ReportUtils\Quittierungsbelegsunterschriftenobjekt.cs" />
|
||||
<Compile Include="Util\ReportUtils\QuittierungsbelegsReportSettings.cs" />
|
||||
<Compile Include="Util\ReportUtils\ReportTimeFrame.cs" />
|
||||
<Compile Include="Util\ServiceRecord2Validation.cs" />
|
||||
<Compile Include="Util\SignatureUtils.cs" />
|
||||
@@ -752,7 +762,7 @@
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>False</AutoAssignPort>
|
||||
<DevelopmentServerPort>8808</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
@@ -9,7 +9,7 @@
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWoPlanerMobil.Models;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
@@ -30,6 +34,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
public static readonly string IsSessionTimedOut = "isSessionTimedOut";
|
||||
|
||||
private UserDC loggedInUserDc = null;
|
||||
private EmployeeDC loggedInEmployeeDC = null;
|
||||
|
||||
protected ActionResult Logout()
|
||||
{
|
||||
@@ -45,9 +51,60 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Index", "Login", new {tenant = MobileSessionFacade.Tenant});
|
||||
}
|
||||
|
||||
protected UserDC GetUser()
|
||||
protected virtual void InitModel(AbstractModel model)
|
||||
{
|
||||
return UserService.LoadUser(MobileSessionFacade.LoggedInUser.Oid.Value);
|
||||
model.LoggedInUser = LoggedInUser;
|
||||
model.LoggedInEmployee = LoggedInEmployee;
|
||||
model.Mandator = Mandator;
|
||||
|
||||
if (model.SessionModel != null)
|
||||
{
|
||||
String sessionkey = model.GetType().Name;
|
||||
|
||||
if (Session[sessionkey] is null)
|
||||
{
|
||||
Session[sessionkey] = model.SessionModel;
|
||||
}
|
||||
else
|
||||
{
|
||||
model.SessionModel = (ISessionModel)Session[sessionkey];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected UserDC LoggedInUser
|
||||
{
|
||||
get
|
||||
{
|
||||
if (loggedInUserDc == null)
|
||||
{
|
||||
var user = DAOFactory.GenericDAO.LoadByID<ApplicationUser>(MobileSessionFacade.LoggedInUserOid.Value);
|
||||
loggedInUserDc = MapperFactory.UserDC_User.MapToNewDC(user);
|
||||
loggedInEmployeeDC = MapperFactory.EmployeeDC_Employee.MapToNewDC(user.Employee);
|
||||
}
|
||||
return loggedInUserDc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected EmployeeDC LoggedInEmployee
|
||||
{
|
||||
get
|
||||
{
|
||||
if(loggedInEmployeeDC == null)
|
||||
{
|
||||
var tmp = LoggedInUser; //Sets employee
|
||||
}
|
||||
return loggedInEmployeeDC;
|
||||
}
|
||||
}
|
||||
|
||||
protected MokMandator Mandator
|
||||
{
|
||||
get
|
||||
{
|
||||
return MobileSessionFacade.Mandator;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||
@@ -63,15 +120,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult UpdateApplicationSettings(string pKey, string pValue)
|
||||
{
|
||||
var userSettings = GetUser().Settings;
|
||||
|
||||
var userSettings = LoggedInUser.Settings;
|
||||
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, pKey, pValue, userSettings);
|
||||
|
||||
var loggedInUser = GetUser();
|
||||
|
||||
if(loggedInUser?.UserOid.HasValue ?? false)
|
||||
if(LoggedInUser?.UserOid.HasValue ?? false)
|
||||
{
|
||||
UserService.UpdateUserSettings(loggedInUser.UserOid.Value, userSettings);
|
||||
UserService.UpdateUserSettings(LoggedInUser.UserOid.Value, userSettings);
|
||||
}
|
||||
|
||||
return RedirectToAction("Main");
|
||||
@@ -80,11 +136,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public void UpdateUserSettingsWithoutReload(string key, string value)
|
||||
{
|
||||
var userSettings = GetUser().Settings;
|
||||
var userSettings = LoggedInUser.Settings;
|
||||
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, key, value, userSettings);
|
||||
|
||||
var loggedInUser = GetUser();
|
||||
var loggedInUser = LoggedInUser;
|
||||
|
||||
if(loggedInUser?.UserOid.HasValue ?? false)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
public class CustomerController : ReportBaseController
|
||||
{
|
||||
public CustomerController()
|
||||
{
|
||||
|
||||
}
|
||||
private CustomerModel _Model;
|
||||
public CustomerModel Model
|
||||
{
|
||||
@@ -31,20 +35,33 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if (((CustomerModel) Session[ModelSessionConstants.CustomerModelKey])?.Employee is null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new CustomerModel{Employee = MobileSessionFacade.LoggedInEmployee};
|
||||
Session[ModelSessionConstants.CustomerModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (CustomerModel)Session[ModelSessionConstants.CustomerModelKey];
|
||||
_Model = new CustomerModel();
|
||||
|
||||
InitModel(_Model);
|
||||
InitViewModel();
|
||||
|
||||
}
|
||||
|
||||
//if (((CustomerModel) Session[ModelSessionConstants.CustomerModelKey])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new CustomerModel();
|
||||
|
||||
// InitModel(_Model);
|
||||
|
||||
// Session[ModelSessionConstants.CustomerModelKey] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (CustomerModel)Session[ModelSessionConstants.CustomerModelKey];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Customer(long? id)
|
||||
{
|
||||
@@ -55,12 +72,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
var customerFilter = MobileUserSettingsUtils.GetSettingValueAsEnum(AbstractModel.UserSettings, SettingsKeys.CustomerFilterCustomers, CustomerFilterEnum.MyCustomer);
|
||||
|
||||
Model.SelectedCustomerFilter = customerFilter;
|
||||
|
||||
InitViewModel();
|
||||
|
||||
if(id.HasValue)
|
||||
{
|
||||
LoadCustomerToModel(id);
|
||||
@@ -82,27 +93,70 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
private void InitViewModel()
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
{
|
||||
Logout();
|
||||
return;
|
||||
}
|
||||
|
||||
if(Model.Employee?.EmployeeOid.HasValue ?? false)
|
||||
|
||||
|
||||
if (Model.LoggedInEmployee?.EmployeeOid.HasValue ?? false)
|
||||
{
|
||||
Model.Customers = EmployeeService.GetActiveCustomersForEmployee(Model.Employee.EmployeeOid.Value, Model.SelectedCustomerFilter).OrderBy(customer => customer.LastName).ToList();
|
||||
Model.Customers = EmployeeService.GetActiveCustomersForEmployee(Model.LoggedInEmployee.EmployeeOid.Value, Model.SelectedCustomerFilter).OrderBy(customer => customer.LastName).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Customers = new List<CompactCustomerDC>();
|
||||
}
|
||||
|
||||
if(AbstractModel.IsAllowedToSeeMedikamentenliste)
|
||||
if (Model.CustomerSessionModel.SelectedCustomerOid.HasValue)
|
||||
{
|
||||
Model.SelectedCustomer = CustomerService.LoadCustomer(Model.CustomerSessionModel.SelectedCustomerOid.Value);
|
||||
}
|
||||
|
||||
if (Model.IsAllowedToSeeMedikamentenliste)
|
||||
{
|
||||
Model.ReportTypes = new List<CustomerReportType> { CustomerReportType.Medikamentenliste, CustomerReportType.Bedarfsmedikation, CustomerReportType.Historie };
|
||||
}
|
||||
|
||||
Model.AllAbsenceReasons = AbstractModel.HasRightToViewCustomerAbsenceTimes ? CustomerService.GetAllAbsenceReasons() : new List<AbsenceReasonDC>();
|
||||
Model.AllAbsenceReasons = Model.HasRightToViewCustomerAbsenceTimes ? CustomerService.GetAllAbsenceReasons() : new List<AbsenceReasonDC>();
|
||||
|
||||
|
||||
|
||||
if (Model.CustomerSessionModel.SelectedAbsenceTimeOid.HasValue && Model.SelectedCustomer != null)
|
||||
{
|
||||
Model.SelectedAbsenceTime = Model.SelectedCustomer.AbsenceTimes.FirstOrDefault(absenceTime => absenceTime.AbsenceTimeOid.HasValue && absenceTime.AbsenceTimeOid.Value.Equals(Model.CustomerSessionModel.SelectedAbsenceTimeOid.Value));
|
||||
}
|
||||
|
||||
ReloadBargeldkassen();
|
||||
|
||||
|
||||
if (Model.CustomerSessionModel.SelectedBargeldkasseOid.HasValue && Model.Bargeldkassen != null)
|
||||
{
|
||||
Model.SelectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bargeldkasse => bargeldkasse.BargeldkassenOid.HasValue && bargeldkasse.BargeldkassenOid.Value.Equals(Model.CustomerSessionModel.SelectedBargeldkasseOid.Value));
|
||||
}
|
||||
|
||||
if (Model.CustomerSessionModel.SelectedBargeldtransaktionOid.HasValue)
|
||||
{
|
||||
var kassenbuch = GetBargeldkasseByTransaktionsOid(Model.CustomerSessionModel.SelectedBargeldtransaktionOid.Value);
|
||||
|
||||
var zahlung = kassenbuch?.Bargeldtransaktionen.FirstOrDefault(bargeldtransaktion => bargeldtransaktion.BargeldtransaktionOid.Equals(Model.CustomerSessionModel.SelectedBargeldtransaktionOid.Value));
|
||||
|
||||
Model.SelectedBargeldtransaktion = zahlung;
|
||||
}
|
||||
|
||||
|
||||
if (Model.SelectedCustomer != null)
|
||||
{
|
||||
Model.FolderTree = OperationsService.GetFolderTree(TableID.Customer, Model.SelectedCustomer.CustomerOid.Value);
|
||||
Model.ICD10Diagnosen = OperationsService.GetDiagiosisStringsForICD10Codes(Model.SelectedCustomer.ICD10DiagnosisCodes);
|
||||
}
|
||||
|
||||
|
||||
var customerFilter = MobileUserSettingsUtils.GetSettingValueAsEnum(Model.UserSettings, SettingsKeys.CustomerFilterCustomers, CustomerFilterEnum.MyCustomer);
|
||||
|
||||
Model.SelectedCustomerFilter = customerFilter;
|
||||
}
|
||||
|
||||
private void LoadCustomerToModel(long? customerOid)
|
||||
@@ -112,31 +166,30 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return;
|
||||
}
|
||||
|
||||
if(customerOid == -1)
|
||||
|
||||
|
||||
if (customerOid == -1)
|
||||
{
|
||||
Model.SelectedCustomer = null;
|
||||
Model.SelectedCustomerOid = null;
|
||||
Model.FolderTree = null;
|
||||
Model.ICD10Diagnosen = null;
|
||||
Model.Bargeldkassen = new List<BargeldkassenDC>();
|
||||
Model.BargeldtransaktionshistoryEntries = new List<BargeldtransaktionshistoryDC>();
|
||||
Model.TransaktionsOid2HasHistoryEntries = new Dictionary<long, bool>();
|
||||
Model.SelectedBargeldtransaktion = null;
|
||||
|
||||
Model.CustomerSessionModel.ResetValues();
|
||||
//Model.SelectedCustomer = null;
|
||||
//Model.SelectedCustomerOid = null;
|
||||
//Model.SelectedAbsenceTimeOid = null;
|
||||
//Model.SelectedAbsenceReason = null;
|
||||
//Model.FolderTree = null;
|
||||
//Model.ICD10Diagnosen = null;
|
||||
//Model.Bargeldkassen = new List<BargeldkassenDC>();
|
||||
//Model.BargeldtransaktionshistoryEntries = new List<BargeldtransaktionshistoryDC>();
|
||||
//Model.TransaktionsOid2HasHistoryEntries = new Dictionary<long, bool>();
|
||||
//Model.SelectedBargeldtransaktion = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.FolderTree = OperationsService.GetFolderTree(TableID.Customer, customerOid.Value);
|
||||
Model.SelectedCustomerOid = customerOid;
|
||||
var customer = CustomerService.LoadCustomer(customerOid.Value);
|
||||
|
||||
if(!(customer is null))
|
||||
if (Model.SelectedCustomerOid.HasValue && Model.SelectedCustomerOid != customerOid)
|
||||
{
|
||||
Model.ICD10Diagnosen = OperationsService.GetDiagiosisStringsForICD10Codes(customer.ICD10DiagnosisCodes);
|
||||
Model.CustomerSessionModel.ResetValues();
|
||||
}
|
||||
|
||||
Model.SelectedCustomer = customer;
|
||||
|
||||
ReloadBargeldkassen();
|
||||
Model.SelectedCustomerOid = customerOid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +199,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return Logout();
|
||||
@@ -295,7 +348,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
ObjectOid = Model.SelectedCustomerOid,
|
||||
BinaryData = fileData,
|
||||
FileAttachmentType = FileAttachmentType.NotSpecified,
|
||||
InsertedBy = $"{Model.Employee.FirstName} {Model.Employee.LastName}",
|
||||
InsertedBy = $"{Model.LoggedInEmployee.FirstName} {Model.LoggedInEmployee.LastName}",
|
||||
InsertedOn = DateTime.Now
|
||||
};
|
||||
|
||||
@@ -409,7 +462,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var isAllowedToEdit = MobileSessionFacade.LoggedInUser.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.CustomerView_Edit, UserRightType.EditAll });
|
||||
var isAllowedToEdit = LoggedInUser.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.CustomerView_Edit, UserRightType.EditAll });
|
||||
|
||||
if(isAllowedToEdit && Model.SelectedCustomer != null)
|
||||
{
|
||||
@@ -557,7 +610,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult ShowMedList(int reportType)
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeMedikamentenliste)
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !Model.IsAllowedToSeeMedikamentenliste)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("BeWoReportPartial", Model);
|
||||
@@ -573,7 +626,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult ShowHistoricalMedList(long medListOid)
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeMedikamentenliste)
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !Model.IsAllowedToSeeMedikamentenliste)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("BeWoReportPartial", Model);
|
||||
@@ -589,7 +642,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult DeleteHistoricalMedList(long medListOid)
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeMedikamentenliste)
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !Model.IsAllowedToSeeMedikamentenliste)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("CustomerMedListPartial", Model);
|
||||
@@ -703,9 +756,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var selectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bargeldkasse => bargeldkasse.BargeldkassenOid.HasValue && bargeldkasse.BargeldkassenOid.Value.Equals(oid));
|
||||
//var selectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bargeldkasse => bargeldkasse.BargeldkassenOid.HasValue && bargeldkasse.BargeldkassenOid.Value.Equals(oid));
|
||||
|
||||
Model.SelectedBargeldkasse = selectedBargeldkasse;
|
||||
//Model.SelectedBargeldkasse = selectedBargeldkasse;
|
||||
Model.SelectedBargeldkasseOid = oid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -719,7 +773,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedBargeldkasse = null;
|
||||
//Model.SelectedBargeldkasse = null;
|
||||
Model.SelectedBargeldkasseOid = null;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -733,7 +788,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("CustomerBargeldkassenFormPartial", Model);
|
||||
}
|
||||
|
||||
Model.SelectedBargeldkasse = null;
|
||||
Model.SelectedBargeldkasseOid = null;
|
||||
Model.SelectedAuszahlungsintervall = 0;
|
||||
|
||||
return PartialView("CustomerBargeldkassenFormPartial", Model);
|
||||
@@ -748,6 +803,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("CustomerBargeldkassenFormPartial", Model);
|
||||
}
|
||||
|
||||
Model.SelectedBargeldkasseOid = bargeldkassenOid;
|
||||
Model.SelectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bargeldkasse => bargeldkasse.BargeldkassenOid.HasValue && bargeldkasse.BargeldkassenOid.Value.Equals(bargeldkassenOid));
|
||||
|
||||
if(Model.SelectedBargeldkasse != null)
|
||||
@@ -779,7 +835,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
OperationsService.DeactivateBargeldkasse(bargeldkassenOid, bargeldkassenVersion);
|
||||
|
||||
ReloadBargeldkassen();
|
||||
//ReloadBargeldkassen();
|
||||
|
||||
return RedirectToActionPermanent("Customer");
|
||||
}
|
||||
@@ -797,7 +853,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var name = formCollection["bargeldkassenname"];
|
||||
var rawAnfangsbestand = formCollection["bargeldkassenanfangsbestand"];
|
||||
|
||||
decimal.TryParse(rawAnfangsbestand, out var anfangsbestand);
|
||||
decimal.TryParse(rawAnfangsbestand.Replace(".", ","), out var anfangsbestand);
|
||||
|
||||
var auszahlungsintervall = (Auszahlungsintervall) Model.SelectedAuszahlungsintervall;
|
||||
|
||||
@@ -814,7 +870,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
OperationsService.InsertNewBargeldkasse(newBargeldkasse);
|
||||
|
||||
LoadCustomerToModel(Model.SelectedCustomerOid);
|
||||
//LoadCustomerToModel(Model.SelectedCustomerOid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -831,10 +887,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
OperationsService.UpdateBargeldkasse(bargeldkasse);
|
||||
|
||||
LoadCustomerToModel(Model.SelectedCustomerOid);
|
||||
//LoadCustomerToModel(Model.SelectedCustomerOid);
|
||||
}
|
||||
|
||||
Model.SelectedBargeldkasse = null;
|
||||
//Model.SelectedBargeldkasse = null;
|
||||
Model.SelectedBargeldkasseOid = null;
|
||||
|
||||
return RedirectToActionPermanent("Customer");
|
||||
}
|
||||
@@ -931,8 +988,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
Model.SelectedTransaktionsart = (int) zahlung.Zahlungstyp;
|
||||
}
|
||||
|
||||
Model.SelectedBargeldkasse = kassenbuch;
|
||||
|
||||
//Model.SelectedBargeldkasse = kassenbuch;
|
||||
Model.SelectedBargeldkasseOid = kassenbuch.BargeldkassenOid;
|
||||
|
||||
return PartialView("CustomerBargeldtransaktionenFormPartial", Model);
|
||||
}
|
||||
@@ -962,7 +1020,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.SelectedBargeldtransaktion = null;
|
||||
Model.SelectedTransaktionsart = 0;
|
||||
|
||||
Model.SelectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bk => bk.BargeldkassenOid.HasValue && bk.BargeldkassenOid.Equals(bargeldkassenOid));
|
||||
Model.SelectedBargeldkasseOid = bargeldkassenOid;
|
||||
//Model.SelectedBargeldkasse = Model.Bargeldkassen.FirstOrDefault(bk => bk.BargeldkassenOid.HasValue && bk.BargeldkassenOid.Equals(bargeldkassenOid));
|
||||
|
||||
return PartialView("CustomerBargeldtransaktionenFormPartial", Model);
|
||||
}
|
||||
@@ -1028,7 +1087,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
OperationsService.UpdateBargeldkasse(bargeldkasse);
|
||||
|
||||
Model.SelectedBargeldkasse = null;
|
||||
Model.SelectedBargeldkasseOid = null;
|
||||
|
||||
ReloadBargeldkassen();
|
||||
|
||||
@@ -1070,7 +1129,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("CustomerBargeldkassen", Model);
|
||||
}
|
||||
|
||||
ReloadBargeldkassen();
|
||||
// ReloadBargeldkassen();
|
||||
|
||||
return PartialView("CustomerBargeldkassen", Model);
|
||||
}
|
||||
@@ -1126,7 +1185,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
OperationsService.UpdateBargeldkasse(bargeldkasse);
|
||||
}
|
||||
|
||||
ReloadBargeldkassen();
|
||||
//ReloadBargeldkassen();
|
||||
|
||||
return PartialView("CustomerBargeldkassen", Model);
|
||||
}
|
||||
@@ -1171,7 +1230,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
OperationsService.DeleteBargeldtransaktionSignature(signatureOid.Value);
|
||||
OperationsService.UpdateBargeldkasse(bargeldkasse);
|
||||
|
||||
ReloadBargeldkassen();
|
||||
//ReloadBargeldkassen();
|
||||
}
|
||||
|
||||
return PartialView("CustomerBargeldkassen", Model);
|
||||
@@ -1277,7 +1336,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
LoadCustomerToModel(customer.CustomerOid);
|
||||
|
||||
Model.SelectedAbsenceTime = null;
|
||||
Model.SelectedAbsenceReason = -1;
|
||||
Model.SelectedAbsenceReasonOid = -1;
|
||||
|
||||
return RedirectToActionPermanent("Customer", new { id = customer.CustomerOid });
|
||||
}
|
||||
@@ -1306,8 +1365,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
//return "Es ist ein Fehler bei der Auswahl der zu bearbeitenden Abwesenheit aufgetreten.<br />Bitte wenden Sie sich an Ihren Systemadministrator.";
|
||||
}
|
||||
|
||||
Model.SelectedAbsenceTime = selectedAbsenceTime;
|
||||
Model.SelectedAbsenceReason = selectedAbsenceTime.Reason.AbsenceReasonOid;
|
||||
Model.SelectedAbsenceTimeOid = absenceTimeOid;
|
||||
Model.SelectedAbsenceReasonOid = selectedAbsenceTime.Reason.AbsenceReasonOid;
|
||||
|
||||
//return LeerzeichenFuerGetMethoden;
|
||||
return RedirectToActionPermanent("Customer", Model);
|
||||
@@ -1323,8 +1382,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return "Es ist ein Fehler bei der Auswahl der zu bearbeitenden Abwesenheit aufgetreten.<br />Bitte wenden Sie sich an Ihren Systemadministrator.";
|
||||
}
|
||||
|
||||
Model.SelectedAbsenceTime = selectedAbsenceTime;
|
||||
Model.SelectedAbsenceReason = selectedAbsenceTime.Reason.AbsenceReasonOid;
|
||||
Model.SelectedAbsenceTimeOid = absenceTimeOid;
|
||||
Model.SelectedAbsenceReasonOid = selectedAbsenceTime.Reason.AbsenceReasonOid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -1343,8 +1402,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string DeselectAbsenceTime()
|
||||
{
|
||||
Model.SelectedAbsenceTime = null;
|
||||
Model.SelectedAbsenceReason = -1;
|
||||
Model.SelectedAbsenceTimeOid = null;
|
||||
Model.SelectedAbsenceReasonOid = -1;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
@@ -21,16 +21,23 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if(((DebuggingToolsModel)Session[ModelSessionConstants.DebuggingToolsModelKey])?.Employee == null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new DebuggingToolsModel { Employee = MobileSessionFacade.LoggedInEmployee };
|
||||
Session[ModelSessionConstants.DebuggingToolsModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (DebuggingToolsModel) Session[ModelSessionConstants.DebuggingToolsModelKey];
|
||||
_Model = new DebuggingToolsModel();
|
||||
InitModel(_Model);
|
||||
}
|
||||
|
||||
//if (((DebuggingToolsModel)Session[ModelSessionConstants.DebuggingToolsModelKey])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new DebuggingToolsModel();
|
||||
// InitModel(_Model);
|
||||
// Session[ModelSessionConstants.DebuggingToolsModelKey] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (DebuggingToolsModel) Session[ModelSessionConstants.DebuggingToolsModelKey];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,15 +22,21 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if (((DevExpressSchedulerModel)Session["DevExpressSchedulerModel"])?.Employee == null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new DevExpressSchedulerModel { Employee = MobileSessionFacade.LoggedInEmployee };
|
||||
Session["DevExpressSchedulerModel"] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (DevExpressSchedulerModel)Session["DevExpressSchedulerModel"];
|
||||
_Model = new DevExpressSchedulerModel();
|
||||
InitModel(_Model);
|
||||
}
|
||||
//if (((DevExpressSchedulerModel)Session["DevExpressSchedulerModel"])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new DevExpressSchedulerModel();
|
||||
// InitModel(_Model);
|
||||
// Session["DevExpressSchedulerModel"] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (DevExpressSchedulerModel)Session["DevExpressSchedulerModel"];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
@@ -46,7 +52,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var appointments = KalenderService.LoadFilteredAppointments(
|
||||
true,
|
||||
Model?.Employee?.EmployeeOid ?? 1,
|
||||
Model?.LoggedInEmployee?.EmployeeOid ?? 1,
|
||||
DateTime.Today.AddDays(-60),
|
||||
DateTime.Today.AddDays(60),
|
||||
new List<long>(),
|
||||
|
||||
@@ -31,16 +31,22 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
get
|
||||
{
|
||||
if((ExternalSignatureModel) Session["ExternalSignatureModel"] is null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new ExternalSignatureModel();
|
||||
Session["ExternalSignatureModel"] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (ExternalSignatureModel) Session["ExternalSignatureModel"];
|
||||
}
|
||||
|
||||
|
||||
//if((ExternalSignatureModel) Session["ExternalSignatureModel"] is null)
|
||||
//{
|
||||
// _Model = new ExternalSignatureModel();
|
||||
// Session["ExternalSignatureModel"] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (ExternalSignatureModel) Session["ExternalSignatureModel"];
|
||||
//}
|
||||
|
||||
return _Model ?? new ExternalSignatureModel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,16 +52,16 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
Log.Info($"LoginController.Index(): Loggedin User: {MobileSessionFacade.LoggedInUser.LoginName}");
|
||||
var user = LoggedInUser;
|
||||
|
||||
Log.Info($"LoginController.Index(): Loggedin User: {user.LoginName}");
|
||||
|
||||
MobileSessionFacade.Mandator = OperationsService.GetMandator();
|
||||
MobileSessionFacade.Mandator = DcToMokMapper.CreateMandator(OperationsService.GetMandator());
|
||||
|
||||
var viewServiceRecords = AbstractModel.HasRightToSeeServiceRecords;//AbstractModel.CheckRight(UserRightType.ServiceRecordView_View);
|
||||
var viewAll = AbstractModel.CheckRight(UserRightType.ViewAll);
|
||||
|
||||
var user = UserService.LoadUser(MobileSessionFacade.LoggedInUser.Oid.Value);
|
||||
var userGroups = user.UserGroups;
|
||||
var viewServiceRecords = user.HasRight(UserRightType.ServiceRecordView_View) && user.HasRight(UserRightType.ServiceRecordView_Create);
|
||||
var viewAll = user.HasRight(UserRightType.ViewAll);
|
||||
|
||||
|
||||
//if(!MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecordView_View))) &&
|
||||
// !MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ViewAll))))
|
||||
if(!viewServiceRecords && !viewAll)
|
||||
@@ -72,7 +72,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return View("Index");
|
||||
}
|
||||
|
||||
FormsAuthentication.SetAuthCookie(MobileSessionFacade.LoggedInUser.LoginName, true);
|
||||
FormsAuthentication.SetAuthCookie(LoggedInUser.LoginName, true);
|
||||
ViewData[LoginErrorIndex] = string.Empty;
|
||||
|
||||
var keks = new HttpCookie(MobileSessionFacade.CookieName) { Value = MobileSessionFacade.Tenant, Expires = DateTime.Now.AddDays(1) };
|
||||
@@ -124,11 +124,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Log.Info($"LoginController.Index(): Login failed! Tenant = {MobileSessionFacade.Tenant}");
|
||||
|
||||
ViewData[LoginErrorIndex] = Request.Browser.Browser.Equals("InternetExplorer") ?
|
||||
"Dieser Browser ist nicht mit dem mobilen BeWoPlaner kompatibel. Bitte benutzen Sie einen anderen Browser als den Internet Explorer." :
|
||||
"Die Anmeldung ist fehlgeschlagen. Bitte überprüfen Sie Benutzername und Passwort.";
|
||||
ViewData[LoginErrorIndex] = Request.Browser.Browser.Equals("InternetExplorer") ?
|
||||
"Dieser Browser ist nicht mit dem mobilen BeWoPlaner kompatibel. Bitte benutzen Sie einen anderen Browser als den Internet Explorer." :
|
||||
"Die Anmeldung ist fehlgeschlagen. Bitte überprüfen Sie Benutzername und Passwort.";
|
||||
|
||||
return View("Index");
|
||||
return View("Index");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.Service.Plugins;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
// Controller des Quittierungsbelegsmoduls
|
||||
|
||||
@@ -33,20 +34,83 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if(((ReportModel) Session[ModelSessionConstants.ReportModelKey])?.Employee is null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new ReportModel {Employee = MobileSessionFacade.LoggedInEmployee, ReportCreator = GetReportCreator()};
|
||||
Session[ModelSessionConstants.ReportModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (ReportModel) Session[ModelSessionConstants.ReportModelKey];
|
||||
_Model = new ReportModel { ReportCreator = GetReportCreator() };
|
||||
InitModel(_Model);
|
||||
InitViewModel();
|
||||
}
|
||||
//if (((ReportModel) Session[ModelSessionConstants.ReportModelKey])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new ReportModel {ReportCreator = GetReportCreator()};
|
||||
// InitModel(_Model);
|
||||
// Session[ModelSessionConstants.ReportModelKey] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (ReportModel) Session[ModelSessionConstants.ReportModelKey];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitViewModel()
|
||||
{
|
||||
var month = DateTime.Today.Month;
|
||||
var year = DateTime.Today.Year;
|
||||
var first = new DateTime(year, month, 1).AddMonths(-1);
|
||||
var last = first.AddMonths(1).AddDays(-1);
|
||||
|
||||
Model.SelectedYear = Model.SelectedYear ?? first.Year;
|
||||
Model.SelectedMonth = Model.SelectedMonth ?? first.Month;
|
||||
Model.SelectedStartDay = Model.SelectedStartDay ?? first.Day;
|
||||
Model.SelectedEndDay = Model.SelectedEndDay ?? last.Day;
|
||||
|
||||
InitFilterCombo();
|
||||
|
||||
Model.Customers.Clear();
|
||||
|
||||
Model.Customers = CustomerService.GetAllActiveCustomersForEmployee();
|
||||
|
||||
Model.Employees = EmployeeService.GetActiveCompactEmployeesForEmployee(LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
Model.ServiceCategories = OperationsService.GetAllServiceCategories();
|
||||
|
||||
Model.Organisations = CustomerService.GetAllCostBearerCompact();
|
||||
Model.Organisations.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.CurrentCulture));
|
||||
|
||||
Model.AllTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
Model.Dokutypes = ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType);
|
||||
if (Model.Dokutypes != null)
|
||||
{
|
||||
Model.Dokutypes = Model.Dokutypes.OrderBy(s => s.ValueListEntryOid).ToArray();
|
||||
}
|
||||
|
||||
if (Model.SelectedCustomerOid.HasValue)
|
||||
{
|
||||
Model.SelectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == Model.SelectedCustomerOid.Value);
|
||||
}
|
||||
|
||||
if (Model.SelectedEmployeeOid.HasValue)
|
||||
{
|
||||
Model.SelectedEmployee = Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(Model.SelectedEmployeeOid.Value));
|
||||
}
|
||||
if (Model.SelectedTeamOid.HasValue)
|
||||
{
|
||||
Model.SelectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == Model.SelectedTeamOid.Value);
|
||||
}
|
||||
if (Model.SelectedOrganisationOid.HasValue)
|
||||
{
|
||||
Model.SelectedOrganisation= Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(Model.SelectedOrganisationOid.Value));
|
||||
}
|
||||
if (Model.SelectedServiceCategoryOid.HasValue)
|
||||
{
|
||||
Model.SelectedServiceCategory = Model.ServiceCategories.FirstOrDefault(serviceCategory => serviceCategory.ServiceCategoryOid == Model.SelectedServiceCategoryOid.Value);
|
||||
}
|
||||
}
|
||||
|
||||
private static AbstractReportCreator GetReportCreator()
|
||||
{
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>();
|
||||
@@ -68,7 +132,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToViewQuittierungsbelege)
|
||||
if(!_Model.HasRightToViewQuittierungsbelege)
|
||||
{
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
@@ -82,12 +146,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || Model?.Employee?.EmployeeOid is null)
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToViewQuittierungsbelege)
|
||||
if(!Model.HasRightToViewQuittierungsbelege)
|
||||
{
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
@@ -98,36 +162,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
var month = DateTime.Today.Month;
|
||||
var year = DateTime.Today.Year;
|
||||
var first = new DateTime(year, month, 1).AddMonths(-1);
|
||||
var last = first.AddMonths(1).AddDays(-1);
|
||||
|
||||
Model.SelectedYear = Model.SelectedYear ?? first.Year;
|
||||
Model.SelectedMonth = Model.SelectedMonth ?? first.Month;
|
||||
Model.SelectedStartDay = Model.SelectedStartDay ?? first.Day;
|
||||
Model.SelectedEndDay = Model.SelectedEndDay ?? last.Day;
|
||||
|
||||
InitFilterCombo();
|
||||
|
||||
Model.Customers.Clear();
|
||||
|
||||
Model.Customers = CustomerService.GetAllActiveCustomersForEmployee();
|
||||
|
||||
Model.Employees = EmployeeService.GetActiveCompactEmployeesForEmployee(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid);
|
||||
|
||||
Model.ServiceCategories = OperationsService.GetAllServiceCategories();
|
||||
|
||||
Model.Organisations = CustomerService.GetAllCostBearerCompact();
|
||||
Model.Organisations.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.CurrentCulture));
|
||||
|
||||
Model.AllTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid);
|
||||
|
||||
Model.Dokutypes = ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType);
|
||||
if(Model.Dokutypes != null)
|
||||
{
|
||||
Model.Dokutypes = Model.Dokutypes.OrderBy(s => s.ValueListEntryOid).ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -143,9 +178,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var filterList = new List<QbFilterItem>();
|
||||
|
||||
var hasRightToViewCustomers = AbstractModel.CheckForAtLeastOneRight(new[] { UserRightType.CustomerView_View, UserRightType.ViewAll });
|
||||
var hasRightToViewCustomers = Model.CheckForAtLeastOneRight(new[] { UserRightType.CustomerView_View, UserRightType.ViewAll });
|
||||
|
||||
var hasRightToViewMyTeams = AbstractModel.CheckForAtLeastOneRight(new[] { UserRightType.Customer_ViewMyTeams, UserRightType.ViewAll });
|
||||
var hasRightToViewMyTeams = Model.CheckForAtLeastOneRight(new[] { UserRightType.Customer_ViewMyTeams, UserRightType.ViewAll });
|
||||
|
||||
if(hasRightToViewCustomers)
|
||||
{
|
||||
@@ -160,14 +195,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
filterList.Add(new QbFilterItem(QBFilterEnum.MeineKlienten));
|
||||
filterList.Add(new QbFilterItem(QBFilterEnum.KlientenAuswahl));
|
||||
|
||||
if(AbstractModel.CheckRight(UserRightType.TeamView_ViewMyTeams) && false == AbstractModel.CheckRight(UserRightType.TeamView_ViewAll))
|
||||
if(Model.CheckRight(UserRightType.TeamView_ViewMyTeams) && false == Model.CheckRight(UserRightType.TeamView_ViewAll))
|
||||
{
|
||||
if(hasRightToViewMyTeams)
|
||||
{
|
||||
filterList.Add(new QbFilterItem(QBFilterEnum.TeamAuswahl));
|
||||
}
|
||||
}
|
||||
else if(AbstractModel.CheckRight(UserRightType.TeamView_ViewAll))
|
||||
else if(Model.CheckRight(UserRightType.TeamView_ViewAll))
|
||||
{
|
||||
if(hasRightToViewCustomers)
|
||||
{
|
||||
@@ -286,9 +321,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(Model.SelectedEmployee is null && (Model.Employee?.EmployeeOid.HasValue ?? false))
|
||||
if(Model.SelectedEmployee is null && (Model.LoggedInEmployee?.EmployeeOid.HasValue ?? false))
|
||||
{
|
||||
return $"{Model.Employee.LastNameFirstName}_{Model.Employee.EmployeeOid.Value}";
|
||||
return $"{Model.LoggedInEmployee.LastNameFirstName}_{Model.LoggedInEmployee.EmployeeOid.Value}";
|
||||
}
|
||||
|
||||
return $"{Model.SelectedEmployee.DetailDescription}_{Model.SelectedEmployee.EmployeeOid}";
|
||||
@@ -303,6 +338,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
Model.SelectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == customerOid);
|
||||
Model.SelectedCustomerOid = customerOid;
|
||||
|
||||
return Model.SelectedCustomer?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -316,7 +352,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
Model.SelectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == teamOid);
|
||||
|
||||
Model.SelectedTeamOid = teamOid;
|
||||
return Model.SelectedTeam?.DetailDescription ?? string.Empty;
|
||||
}
|
||||
|
||||
@@ -386,12 +422,24 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var isParsingSuccessful2 = long.TryParse(organisationOidStr, out var organisationOid);
|
||||
var isParsingSuccessful3 = long.TryParse(categoryOidStr, out var categoryOid);
|
||||
Model.SelectedOrganisationOid = null;
|
||||
Model.SelectedServiceCategoryOid = null;
|
||||
|
||||
Model.SelectedOrganisation = isParsingSuccessful2 ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
|
||||
if (long.TryParse(organisationOidStr, out var organisationOid))
|
||||
{
|
||||
Model.SelectedOrganisationOid = organisationOid;
|
||||
}
|
||||
|
||||
if (long.TryParse(categoryOidStr, out var categoryOid))
|
||||
{
|
||||
Model.SelectedServiceCategoryOid = categoryOid;
|
||||
}
|
||||
|
||||
|
||||
Model.SelectedServiceCategory = isParsingSuccessful3 ? OperationsService.LoadServiceCategory(categoryOid) : null;
|
||||
//Model.SelectedOrganisation = isParsingSuccessful2 ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
|
||||
|
||||
//Model.SelectedServiceCategory = isParsingSuccessful3 ? OperationsService.LoadServiceCategory(categoryOid) : null;
|
||||
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -407,6 +455,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.IsForSelectedEmployeesOnly = isForSelectedEmployeeOnly ?? false;
|
||||
Model.SelectedEmployee = employeeOid.HasValue ? Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid.Value)) : null;
|
||||
Model.SelectedEmployeeOid = employeeOid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -421,6 +470,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
Model.SelectedEmployee = employeeOid.HasValue ? Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid)) : null;
|
||||
Model.SelectedEmployeeOid = employeeOid;
|
||||
|
||||
return Model.SelectedEmployee?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -438,6 +488,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.SelectedOrganisation = organisationOid.HasValue && Model.IsForSelectedCostbearersOnly ?
|
||||
Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) :
|
||||
null;
|
||||
Model.SelectedOrganisationOid = organisationOid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -452,6 +503,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
Model.SelectedOrganisation = organisationOid.HasValue ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
|
||||
Model.SelectedOrganisationOid = organisationOid;
|
||||
|
||||
return Model.SelectedOrganisation?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -468,6 +520,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.IsForSelectedCategoryOnly = isForSelectedServiceCategoryOnly ?? false;
|
||||
|
||||
Model.SelectedServiceCategory = serviceCategoryOid.HasValue && Model.IsForSelectedCategoryOnly ? Model.ServiceCategories.FirstOrDefault(serviceCategory => serviceCategory.ServiceCategoryOid == serviceCategoryOid) : null;
|
||||
Model.SelectedServiceCategoryOid = serviceCategoryOid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -485,6 +538,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
Model.SelectedServiceCategory = Model.ServiceCategories.FirstOrDefault(serviceCategory => serviceCategory.ServiceCategoryOid == serviceCategoryOid);
|
||||
}
|
||||
Model.SelectedServiceCategoryOid = serviceCategoryOid;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -512,7 +566,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var selectedFilterEnum = (QBFilterEnum) filterEnumValue;
|
||||
|
||||
Model.SelectedFilterItem = new QbFilterItem(selectedFilterEnum);
|
||||
Model.SelectedFilterItemId = selectedFilterEnum;
|
||||
|
||||
if(selectedFilterEnum != QBFilterEnum.KlientenAuswahl || Model.SelectedCustomer != null)
|
||||
{
|
||||
@@ -523,7 +577,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(!(customer is null))
|
||||
{
|
||||
Model.SelectedCustomer = customer;
|
||||
Model.SelectedCustomerOid = customer.CustomerOid;
|
||||
}
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
@@ -582,9 +636,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
var temp = csr.ServiceRecords.Where(sr => sr.ServiceRecordOid.HasValue && !serviceRecordOidsWithSignature.Contains(sr.ServiceRecordOid.Value));
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
if(!Model.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
temp = temp.Where(sr => sr.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee));
|
||||
temp = temp.Where(sr => sr.Employee.Equals(LoggedInUser.Employee));
|
||||
}
|
||||
|
||||
csr.ServiceRecords.Clear();
|
||||
@@ -613,9 +667,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var filteredServiceRecords = new List<ServiceRecordDC>();
|
||||
|
||||
if(!isCustomerSig && !AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
if(!isCustomerSig && !Model.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
filteredServiceRecords = serviceRecords.Where(sr => sr.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee)).ToList();
|
||||
filteredServiceRecords = serviceRecords.Where(sr => sr.Employee.Equals(LoggedInUser.Employee)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -626,7 +680,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
ServiceRecords = filteredServiceRecords,
|
||||
CustomerOid = isCustomerSig ? (long?) customerOid : null,
|
||||
Employee = isCustomerSig ? null : MobileSessionFacade.LoggedInCompactEmployee,
|
||||
Employee = isCustomerSig ? null : LoggedInUser.Employee,
|
||||
SignatureImage = base64SignatureString,
|
||||
SignatureType = signatureType,
|
||||
TimeSpanString = timeSpanString
|
||||
@@ -751,14 +805,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var info = formCollection["deleteCustomerSignaturesInfo"];
|
||||
|
||||
if(AbstractModel.HasRightToDeleteReceiptSignatures)
|
||||
if(Model.HasRightToDeleteReceiptSignatures)
|
||||
{
|
||||
DeleteSignatures(info, true);
|
||||
}
|
||||
|
||||
LoadPaginatedQbEntries(Model.CurrentQbEntryPage);
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
return RedirectToAction("InitReports");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -773,20 +827,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var info = formCollection["deleteEmployeeSignatureInfo"];
|
||||
|
||||
if(AbstractModel.HasRightToDeleteReceiptSignatures)
|
||||
if(Model.HasRightToDeleteReceiptSignatures)
|
||||
{
|
||||
DeleteSignatures(info, false);
|
||||
}
|
||||
|
||||
LoadPaginatedQbEntries(Model.CurrentQbEntryPage);
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
return RedirectToAction("InitReports");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
private void DeleteSignatures(string guid, bool isCustomerSignature)
|
||||
{
|
||||
if(Model is null || !AbstractModel.HasRightToDeleteReceiptSignatures)
|
||||
if(Model is null || !Model.HasRightToDeleteReceiptSignatures)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -843,13 +897,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.SelectedConfirmationReceiptSignatures = ConvertSignatureDCsToSignatureObjects(signatures);
|
||||
|
||||
var customerName = obj.CustomerName;
|
||||
var employeeName = MobileSessionFacade.LoggedInCompactEmployee.SimpleDescription;
|
||||
var employeeName = LoggedInUser.Employee.SimpleDescription;
|
||||
|
||||
var serviceRecordCount = 0;
|
||||
|
||||
if(isEmployee)
|
||||
{
|
||||
serviceRecordCount = AbstractModel.HasRightToProvideEmployeeSignatureForOthers ? obj.Items.Count : obj.Items.Count(x => x.EmployeeOid.Equals(Model.Employee.EmployeeOid));
|
||||
serviceRecordCount = Model.HasRightToProvideEmployeeSignatureForOthers ? obj.Items.Count : obj.Items.Count(x => x.EmployeeOid.Equals(LoggedInEmployee.EmployeeOid));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -863,38 +917,39 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("ConfirmationReceiptSignaturePartial", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult LoadReportToModel()
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("QuittierungsbelegsPreviewPartial");
|
||||
}
|
||||
//[Authorize]
|
||||
//public ActionResult LoadReportToModel()
|
||||
//{
|
||||
// if(Model is null)
|
||||
// {
|
||||
// TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
// return PartialView("QuittierungsbelegsPreviewPartial");
|
||||
// }
|
||||
|
||||
var month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
var year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
var customerOid = Model.SelectedCustomerOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var organisationOid = Model.SelectedOrganisationOid;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var startDate = Model.SelectedStartDay ?? 1;
|
||||
// var month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
// var year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
// var customerOid = Model.SelectedCustomerOid;
|
||||
// var teamOid = Model.SelectedTeamOid;
|
||||
// var employeeOid = Model.SelectedEmployeeOid;
|
||||
// var organisationOid = Model.SelectedOrganisationOid;
|
||||
// var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
// var startDate = Model.SelectedStartDay ?? 1;
|
||||
|
||||
var date = new DateTime(year, month, startDate);
|
||||
// var date = new DateTime(year, month, startDate);
|
||||
|
||||
var endDate = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
var filterType = Model.SelectedFilterItem;
|
||||
// var endDate = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
// var filterType = Model.SelectedFilterItem;
|
||||
|
||||
Model.QuittierungsbelegsReportObject = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
// Model.QuittierungsbelegsReportObject = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
|
||||
return PartialView("QuittierungsbelegsPreviewPartial", Model);
|
||||
}
|
||||
// return PartialView("QuittierungsbelegsPreviewPartial", Model);
|
||||
//}
|
||||
|
||||
[Authorize]
|
||||
public string ResetQuittierungsbeleg()
|
||||
{
|
||||
Model.QuittierungsbelegsReportObject = null;
|
||||
Model.QuittierungsbelegsReportSettings = null;
|
||||
Model.QuittierungsbelegsReport = null;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -909,28 +964,61 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
var month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
var year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
var customerOid = Model.SelectedCustomerOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var organisationOid = Model.SelectedOrganisationOid;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var startDate = Model.SelectedStartDay ?? 1;
|
||||
var reportSettings = new QuittierungsbelegsReportSettings();
|
||||
|
||||
var date = new DateTime(year, month, startDate);
|
||||
reportSettings.Month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
reportSettings.Year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
reportSettings.CustomerOid = Model.SelectedCustomerOid;
|
||||
reportSettings.TeamOid = Model.SelectedTeamOid;
|
||||
reportSettings.EmployeeOid = Model.SelectedEmployeeOid;
|
||||
reportSettings.OrganisationOid = Model.SelectedOrganisationOid;
|
||||
reportSettings.ServiceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
reportSettings.StartDay = Model.SelectedStartDay ?? 1;
|
||||
|
||||
var endDate = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
var filterType = Model.SelectedFilterItem;
|
||||
var date = new DateTime(reportSettings.Year, reportSettings.Month, reportSettings.StartDay);
|
||||
|
||||
var report = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
reportSettings.EndDay = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
reportSettings.FilterEnum = Model.SelectedFilterItem.FilterEnum;
|
||||
|
||||
|
||||
Model.QuittierungsbelegsReportSettings = reportSettings;
|
||||
|
||||
//var report = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
|
||||
//report.ExportOptions.PrintPreview.DefaultFileName = CreateFileName();
|
||||
//report.DisplayName = CreateFileName();
|
||||
|
||||
|
||||
return RedirectToAction("InitReports");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult CreateQuittierungsbelegsReport()
|
||||
{
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("QuittierungsbelegsPreviewPartial");
|
||||
}
|
||||
Model.QuittierungsbelegsReport = CreateQuittierungsbelegsReportFromSettings();
|
||||
|
||||
return PartialView("QuittierungsbelegsPreviewPartial", Model);
|
||||
}
|
||||
|
||||
private XtraReport CreateQuittierungsbelegsReportFromSettings()
|
||||
{
|
||||
if (Model.QuittierungsbelegsReportSettings == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var s = Model.QuittierungsbelegsReportSettings;
|
||||
|
||||
var report = Model.ReportCreator.CreateServiceOverviewReportNew(s.Month, s.Year, s.FilterEnum, s.CustomerOid, s.TeamOid, s.EmployeeOid, s.OrganisationOid, s.ServiceCategoryOid, s.StartDay, s.EndDay, false);
|
||||
|
||||
report.ExportOptions.PrintPreview.DefaultFileName = CreateFileName();
|
||||
report.DisplayName = CreateFileName();
|
||||
|
||||
Model.QuittierungsbelegsReportObject = report;
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
return report;
|
||||
}
|
||||
|
||||
private string CreateFileName()
|
||||
@@ -1040,6 +1128,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
else
|
||||
{
|
||||
Model.SelectedCustomer = null;
|
||||
Model.SelectedCustomerOid = null;
|
||||
}
|
||||
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
|
||||
@@ -1058,6 +1147,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
else
|
||||
{
|
||||
Model.SelectedTeam = null;
|
||||
Model.SelectedTeamOid = null;
|
||||
}
|
||||
|
||||
var reportTimeFrame = GetReportTimeFrame();
|
||||
@@ -1154,15 +1244,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
employeeSignatureState = SignatureState.All;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
if(!Model.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
// Prüfen, ob alle eigenen ServiceRecords unterschrieben sind
|
||||
var ownServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => ownServiceRecordOids.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
reportObjects.DoForEach(reportObject => ownServiceRecordOids.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(LoggedInEmployee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
// Prüfen, ob Einträge von anderen Mitarbeitern existieren
|
||||
var serviceRecordOidsFromOtherEmployees = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => serviceRecordOidsFromOtherEmployees.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
reportObjects.DoForEach(reportObject => serviceRecordOidsFromOtherEmployees.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(LoggedInEmployee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
@@ -1253,10 +1343,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
employeeOids.AddIfNotIn(serviceDetail.EmployeeOid);
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
if(!Model.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
var serviceRecordOidsFromOtherEmployees = reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var ownServiceRecordOids = reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var serviceRecordOidsFromOtherEmployees = reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(LoggedInEmployee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var ownServiceRecordOids = reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(LoggedInEmployee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
@@ -33,29 +33,30 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if(((ReportViewerModel)Session[ModelSessionConstants.ReportViewerModelKey])?.Employee is null)
|
||||
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new ReportViewerModel { Employee = MobileSessionFacade.LoggedInEmployee, ReportCreator = GetReportCreator() };
|
||||
Session[ModelSessionConstants.ReportViewerModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (ReportViewerModel)Session[ModelSessionConstants.ReportViewerModelKey];
|
||||
_Model = new ReportViewerModel { ReportCreator = GetReportCreator() };
|
||||
InitModel(_Model);
|
||||
InitViewModel();
|
||||
}
|
||||
|
||||
//if (((ReportViewerModel)Session[ModelSessionConstants.ReportViewerModelKey])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new ReportViewerModel { ReportCreator = GetReportCreator() };
|
||||
// Session[ModelSessionConstants.ReportViewerModelKey] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (ReportViewerModel)Session[ModelSessionConstants.ReportViewerModelKey];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult ReportViewer()
|
||||
private void InitViewModel()
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return Logout();
|
||||
}
|
||||
|
||||
Model.Report = null;
|
||||
|
||||
var month = DateTime.Today.Month;
|
||||
@@ -67,27 +68,39 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
|
||||
|
||||
Model.AllEmployees = AbstractModel.HasRightMitarbeiterstundenkontoViewAll
|
||||
? EmployeeService.GetAllActiveEmployeesCompact()
|
||||
: new List<CompactEmployeeDC> { MobileSessionFacade.LoggedInCompactEmployee };
|
||||
Model.AllEmployees = Model.HasRightMitarbeiterstundenkontoViewAll
|
||||
? EmployeeService.GetAllActiveEmployeesCompact()
|
||||
: new List<CompactEmployeeDC> { LoggedInUser.Employee };
|
||||
|
||||
// Alle Teams darf man nur sehen, wenn man das Recht "HasRightMitarbeiterstundenkontoViewAll" hat.
|
||||
// Hat man weder das Recht "HasRightMitarbeiterstundenkontoViewAll" noch "HasRightMitarbeiterstundenkontoViewTeams", sieht man die Teams gar nicht.
|
||||
// Hat man das Recht "HasRightMitarbeiterstundenkontoViewTeams", aber nicht das Recht "HasRightMitarbeiterstundenkontoViewAll", sieht man nur die Teams, deren Teamleiter man ist.
|
||||
|
||||
Model.AllTeams = AbstractModel.HasRightMitarbeiterstundenkontoViewAll
|
||||
? EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid)
|
||||
: EmployeeService.FindLeadingCompactTeamsOfEmployee(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid);
|
||||
Model.AllTeams = Model.HasRightMitarbeiterstundenkontoViewAll
|
||||
? EmployeeService.GetAllActiveCompactTeamsForEmployee(LoggedInEmployee.EmployeeOid)
|
||||
: EmployeeService.FindLeadingCompactTeamsOfEmployee(LoggedInUser.Employee.EmployeeOid);
|
||||
|
||||
if(false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll || Model.SelectedEmployee is null)
|
||||
if (false == Model.HasRightMitarbeiterstundenkontoViewAll || Model.SelectedEmployeeOid is null)
|
||||
{
|
||||
Model.SelectedEmployee = MobileSessionFacade.LoggedInCompactEmployee;
|
||||
Model.SelectedEmployeeOid = LoggedInUser.Employee.EmployeeOid;
|
||||
}
|
||||
|
||||
if (Model.SelectedEmployeeOid.HasValue)
|
||||
{
|
||||
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(employee => employee.EmployeeOid.Equals(Model.SelectedEmployeeOid.Value));
|
||||
}
|
||||
|
||||
if (Model.SelectedTeamOid.HasValue)
|
||||
{
|
||||
Model.SelectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid.Equals(Model.SelectedTeamOid.Value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Model.ReportTypes = new List<SelectListItem>();
|
||||
|
||||
#if DEBUG
|
||||
if(AbstractModel.HasRightToViewReports)
|
||||
if (Model.HasRightToViewReports)
|
||||
{
|
||||
Model.ReportTypes.Add(new SelectListItem
|
||||
{
|
||||
@@ -100,15 +113,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.Queries = QueryService.GetAllQueriesOfType(QueryType.Public);
|
||||
|
||||
if (Model.SelectedQueryOid.HasValue)
|
||||
{
|
||||
Model.SelectedQuery = Model.Queries.FirstOrDefault(q => q.Oid.Equals(Model.SelectedQueryOid.Value));
|
||||
}
|
||||
|
||||
var names2ValueListEntryTypes = new Dictionary<string, ValueListEntryType>();
|
||||
|
||||
foreach(var query in Model.Queries.Where(q => q.Parameter?.Any() ?? false))
|
||||
foreach (var query in Model.Queries.Where(q => q.Parameter?.Any() ?? false))
|
||||
{
|
||||
foreach(var parameter in query.Parameter.Where(p => p.ParamType == QueryParameterType.ValueListEntryType))
|
||||
foreach (var parameter in query.Parameter.Where(p => p.ParamType == QueryParameterType.ValueListEntryType))
|
||||
{
|
||||
var parameterName = parameter.Name;
|
||||
|
||||
if(!(parameterName?.Contains("_") ?? false))
|
||||
if (!(parameterName?.Contains("_") ?? false))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -118,12 +136,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var name = name2Type[0];
|
||||
var type = name2Type[1];
|
||||
|
||||
if(!int.TryParse(type, out var typeEnumInt))
|
||||
if (!int.TryParse(type, out var typeEnumInt))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var valueListEntryType = (ValueListEntryType) typeEnumInt;
|
||||
var valueListEntryType = (ValueListEntryType)typeEnumInt;
|
||||
names2ValueListEntryTypes.AddIfNotIn(new KeyValuePair<string, ValueListEntryType>(name, valueListEntryType));
|
||||
}
|
||||
}
|
||||
@@ -135,9 +153,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.ValueListEntryTypes2ValueListEntries.AddOrUpdateValueInDictionary(valueListEntry.Type, valueListEntry);
|
||||
});
|
||||
|
||||
if(Model.Employee?.EmployeeOid.HasValue ?? false)
|
||||
if (Model.LoggedInEmployee?.EmployeeOid.HasValue ?? false)
|
||||
{
|
||||
Model.SupportConcepts = EmployeeService.GetActiveSupportConceptsForEmployee(Model.Employee.EmployeeOid, CustomerFilterEnum.All);
|
||||
Model.SupportConcepts = EmployeeService.GetActiveSupportConceptsForEmployee(Model.LoggedInEmployee.EmployeeOid, CustomerFilterEnum.All);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,9 +164,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SupportConcepts.DoForEach(sc => Model.CostBearer2SupportConceptRels.AddRangeIfElementsNotIn(sc.CostBearerRelations));
|
||||
|
||||
if(Model.SelectedCostBearer2SupportConceptRelListObject is null)
|
||||
if (Model.SelectedCostBearer2SupportConceptRelListObject is null)
|
||||
{
|
||||
Model.SelectedCostBearer2SupportConceptRelListObject = Model.CostBearer2SupportConceptRelListObjects.FirstOrDefault(f => f.CostBearer2SupportConceptOid == "-1") ?? Model.CostBearer2SupportConceptRelListObjects.First();
|
||||
Model.SelectedCostBearer2SupportConceptRelListObject = Model.CostBearer2SupportConceptRelListObjects.FirstOrDefault(f => f.CostBearer2SupportConceptOid == -1) ?? Model.CostBearer2SupportConceptRelListObjects.First();
|
||||
}
|
||||
|
||||
Model.AllOrganisationForQuery = CustomerService.GetAllActiveOrganisationsCompact();
|
||||
@@ -156,12 +174,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.AllServiceCategoriesForQueries = OperationsService.GetAllServiceCategories();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
if(AbstractModel.HasRightToViewMitarbeiterstundenkonto)
|
||||
if (Model.HasRightToViewMitarbeiterstundenkonto)
|
||||
{
|
||||
Model.ReportTypes.Add(new SelectListItem
|
||||
{
|
||||
@@ -178,6 +196,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
#if DEBUG
|
||||
//Model.SelectedReportType = ReportType.Berichte;
|
||||
#endif
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult ReportViewer()
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return Logout();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
@@ -198,7 +228,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null || reportOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null || reportOid is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("BeWoReportPartial");
|
||||
@@ -216,7 +246,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedQuery = selectedQuery;
|
||||
|
||||
var dcid = $"{MobileSessionFacade.Tenant}queryeoid{Model.Employee.EmployeeOid.Value}";
|
||||
var dcid = $"{MobileSessionFacade.Tenant}queryeoid{Model.LoggedInEmployee.EmployeeOid.Value}";
|
||||
|
||||
var queryResult = QueryService.ExecuteQuery(selectedQuery.Oid, null);
|
||||
|
||||
@@ -249,7 +279,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null || reportOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null || reportOid is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("BerichteFormPartialView");
|
||||
@@ -318,7 +348,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
private string GetSiteOfOrigin()
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -361,6 +391,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedEmployeeOid = employeeOid;
|
||||
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid.Value));
|
||||
|
||||
return Model.SelectedEmployee?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
@@ -381,6 +412,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedTeamOid = teamOid;
|
||||
Model.SelectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid.Equals(teamOid.Value));
|
||||
|
||||
return Model.SelectedTeam?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
@@ -389,7 +421,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadMitarbeiterstundenkonto(int ansicht, int month, int year, bool all, bool isEmployee)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("BeWoReportPartial");
|
||||
@@ -397,13 +429,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var teamOids = new List<long>();
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var oid = isEmployee ? employeeOid ?? Model.Employee.EmployeeOid.Value : Model.SelectedTeamOid;
|
||||
var oid = isEmployee ? employeeOid ?? Model.LoggedInEmployee.EmployeeOid.Value : Model.SelectedTeamOid;
|
||||
|
||||
if(isEmployee)
|
||||
{
|
||||
teamOids = null;
|
||||
employeeOid = oid;
|
||||
|
||||
if(all || false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
if(all || false == Model.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
employeeOid = null;
|
||||
}
|
||||
@@ -413,16 +446,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
employeeOid = oid;
|
||||
}
|
||||
|
||||
if(false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
if(false == Model.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
employeeOid = Model.Employee.EmployeeOid;
|
||||
employeeOid = Model.LoggedInEmployee.EmployeeOid;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
employeeOid = null;
|
||||
|
||||
var teamOid = oid;
|
||||
|
||||
if(all || (!AbstractModel.HasRightMitarbeiterstundenkontoViewAll && !AbstractModel.HasRightMitarbeiterstundenkontoViewTeams))
|
||||
if(all || (!Model.HasRightMitarbeiterstundenkontoViewAll && !Model.HasRightMitarbeiterstundenkontoViewTeams))
|
||||
{
|
||||
teamOid = null;
|
||||
}
|
||||
@@ -723,7 +758,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult ExecuteQuery()
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
|
||||
@@ -748,7 +783,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
var dcid = $"{MobileSessionFacade.Tenant}queryeoid{Model.Employee.EmployeeOid.Value}";
|
||||
var dcid = $"{MobileSessionFacade.Tenant}queryeoid{Model.LoggedInEmployee.EmployeeOid.Value}";
|
||||
|
||||
var queryResult = QueryService.ExecuteQuery(query.Oid, paramList);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
|
||||
using BeWoPlanerMobil.Models;
|
||||
@@ -32,35 +34,37 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if (((SchedulerModel) Session[ModelSessionConstants.SchedulerModelKey])?.Employee is null)
|
||||
if (_Model == null)
|
||||
{
|
||||
_Model = new SchedulerModel { Employee = MobileSessionFacade.LoggedInEmployee };
|
||||
Session[ModelSessionConstants.SchedulerModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Model = (SchedulerModel) Session[ModelSessionConstants.SchedulerModelKey];
|
||||
_Model = new SchedulerModel();
|
||||
InitModel(_Model);
|
||||
InitViewModel();
|
||||
}
|
||||
|
||||
//if (((SchedulerModel) Session[ModelSessionConstants.SchedulerModelKey])?.LoggedInEmployee is null)
|
||||
//{
|
||||
// _Model = new SchedulerModel();
|
||||
// InitModel(_Model);
|
||||
// Session[ModelSessionConstants.SchedulerModelKey] = _Model;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// _Model = (SchedulerModel) Session[ModelSessionConstants.SchedulerModelKey];
|
||||
//}
|
||||
|
||||
return _Model;
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Scheduler()
|
||||
private void InitViewModel()
|
||||
{
|
||||
if(Model is null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeScheduler)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(AbstractModel.HasRightToInsertRessourceAppointments || AbstractModel.HasRightToViewAllResourceAppointments)
|
||||
if (Model.HasRightToInsertRessourceAppointments || Model.HasRightToViewAllResourceAppointments)
|
||||
{
|
||||
var allResources = KalenderService.GetAllResources().OrderBy(r => r.Name).ToList();
|
||||
|
||||
var categories2Resources = new Dictionary<ValueListEntryDC, List<ResourceDC>>();
|
||||
|
||||
foreach(var category in allResources.Select(resource => resource.ResourceCategory))
|
||||
foreach (var category in allResources.Select(resource => resource.ResourceCategory))
|
||||
{
|
||||
categories2Resources.AddOrUpdateValueInDictionary(category, allResources.Where(resource => resource.ResourceCategory.Equals(category)).OrderBy(r => r.Name).ToList());
|
||||
}
|
||||
@@ -68,35 +72,107 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.ResourceCategories2Resources = categories2Resources.OrderBy(kvp => kvp.Key.DisplayName).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||
}
|
||||
|
||||
if(Model?.Employee?.EmployeeOid.HasValue ?? false)
|
||||
if (Model?.LoggedInEmployee?.EmployeeOid.HasValue ?? false)
|
||||
{
|
||||
var compactEmployee = EmployeeService.GetActiveCompactEmployeeWithOid(Model.Employee.EmployeeOid.Value);
|
||||
var compactEmployee = EmployeeService.GetActiveCompactEmployeeWithOid(Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
Model.MyTeamEmployees = EmployeeService.GetAllTeamMember(compactEmployee).OrderBy(employee => employee.LastName).ToList();
|
||||
}
|
||||
else if(!(Model is null))
|
||||
else if (!(Model is null))
|
||||
{
|
||||
Model.MyTeamEmployees = new List<CompactEmployeeDC>();
|
||||
}
|
||||
|
||||
if(AbstractModel.HasRightToViewTeams && (Model?.Employee?.EmployeeOid.HasValue ?? false))
|
||||
if (Model.HasRightToViewTeams && (Model?.LoggedInEmployee?.EmployeeOid.HasValue ?? false))
|
||||
{
|
||||
Model.MyTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(team => team.Name).ToList();
|
||||
Model.MyTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(Model.LoggedInEmployee.EmployeeOid.Value).OrderBy(team => team.Name).ToList();
|
||||
}
|
||||
|
||||
if(!(Model is null))
|
||||
if (!(Model is null))
|
||||
{
|
||||
Model.TeamMemberCustomerOids = EmployeeService.LoadTeamsRelatedCustomerOids(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid);
|
||||
Model.TeamMemberCustomerOids = EmployeeService.LoadTeamsRelatedCustomerOids(LoggedInUser.Employee.EmployeeOid);
|
||||
}
|
||||
|
||||
if (Model.HasRightToViewCustomerSelectionInScheduler)
|
||||
{
|
||||
Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers().OrderBy(customer => customer.LastName).ToList();
|
||||
}
|
||||
|
||||
if (Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact().OrderBy(employee => employee.LastName).ToList();
|
||||
}
|
||||
|
||||
//LoadAppointmentsForDate();
|
||||
|
||||
if (Model.SelectedAppointmentOid.HasValue)
|
||||
{
|
||||
if (Model.Appointments == null)
|
||||
{
|
||||
LoadAppointmentsForDate();
|
||||
}
|
||||
Model.SelectedAppointment = Model.Appointments.FirstOrDefault(app => app.SchedulerAppointmentOid.HasValue && app.SchedulerAppointmentOid.Value == Model.SelectedAppointmentOid.Value);
|
||||
}
|
||||
SetHasResourcesEmployeesOrCustomers();
|
||||
UpdateSelectedObjects();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void UpdateSelectedObjects()
|
||||
{
|
||||
//mache aus dem Ressourcenkategorien Dictionary eine flache Liste:
|
||||
var list = new List<ResourceDC>();
|
||||
Model.ResourceCategories2Resources.Values.DoForEach(l => l.DoForEach(s => list.AddIfNotIn(s)));
|
||||
|
||||
Model.SelectedEmployees = Model.AllEmployees.Where(employee => Model.SelectedEmployeeOids.Contains(employee.EmployeeOid)).ToList();
|
||||
Model.SelectedCustomers = Model.AllCustomers.Where(customer => Model.SelectedCustomerOids.Contains(customer.CustomerOid)).ToList();
|
||||
Model.SelectedResources = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOids.Contains(resource.ResourceOid.Value)).ToList();
|
||||
|
||||
Model.SelectedEmployeesForFiltering = Model.AllEmployees.Where(employee => Model.SelectedEmployeeOidsForFiltering.Contains(employee.EmployeeOid)).ToList();
|
||||
Model.SelectedCustomersForFiltering = Model.AllCustomers.Where(customer => Model.SelectedCustomerOidsForFiltering.Contains(customer.CustomerOid)).ToList();
|
||||
Model.SelectedResourcesForFiltering = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOidsForFiltering.Contains(resource.ResourceOid.Value)).ToList();
|
||||
|
||||
Model.SelectedEmployeesForIntervalFinder = Model.AllEmployees.Where(employee => Model.SelectedEmployeeOidsForIntervalFinder.Contains(employee.EmployeeOid)).ToList();
|
||||
Model.SelectedCustomersForIntervalFinder = Model.AllCustomers.Where(customer => Model.SelectedCustomerOidsForIntervalFinder.Contains(customer.CustomerOid)).ToList();
|
||||
Model.SelectedResourcesForIntervalFinder = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOidsForIntervalFinder.Contains(resource.ResourceOid.Value)).ToList();
|
||||
}
|
||||
|
||||
// ToDo: Überarbeiten? Es kam das Ansehen hinzu
|
||||
private void SetHasResourcesEmployeesOrCustomers()
|
||||
{
|
||||
var isOwnAppointment = !Model.IsInEditMode || Model.SelectedAppointment?.Originator.EmployeeOid == LoggedInEmployee.EmployeeOid;
|
||||
|
||||
var v1 = Model.HasRightToInsertEmployeeAppointments || Model.IsInEditMode && Model.HasRightToEditEmployeeAppointments;
|
||||
|
||||
var v2 = Model.HasRightToInsertRessourceAppointments || Model.IsInEditMode && Model.HasRightToEditResourceAppointments;
|
||||
|
||||
if (Model.IsInEditMode && !isOwnAppointment)
|
||||
{
|
||||
v2 = Model.HasRightToEditOthersResourceAppointments;
|
||||
}
|
||||
|
||||
var v3 = Model.HasRightToInsertCustomerAppointments || Model.IsInEditMode && Model.HasRightToEditCustomerAppointments;
|
||||
|
||||
Model.HasResourcesEmployeesOrCustomers = v1 || v2 || v3;
|
||||
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Scheduler()
|
||||
{
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !Model.IsAllowedToSeeScheduler)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
LoadAppointmentsForDate();
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
|
||||
private void LoadAppointmentsForDate()
|
||||
{
|
||||
if(Model?.Employee.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee.EmployeeOid is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -119,16 +195,16 @@ namespace BeWoPlanerMobil.Controllers
|
||||
end = sunday;
|
||||
}
|
||||
|
||||
var selectedCustomers = Model.SelectedCustomersForFiltering?.Select(s => s.CustomerOid).ToList() ?? new List<long>();
|
||||
var selectedEmployees = Model.SelectedEmployeesForFiltering?.Select(s => s.EmployeeOid).ToList() ?? new List<long>();
|
||||
var selectedResources = Model.SelectedResourcesForFiltering?.Where(w => w.ResourceOid.HasValue).Select(s => s.ResourceOid.Value).ToList() ?? new List<long>();
|
||||
var selectedCustomers = Model.SelectedCustomerOidsForFiltering;
|
||||
var selectedEmployees = Model.SelectedEmployeeOidsForFiltering.Clone(); //Wird soinst im KalenderService geändert
|
||||
var selectedResources = Model.SelectedResourceOidsForFiltering;
|
||||
|
||||
var appointments = KalenderService.LoadFilteredAppointmentsMitAufgaben(AbstractModel.HasRightToViewEmployeeAppointments, Model.Employee.EmployeeOid.Value, start.Date, end, selectedEmployees, selectedCustomers, selectedResources, false, false, false, false, true, true).ToList();
|
||||
var appointments = KalenderService.LoadFilteredAppointmentsMitAufgaben(Model.HasRightToViewEmployeeAppointments, Model.LoggedInEmployee.EmployeeOid.Value, start.Date, end, selectedEmployees, selectedCustomers, selectedResources, false, false, false, false, true, true).ToList();
|
||||
|
||||
// Private Termine
|
||||
foreach(var appointment in appointments.Where(a => a.IsPrivate))
|
||||
{
|
||||
if(appointment.Originator.Equals(MobileSessionFacade.LoggedInCompactEmployee) || appointment.EmployeeList.Any(e2a => e2a.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee)))
|
||||
if(appointment.Originator.Equals(LoggedInUser.Employee) || appointment.EmployeeList.Any(e2a => e2a.Employee.Equals(LoggedInUser.Employee)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -142,17 +218,17 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var tasks = appointments.Where(w => w.IsTask && w.CompletedDate is null).ToList();
|
||||
|
||||
// Nur eigene Kliententermine ansehen
|
||||
if(!AbstractModel.HasRightToViewCustomerAppointments)
|
||||
if(!Model.HasRightToViewCustomerAppointments)
|
||||
{
|
||||
appointments = appointments.Where(a => a.CustomerList.All(c => MobileSessionFacade.LoggedInEmployee.RelatedCustomers.Any(rc => rc.Customer.Equals(c)))).ToList();
|
||||
appointments = appointments.Where(a => a.CustomerList.All(c => LoggedInEmployee.RelatedCustomers.Any(rc => rc.Customer.Equals(c)))).ToList();
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToViewAllResourceAppointments)
|
||||
if(!Model.HasRightToViewAllResourceAppointments)
|
||||
{
|
||||
appointments = appointments.Where(a => a.ResourceList.Count == 0).ToList();
|
||||
}
|
||||
|
||||
if(!AbstractModel.IsAllowedToSeeCustomers)
|
||||
if(!Model.IsAllowedToSeeCustomers)
|
||||
{
|
||||
appointments = appointments.Where(a => a.CustomerList.Count == 0).ToList();
|
||||
}
|
||||
@@ -189,19 +265,31 @@ namespace BeWoPlanerMobil.Controllers
|
||||
holySweetFlyingFuck.OrderByDescending(appointment => appointment.IsTask).ThenBy(appointment => appointment.StartDate).ToList() :
|
||||
holySweetFlyingFuck.Where(w => w.IsTask is false).OrderBy(appointment => appointment.StartDate).ToList();
|
||||
|
||||
Model.WeekViewObject = new WeekViewObject(Model.Appointments, Model.SelectedDate.GetInSameCalendarWeek(DayOfWeek.Monday), Model.Employee);
|
||||
UpdateAppointmentListItems();
|
||||
|
||||
if(AbstractModel.HasRightToViewCustomerSelectionInScheduler)
|
||||
Model.WeekViewObject = new WeekViewObject(Model.Appointments, Model.SelectedDate.GetInSameCalendarWeek(DayOfWeek.Monday), Model.LoggedInEmployee);
|
||||
|
||||
|
||||
}
|
||||
private void UpdateAppointmentListItems()
|
||||
{
|
||||
var md5 = new MD5CryptoServiceProvider();
|
||||
|
||||
|
||||
var list = new List<AppointmentListItem>();
|
||||
|
||||
foreach (var appointment in Model.Appointments)
|
||||
{
|
||||
//Model.AllCustomers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid).OrderBy(o => o.DetailDescription).ToList();
|
||||
Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers().OrderBy(customer => customer.LastName).ToList();
|
||||
String key = String.Format("{0}_{1}", appointment.SchedulerAppointmentOid, appointment.RecurrenceInfo);
|
||||
String id = BitConverter.ToString(md5.ComputeHash(Encoding.UTF8.GetBytes(key))).Replace("-", "").ToLower();
|
||||
var listItem = new AppointmentListItem(id, appointment);
|
||||
|
||||
|
||||
|
||||
list.Add(listItem);
|
||||
}
|
||||
|
||||
if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
//Model.AllEmployees = EmployeeService.GetActiveCompactEmployeesForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(o => o.DetailDescription).ToList();
|
||||
Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact().OrderBy(employee => employee.LastName).ToList();
|
||||
}
|
||||
Model.AppointmentListItems = list;
|
||||
}
|
||||
|
||||
private static IEnumerable<SchedulerAppointmentDC> CalculateRecurrences(IEnumerable<SchedulerAppointmentDC> appointments, DateTime start, DateTime end, IReadOnlyCollection<RecurrenceInformation> changedOccurrences, IReadOnlyCollection<RecurrenceInformation> deletedOccurrences)
|
||||
@@ -341,7 +429,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
appointmentToInsert.StartDate = startDate;
|
||||
appointmentToInsert.Subject = subject;
|
||||
appointmentToInsert.Description = notice;
|
||||
appointmentToInsert.Originator = MobileSessionFacade.LoggedInCompactEmployee;
|
||||
appointmentToInsert.Originator = LoggedInUser.Employee;
|
||||
appointmentToInsert.Location = location;
|
||||
appointmentToInsert.ActivationType = ActivationTypeId.Active;
|
||||
appointmentToInsert.IsPrivate = isPrivate;
|
||||
@@ -376,10 +464,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
if(Model != null)
|
||||
{
|
||||
Model.IsAllDay = false;
|
||||
Model.SelectedAppointment = null;
|
||||
Model.SelectedResources?.Clear();
|
||||
Model.SelectedCustomers?.Clear();
|
||||
Model.SelectedEmployees?.Clear();
|
||||
Model.SelectedAppointmentOid = null;
|
||||
Model.SelectedResourceOids?.Clear();
|
||||
Model.SelectedCustomerOids?.Clear();
|
||||
Model.SelectedEmployeeOids?.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +488,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(Model != null)
|
||||
{
|
||||
Model.SelectedAppointment = null;
|
||||
Model.SelectedAppointmentOid = null;
|
||||
//Model.SelectedResources.Clear();
|
||||
}
|
||||
|
||||
@@ -421,7 +509,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(!(Model is null))
|
||||
{
|
||||
Model.SelectedAppointment = null;
|
||||
Model.SelectedAppointmentOid = null;
|
||||
//Model.SelectedResources.Clear();
|
||||
}
|
||||
|
||||
@@ -443,9 +531,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedDate = schedulerDate;
|
||||
|
||||
Model.SelectedAppointment = null;
|
||||
Model.SelectedResources.Clear();
|
||||
|
||||
Model.SelectedAppointmentOid = null;
|
||||
Model.SelectedResourceOids.Clear();
|
||||
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
}
|
||||
|
||||
@@ -471,9 +559,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
}
|
||||
|
||||
Model.SelectedAppointment = Model.Appointments.FirstOrDefault(app => app.SchedulerAppointmentOid.HasValue && app.SchedulerAppointmentOid.Value == appointmentOid);
|
||||
LoadAppointmentsForDate();
|
||||
|
||||
if(Model.SelectedAppointment != null)
|
||||
Model.SelectedAppointmentOid = appointmentOid;
|
||||
Model.SelectedAppointment = Model.Appointments.FirstOrDefault(app => app.SchedulerAppointmentOid.HasValue && app.SchedulerAppointmentOid.Value == appointmentOid);
|
||||
|
||||
if (Model.SelectedAppointment != null)
|
||||
{
|
||||
if(Model.SelectedAppointment.AllDay && Model.SelectedAppointment.EndDate.HasValue)
|
||||
{
|
||||
@@ -482,9 +573,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.IsAllDay = Model.SelectedAppointment.AllDay;
|
||||
Model.IsPrivate = Model.SelectedAppointment.IsPrivate;
|
||||
Model.SelectedResources = Model.SelectedAppointment?.ResourceList ?? new List<ResourceDC>();
|
||||
Model.SelectedEmployees = Model.SelectedAppointment?.EmployeeList.Select(e2a => e2a.Employee).ToList() ?? new List<CompactEmployeeDC>();
|
||||
Model.SelectedCustomers = Model.SelectedAppointment?.CustomerList ?? new List<CompactCustomerDC>();
|
||||
Model.SelectedResourceOids = Model.SelectedAppointment?.ResourceList.Select(r => r.ResourceOid.Value).ToList() ?? new List<long>();
|
||||
Model.SelectedEmployeeOids = Model.SelectedAppointment?.EmployeeList.Select(e2a => e2a.Employee.EmployeeOid).ToList() ?? new List<long>();
|
||||
Model.SelectedCustomerOids = Model.SelectedAppointment?.CustomerList.Select(c => c.CustomerOid).ToList() ?? new List<long>();
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
@@ -495,14 +586,16 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
if(Model != null)
|
||||
{
|
||||
Model.SelectedAppointment = null;
|
||||
Model.SelectedResources.Clear();
|
||||
Model.SelectedEmployees.Clear();
|
||||
Model.SelectedCustomers.Clear();
|
||||
Model.SelectedAppointmentOid = null;
|
||||
Model.SelectedResourceOids.Clear();
|
||||
Model.SelectedEmployeeOids.Clear();
|
||||
Model.SelectedCustomerOids.Clear();
|
||||
Model.IsAllDay = false;
|
||||
Model.IsPrivate = false;
|
||||
}
|
||||
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return Json(null, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
@@ -516,7 +609,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
var isOverlapping = false;
|
||||
var oid = Model.SelectedAppointment?.SchedulerAppointmentOid;
|
||||
var oid = Model.SelectedAppointmentOid;
|
||||
|
||||
var isSuccessfulStartDate = DateTime.TryParseExact(startDateRaw, "dd.MM.yyyy", null, DateTimeStyles.None, out var startDate);
|
||||
var isSuccessfulStartTime = DateTime.TryParseExact(startTimeRaw, "HH:mm", null, DateTimeStyles.None, out var startTime);
|
||||
@@ -532,7 +625,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var employeeOidList = Model.SelectedAppointment?.EmployeeList?.Select(employee2Appointment => employee2Appointment.Employee.EmployeeOid).ToList() ?? new List<long>();
|
||||
var resourceOidList = Model.SelectedResources.Where(resource => resource.ResourceOid.HasValue).Select(resource => resource.ResourceOid.Value).ToList() ?? new List<long>();
|
||||
|
||||
var originator = Model.SelectedAppointment?.Originator ?? MobileSessionFacade.LoggedInCompactEmployee;
|
||||
var originator = Model.SelectedAppointment?.Originator ?? LoggedInUser.Employee;
|
||||
|
||||
var recurrenceId = Model.SelectedAppointment?.RecurrenceId ?? string.Empty;
|
||||
var recurrenceIndex = Model.SelectedAppointment?.RecurrenceIndex ?? 0;
|
||||
@@ -560,7 +653,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToInsertRessourceAppointments)
|
||||
if(!Model.HasRightToInsertRessourceAppointments)
|
||||
{
|
||||
return "Fehler! Sie haben nicht das Recht, Termine mit Ressourcen anzulegen!";
|
||||
}
|
||||
@@ -582,7 +675,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
dateTimes.EndDate = dateTimes.EndDate.AddDays(1);
|
||||
}
|
||||
|
||||
var info = KalenderService.CheckResourceAvailabilityWithEmployeeInformation(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid, null);
|
||||
var info = KalenderService.CheckResourceAvailabilityWithEmployeeInformation(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointmentOid, null);
|
||||
|
||||
var result = string.Empty;
|
||||
|
||||
@@ -606,7 +699,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string HasSelectedAppointment()
|
||||
{
|
||||
return JsonConvert.SerializeObject(Model?.SelectedAppointment != null);
|
||||
return JsonConvert.SerializeObject(Model?.SelectedAppointmentOid.HasValue);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -642,13 +735,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var intervalEndDateString = formCollection["IntervalEnd"].Substring(0, 10);
|
||||
var intervalEndTimeString = formCollection["IntervalEndTime"];
|
||||
|
||||
if(int.TryParse(durationString, out var intervalDuration) && DateTime.TryParse($"{intervalStartDateString} {intervalStartTimeString}", out var intervalStart) && DateTime.TryParse($"{intervalEndDateString} {intervalEndTimeString}", out var intervalEnd) && Model.Employee.EmployeeOid.HasValue)
|
||||
if(int.TryParse(durationString, out var intervalDuration) && DateTime.TryParse($"{intervalStartDateString} {intervalStartTimeString}", out var intervalStart) && DateTime.TryParse($"{intervalEndDateString} {intervalEndTimeString}", out var intervalEnd) && Model.LoggedInEmployee.EmployeeOid.HasValue)
|
||||
{
|
||||
var customerOids = Model.SelectedCustomersForIntervalFinder.Select(customer => customer.CustomerOid).ToList();
|
||||
var employeeOids = Model.SelectedEmployeesForIntervalFinder.Select(employee => employee.EmployeeOid).ToList();
|
||||
var resourceOids = Model.SelectedResourcesForIntervalFinder.Where(resource => resource.ResourceOid.HasValue).Select(r => r.ResourceOid.Value).ToList();
|
||||
var customerOids = Model.SelectedCustomerOidsForIntervalFinder.Clone();
|
||||
var employeeOids = Model.SelectedEmployeeOidsForIntervalFinder.Clone();
|
||||
var resourceOids = Model.SelectedResourceOidsForIntervalFinder.Clone();
|
||||
|
||||
Model.FreeIntervals = KalenderService.FindAppointmentsInRangeForIntervalFinder(intervalDuration, intervalStart, intervalEnd, resourceOids, customerOids, employeeOids, Model.Employee.EmployeeOid.Value);
|
||||
Model.FreeIntervals = KalenderService.FindAppointmentsInRangeForIntervalFinder(intervalDuration, intervalStart, intervalEnd, resourceOids, customerOids, employeeOids, Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
Model.IntervalStartDate = intervalStart;
|
||||
Model.IntervalEndDate = intervalEnd;
|
||||
@@ -667,9 +760,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var employeeOids = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedEmployeesForIntervalFinder = Model.AllEmployees.Where(employee => employeeOids.Contains(employee.EmployeeOid)).ToList();
|
||||
|
||||
Model.SelectedEmployeeOidsForIntervalFinder = ConvertOidStringToList(oidString);
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return JsonConvert.SerializeObject(Model.SelectedEmployeesForIntervalFinder.OrderBy(o => o.DetailDescription));
|
||||
}
|
||||
@@ -683,9 +776,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var customerOids = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedCustomersForIntervalFinder = Model.AllCustomers.Where(customer => customerOids.Contains(customer.CustomerOid)).ToList();
|
||||
Model.SelectedCustomerOidsForIntervalFinder = ConvertOidStringToList(oidString);
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return JsonConvert.SerializeObject(Model.SelectedCustomersForIntervalFinder.OrderBy(o => o.LastNameFirstName));
|
||||
}
|
||||
@@ -699,13 +791,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var resourceOidList = ConvertOidStringToList(resourceOids);
|
||||
|
||||
var list = new List<ResourceDC>();
|
||||
|
||||
Model.ResourceCategories2Resources.Values.DoForEach(l => l.DoForEach(s => list.AddIfNotIn(s)));
|
||||
|
||||
Model.SelectedResourcesForIntervalFinder = list.Where(resource => resource.ResourceOid.HasValue && resourceOidList.Contains(resource.ResourceOid.Value)).ToList();
|
||||
|
||||
Model.SelectedResourceOidsForIntervalFinder = ConvertOidStringToList(resourceOids);
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return JsonConvert.SerializeObject(Model.SelectedResourcesForIntervalFinder);
|
||||
}
|
||||
@@ -726,9 +814,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(!newValue)
|
||||
{
|
||||
Model.SelectedEmployeesForIntervalFinder.Clear();
|
||||
Model.SelectedCustomersForIntervalFinder.Clear();
|
||||
Model.SelectedResourcesForIntervalFinder.Clear();
|
||||
Model.SelectedEmployeeOidsForIntervalFinder.Clear();
|
||||
Model.SelectedCustomerOidsForIntervalFinder.Clear();
|
||||
Model.SelectedResourceOidsForIntervalFinder.Clear();
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
@@ -766,18 +854,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
ActivationType = ActivationTypeId.Active,
|
||||
IsTask = false,
|
||||
IsPrivate = false,
|
||||
Originator = MobileSessionFacade.LoggedInCompactEmployee,
|
||||
Originator = LoggedInUser.Employee,
|
||||
StartDate = startDate,
|
||||
EndDate = endDate
|
||||
};
|
||||
|
||||
Model.SelectedCustomers = Model.SelectedCustomersForIntervalFinder.Clone();
|
||||
Model.SelectedEmployees = Model.SelectedEmployeesForIntervalFinder.Clone();
|
||||
Model.SelectedResources = Model.SelectedResourcesForIntervalFinder.Clone();
|
||||
Model.SelectedCustomerOids = Model.SelectedCustomerOidsForIntervalFinder.Clone();
|
||||
Model.SelectedEmployeeOids = Model.SelectedEmployeeOidsForIntervalFinder.Clone();
|
||||
Model.SelectedResourceOids = Model.SelectedResourceOidsForIntervalFinder.Clone();
|
||||
|
||||
Model.SelectedCustomersForIntervalFinder.Clear();
|
||||
Model.SelectedEmployeesForIntervalFinder.Clear();
|
||||
Model.SelectedResourcesForIntervalFinder.Clear();
|
||||
Model.SelectedCustomerOidsForIntervalFinder.Clear();
|
||||
Model.SelectedEmployeeOidsForIntervalFinder.Clear();
|
||||
Model.SelectedResourceOidsForIntervalFinder.Clear();
|
||||
|
||||
Model.IntervalStartDate = null;
|
||||
Model.IntervalEndDate = null;
|
||||
@@ -794,6 +882,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedCustomerOidsForIntervalFinder.Clear();
|
||||
Model.SelectedEmployeeOidsForIntervalFinder.Clear();
|
||||
Model.SelectedResourceOidsForIntervalFinder.Clear();
|
||||
|
||||
Model.SelectedCustomersForIntervalFinder.Clear();
|
||||
Model.SelectedEmployeesForIntervalFinder.Clear();
|
||||
Model.SelectedResourcesForIntervalFinder.Clear();
|
||||
@@ -831,7 +923,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.ResourceCategories2Resources.Values.DoForEach(l => l.DoForEach(s => list.AddIfNotIn(s)));
|
||||
|
||||
Model.SelectedResourcesForFiltering = list.Where(resource => resource.ResourceOid.HasValue && oidList.Contains(resource.ResourceOid.Value)).ToList();
|
||||
|
||||
Model.SelectedResourceOidsForFiltering = oidList;
|
||||
return JsonConvert.SerializeObject(Model.SelectedResourcesForFiltering);
|
||||
}
|
||||
|
||||
@@ -844,11 +936,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var oidList = ConvertOidStringToList(oidString);
|
||||
Model.SelectedEmployeeOidsForFiltering = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedEmployeesForFiltering = Model.AllEmployees.Where(employee => oidList.Contains(employee.EmployeeOid)).ToList();
|
||||
|
||||
return Model.SelectedEmployeesForFiltering.Count.ToString();
|
||||
return Model.SelectedEmployeeOidsForFiltering.Count.ToString();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -860,17 +950,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var oidList = ConvertOidStringToList(oidString);
|
||||
Model.SelectedCustomerOidsForFiltering = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedCustomersForFiltering = Model.AllCustomers.Where(customer => oidList.Contains(customer.CustomerOid)).ToList();
|
||||
|
||||
return Model.SelectedCustomersForFiltering.Count.ToString();
|
||||
return Model.SelectedCustomerOidsForFiltering.Count.ToString();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult FetchSelectedEmployeesForPopup()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
}
|
||||
@@ -881,7 +969,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult FetchEmployeeFilteringModalBody()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
}
|
||||
@@ -892,7 +980,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string SelectTeamForFiltering(string teamOidString)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
Logout();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
@@ -900,14 +988,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(long.TryParse(teamOidString, out var teamOid))
|
||||
{
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.Employee.EmployeeOid.Value);
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
if(!(team is null))
|
||||
{
|
||||
Model.SelectedEmployeesForFiltering.AddRangeIfElementsNotIn(team.Member);
|
||||
Model.SelectedEmployeeOidsForFiltering.AddRangeIfElementsNotIn(team.Member.Select(m => m.EmployeeOid));
|
||||
}
|
||||
}
|
||||
|
||||
UpdateSelectedObjects();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
@@ -918,7 +1006,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string SelectTeamForAppointment(string teamOidString)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
@@ -931,15 +1019,16 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.Employee.EmployeeOid.Value);
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
if(team is null)
|
||||
{
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedEmployees.AddRangeIfElementsNotIn(team.Member);
|
||||
teamMemberOids.AddRangeIfElementsNotIn(team.Member.Select(member => member.EmployeeOid));
|
||||
Model.SelectedEmployeeOids.AddRangeIfElementsNotIn(team.Member.Select(m => m.EmployeeOid));
|
||||
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -954,9 +1043,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("SchedulerEmployeeSelectionPartial");
|
||||
}
|
||||
|
||||
var oidList = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedEmployees = Model.AllEmployees.Where(employee => oidList.Contains(employee.EmployeeOid)).ToList();
|
||||
|
||||
Model.SelectedEmployeeOids = ConvertOidStringToList(oidString);
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("SchedulerEmployeeSelectionPartial", Model);
|
||||
}
|
||||
@@ -969,8 +1058,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("EmployeeSelectionPopupListPartial");
|
||||
}
|
||||
|
||||
Model.SelectedEmployeeOids = isChecked ? Model.AllEmployees.Select(r => r.EmployeeOid).ToList() : new List<long>();
|
||||
|
||||
Model.SelectedEmployees = isChecked ? Model.AllEmployees : new List<CompactEmployeeDC>();
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("EmployeeSelectionPopupListPartial", Model);
|
||||
}
|
||||
@@ -978,7 +1069,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedEmployees()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("SchedulerEmployeeSelectionPartial");
|
||||
@@ -990,7 +1081,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedEmployeePopupList()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("EmployeeSelectionPopupListPartial");
|
||||
@@ -1012,8 +1103,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Logout();
|
||||
return PartialView("CustomerSelectionPopupListPartial");
|
||||
}
|
||||
|
||||
Model.SelectedCustomers = isChecked ? Model.AllCustomers : new List<CompactCustomerDC>();
|
||||
|
||||
Model.SelectedCustomerOids = isChecked ? Model.AllCustomers.Select(r => r.CustomerOid).ToList() : new List<long>();
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("CustomerSelectionPopupListPartial", Model);
|
||||
}
|
||||
@@ -1021,7 +1113,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedCustomers()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("SchedulerCustomerSelectionPartial");
|
||||
@@ -1033,7 +1125,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedCustomerPopupList()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("CustomerSelectionPopupListPartial");
|
||||
@@ -1052,9 +1144,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("SchedulerCustomerSelectionPartial");
|
||||
}
|
||||
|
||||
var oidList = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedCustomerOids = ConvertOidStringToList(oidString);
|
||||
|
||||
Model.SelectedCustomers = Model.AllCustomers.Where(customer => oidList.Contains(customer.CustomerOid)).ToList();
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("SchedulerCustomerSelectionPartial", Model);
|
||||
}
|
||||
@@ -1072,7 +1165,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("SchedulerResourceSelectionPartial");
|
||||
}
|
||||
|
||||
var oidList = ConvertOidStringToList(oidString);
|
||||
|
||||
|
||||
//var list = new List<ResourceDC>();
|
||||
|
||||
@@ -1080,7 +1173,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
//Model.SelectedResources = list.Where(resource => resource.ResourceOid.HasValue && oidList.Contains(resource.ResourceOid.Value)).ToList();
|
||||
|
||||
Model.SelectedResources = Model.AllResources.Where(resource => resource.ResourceOid.HasValue && oidList.Contains(resource.ResourceOid.Value)).ToList();
|
||||
Model.SelectedResourceOids = ConvertOidStringToList(oidString);
|
||||
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("SchedulerResourceSelectionPartial", Model);
|
||||
}
|
||||
@@ -1094,7 +1189,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("ResourceSelectionPopupListPartial");
|
||||
}
|
||||
|
||||
Model.SelectedResources = isChecked ? Model.AllResources : new List<ResourceDC>();
|
||||
Model.SelectedResourceOids = isChecked ? Model.AllResources.Select(r => r.ResourceOid.Value).ToList() : new List<long>();
|
||||
|
||||
UpdateSelectedObjects();
|
||||
|
||||
return PartialView("ResourceSelectionPopupListPartial", Model);
|
||||
}
|
||||
@@ -1102,7 +1199,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedResourcePopupList()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("ResourceSelectionPopupListPartial");
|
||||
@@ -1114,7 +1211,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult LoadUpdatedResources()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return PartialView("SchedulerResourceSelectionPartial");
|
||||
@@ -1129,7 +1226,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult FetchCustomersForFiltering()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
}
|
||||
@@ -1140,7 +1237,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult FetchCustomerFilteringModalBody()
|
||||
{
|
||||
if(Model is null)
|
||||
if (Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
}
|
||||
@@ -1174,18 +1271,17 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string DeleteAppointment(string appointmentIdentifier, bool deleteSeries)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
Logout();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(!Guid.TryParse(appointmentIdentifier, out var identifier))
|
||||
{
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var schedulerAppointment = Model.AppointmentListItems.FirstOrDefault(app => app.Identifier.Equals(identifier))?.SchedulerAppointment;
|
||||
LoadAppointmentsForDate();
|
||||
|
||||
var schedulerAppointment = Model.AppointmentListItems.FirstOrDefault(app => app.Identifier.Equals(appointmentIdentifier))?.SchedulerAppointment;
|
||||
|
||||
if(schedulerAppointment is null)
|
||||
{
|
||||
@@ -1216,14 +1312,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var teamMemberCustomerOids = EmployeeService.LoadTeamsRelatedCustomerOids(Model.Employee.EmployeeOid.Value);
|
||||
var teamMemberCustomerOids = EmployeeService.LoadTeamsRelatedCustomerOids(Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
var customerList = schedulerAppointment.CustomerList;
|
||||
var employeeList = schedulerAppointment.EmployeeList;
|
||||
var resourceList = schedulerAppointment.ResourceList;
|
||||
var originator = schedulerAppointment.Originator;
|
||||
var isNew = schedulerAppointment.SchedulerAppointmentOid is null;
|
||||
var loggedOnUser = MobileSessionFacade.LoggedInUserDC;
|
||||
var loggedOnUser = LoggedInUser;
|
||||
|
||||
var isAllowedToDelete = BS.Shared.Core.Utils.CheckSchedulerRights(customerList, resourceList, employeeList, originator, isNew, SchedulerRightsCheckType.Edit, loggedOnUser, teamMemberCustomerOids);
|
||||
|
||||
@@ -1287,7 +1383,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string SelectTeamForIntervalFinder(string teamOidString)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
if(Model?.LoggedInEmployee?.EmployeeOid is null)
|
||||
{
|
||||
Logout();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
@@ -1295,12 +1391,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
if(long.TryParse(teamOidString, out var teamOid))
|
||||
{
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.Employee.EmployeeOid.Value);
|
||||
var team = EmployeeService.FindTeamByOid(teamOid, Model.LoggedInEmployee.EmployeeOid.Value);
|
||||
|
||||
if(!(team is null))
|
||||
{
|
||||
var memberOids = team.Member.Select(member => member.EmployeeOid).ToList();
|
||||
|
||||
Model.SelectedEmployeeOidsForIntervalFinder.AddRangeIfElementsNotIn(memberOids);
|
||||
return JsonConvert.SerializeObject(memberOids);
|
||||
}
|
||||
}
|
||||
@@ -1318,11 +1414,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(!Guid.TryParse(formCollection[FormCollectionConstants.AppointmentIdInputKey], out var identifier))
|
||||
var identifier = formCollection[FormCollectionConstants.AppointmentIdInputKey];
|
||||
|
||||
if (Model.AppointmentListItems == null)
|
||||
{
|
||||
return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main");
|
||||
LoadAppointmentsForDate();
|
||||
}
|
||||
|
||||
var appointmentListItem = Model.AppointmentListItems.FirstOrDefault(f => f.Identifier.Equals(identifier));
|
||||
|
||||
if(appointmentListItem is null)
|
||||
@@ -1332,13 +1429,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var appointment = appointmentListItem.SchedulerAppointment;
|
||||
|
||||
var employeeOids = appointment.EmployeeList.Select(employee2Appointment => employee2Appointment.Employee.EmployeeOid).ToList();
|
||||
if(employeeOids.Count == 0)
|
||||
{
|
||||
employeeOids.Add(appointment.Originator.EmployeeOid);
|
||||
}
|
||||
//var employeeOids = appointment.EmployeeList.Select(employee2Appointment => employee2Appointment.Employee.EmployeeOid).ToList();
|
||||
//if(employeeOids.Count == 0)
|
||||
//{
|
||||
// employeeOids.Add(appointment.Originator.EmployeeOid);
|
||||
//}
|
||||
|
||||
TempData[TempDataConstants.AppointmentListItemKey] = appointmentListItem;
|
||||
TempData[TempDataConstants.AppointmentOidKey] = appointmentListItem.SchedulerAppointment?.SchedulerAppointmentOid;
|
||||
|
||||
return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
@@ -12,43 +13,52 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class AbstractModel
|
||||
{
|
||||
public static bool IsDeleteBtnVisible => CheckRight(UserRightType.ServiceRecordView_Delete);
|
||||
public bool IsDeleteBtnVisible => CheckRight(UserRightType.ServiceRecordView_Delete);
|
||||
|
||||
public static bool IsAllowedToSeeScheduler => MobileSessionFacade.LoggedInUser != null && CheckRight(UserRightType.KalenderAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
public bool IsAllowedToSeeScheduler => LoggedInUser != null && CheckRight(UserRightType.KalenderAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
|
||||
public static bool IsAllowedToSeeCustomers => CheckRight(UserRightType.ViewAll) || CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers);
|
||||
public bool IsAllowedToSeeCustomers => CheckRight(UserRightType.ViewAll) || CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers);
|
||||
|
||||
public static bool IsEmployeeSelectionVisible => CheckRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) || CheckRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember);
|
||||
public bool IsEmployeeSelectionVisible => CheckRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) || CheckRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember);
|
||||
|
||||
public static bool HasRightForGroupBookings => CheckRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking);
|
||||
public bool HasRightForGroupBookings => CheckRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking);
|
||||
|
||||
public static bool HasRightToViewCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAlleAnsehen) || CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers) || CheckRight(UserRightType.Customer_ViewMyTeams);
|
||||
public static bool HasRightToViewEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
public static bool HasRightToViewAllResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
public bool HasRightToViewCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAlleAnsehen) || CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers) || CheckRight(UserRightType.Customer_ViewMyTeams);
|
||||
public bool HasRightToViewEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
public bool HasRightToViewAllResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAnsehen) || CheckRight(UserRightType.ViewAll);
|
||||
|
||||
public EmployeeDC Employee { get; set; }
|
||||
public ISessionModel SessionModel { get; internal set; }
|
||||
|
||||
public string LoggedInEmplyeeFirstNameLastName => Employee != null ? $"{Employee.FirstName} {Employee.LastName}" : "BeWoPlaner";
|
||||
public UserDC LoggedInUser { get; set; }
|
||||
|
||||
public static bool HasRightToSeeAllSupportConcepts => CheckRight(UserRightType.SupportConcept_ViewAllSupportConcepts) || CheckRight(UserRightType.ViewAll);
|
||||
public MokMandator Mandator { get; set; }
|
||||
|
||||
public static bool HasRightToSeeTextModules => CheckRight(UserRightType.TextbausteineNurEigeneAnsehen) || CheckRight(UserRightType.TextbausteineAlleAnsehen);
|
||||
public static bool HasRightToSeeOwnTextModules => CheckRight(UserRightType.TextbausteineNurEigeneAnsehen);
|
||||
public static bool HasRightToSeeGlobalTextModules => CheckRight(UserRightType.TextbausteineAlleAnsehen);
|
||||
public EmployeeDC LoggedInEmployee { get; set; }
|
||||
|
||||
public static bool HasRightToSeeServiceRecords => CheckRight(UserRightType.ServiceRecordView_View) && CheckRight(UserRightType.ServiceRecordView_Create);
|
||||
public string LoggedInEmplyeeFirstNameLastName => LoggedInEmployee != null ? $"{LoggedInEmployee.FirstName} {LoggedInEmployee.LastName}" : "BeWoPlaner";
|
||||
|
||||
public static string TimeOfLastAction { get; set; }
|
||||
public bool HasRightToSeeAllSupportConcepts => CheckRight(UserRightType.SupportConcept_ViewAllSupportConcepts) || CheckRight(UserRightType.ViewAll);
|
||||
|
||||
public static bool HasRightToInsertRessourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAnlegen) || CheckRight(UserRightType.CreateAll);
|
||||
public bool HasRightToSeeTextModules => CheckRight(UserRightType.TextbausteineNurEigeneAnsehen) || CheckRight(UserRightType.TextbausteineAlleAnsehen);
|
||||
public bool HasRightToSeeOwnTextModules => CheckRight(UserRightType.TextbausteineNurEigeneAnsehen);
|
||||
public bool HasRightToSeeGlobalTextModules => CheckRight(UserRightType.TextbausteineAlleAnsehen);
|
||||
|
||||
public static bool HasRightToViewQuittierungsbelege
|
||||
public bool HasRightToSeeServiceRecords => CheckRight(UserRightType.ServiceRecordView_View) && CheckRight(UserRightType.ServiceRecordView_Create);
|
||||
|
||||
public static string TimeOfLastAction
|
||||
{
|
||||
get { return MobileSessionFacade.TimeOfLastAction; }
|
||||
set { MobileSessionFacade.TimeOfLastAction = value; }
|
||||
}
|
||||
|
||||
public bool HasRightToInsertRessourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAnlegen) || CheckRight(UserRightType.CreateAll);
|
||||
|
||||
public bool HasRightToViewQuittierungsbelege
|
||||
{
|
||||
get
|
||||
{
|
||||
var mandator = MobileSessionFacade.Mandator;
|
||||
|
||||
var showEmployeeSignatureSetting = MobileUtils.GetSettingValue(mandator.Settings, SettingsKeys.ShowSignature);
|
||||
|
||||
var showEmployeeSignatureSetting = MobileUtils.GetSettingValue(Mandator.Settings, SettingsKeys.ShowSignature);
|
||||
#if DEBUG
|
||||
showEmployeeSignatureSetting = "1";
|
||||
#endif
|
||||
@@ -58,40 +68,45 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
|
||||
|
||||
public static bool IsAllowedToSeeSupportConceptFilter
|
||||
public bool IsAllowedToSeeSupportConceptFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
var user = MobileSessionFacade.LoggedInUser;
|
||||
var user = LoggedInUser;
|
||||
|
||||
if(user != null)
|
||||
{
|
||||
return
|
||||
user.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.ViewAll, UserRightType.SupportConcept_ViewAllSupportConcepts }) ||
|
||||
user.CheckForRight(UserRightType.SupportConcept_ViewMyTeams);
|
||||
user.HasRight(UserRightType.SupportConcept_ViewMyTeams);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static string UserSettings
|
||||
public string UserSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
var user = MobileSessionFacade.LoggedInUser;
|
||||
var user = LoggedInUser;
|
||||
|
||||
return user?.SettingList.FirstOrDefault(f => f.Type.Equals(SettingsType.ApplicationSettings))?.Value;
|
||||
return user?.Settings.FirstOrDefault(f => f.Type.Equals(SettingsType.ApplicationSettings))?.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsAllowedToSeeCustomerFilter => MobileSessionFacade.LoggedInUser?.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.ViewAll, UserRightType.CustomerView_View, UserRightType.Customer_ViewMyTeams }) ?? false;
|
||||
public MokSettings MokSettings { get; set; }
|
||||
|
||||
public bool IsAllowedToSeeCustomerFilter => LoggedInUser?.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.ViewAll, UserRightType.CustomerView_View, UserRightType.Customer_ViewMyTeams }) ?? false;
|
||||
|
||||
public static bool IsAllowedToSeeMedikamentenliste
|
||||
public bool IsAllowedToSeeMedikamentenliste
|
||||
{
|
||||
get
|
||||
{
|
||||
var mandator = MobileSessionFacade.Mandator;
|
||||
#if DEBUG
|
||||
return true;
|
||||
#endif
|
||||
var mandator = Mandator;
|
||||
|
||||
var hasSetting = MobileUtils.GetSettingValue(mandator.Settings, SettingsKeys.ShowMedication) == "1";
|
||||
|
||||
@@ -101,55 +116,55 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckRight(UserRightType userRightType)
|
||||
public bool CheckRight(UserRightType userRightType)
|
||||
{
|
||||
return MobileSessionFacade.CheckForUserRight(userRightType);
|
||||
return LoggedInUser.HasRight(userRightType);
|
||||
}
|
||||
|
||||
public static bool CheckRights(List<UserRightType> userRightTypes)
|
||||
public bool CheckRights(List<UserRightType> userRightTypes)
|
||||
{
|
||||
return userRightTypes.All(MobileSessionFacade.CheckForUserRight);
|
||||
return userRightTypes.All(LoggedInUser.HasRight);
|
||||
}
|
||||
|
||||
public static bool CheckForAtLeastOneRight(UserRightType[] rights)
|
||||
public bool CheckForAtLeastOneRight(UserRightType[] rights)
|
||||
{
|
||||
return rights.Any(MobileSessionFacade.CheckForUserRight);
|
||||
return rights.Any(LoggedInUser.HasRight);
|
||||
}
|
||||
|
||||
public static bool HasRightToInsertEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAnlegen) ||
|
||||
public bool HasRightToInsertEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAnlegen) ||
|
||||
CheckRight(UserRightType.CreateAll);
|
||||
|
||||
public static bool HasRightToEditEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
public bool HasRightToEditEmployeeAppointments => CheckRight(UserRightType.KalenderMitarbeitertermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
|
||||
public static bool HasRightToEditResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
public static bool HasRightToEditOthersResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAndererAendern) || CheckRight(UserRightType.EditAll);
|
||||
public bool HasRightToEditResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
public bool HasRightToEditOthersResourceAppointments => CheckRight(UserRightType.KalenderRessourcentermineAndererAendern) || CheckRight(UserRightType.EditAll);
|
||||
|
||||
public static bool HasRightToInsertCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAnlegen) &&
|
||||
public bool HasRightToInsertCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAnlegen) &&
|
||||
(CheckRight(UserRightType.CustomerView_View) ||
|
||||
CheckRight(UserRightType.Customer_ViewMyCustomers) ||
|
||||
CheckRight(UserRightType.Customer_ViewMyTeams)) ||
|
||||
CheckRight(UserRightType.CreateAll);
|
||||
public static bool HasRightToEditCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
public bool HasRightToEditCustomerAppointments => CheckRight(UserRightType.KalenderKliententermineAendern) || CheckRight(UserRightType.EditAll);
|
||||
|
||||
public static bool ShowServiceRecordInsertedOn { get; set; }
|
||||
public bool ShowServiceRecordInsertedOn { get; set; }
|
||||
|
||||
public static bool HasRightToViewCustomerSelectionInScheduler => CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers) || CheckRight(UserRightType.Customer_ViewMyTeams);
|
||||
public bool HasRightToViewCustomerSelectionInScheduler => CheckRight(UserRightType.CustomerView_View) || CheckRight(UserRightType.Customer_ViewMyCustomers) || CheckRight(UserRightType.Customer_ViewMyTeams);
|
||||
|
||||
public static bool HasRightToViewTeams => CheckRight(UserRightType.TeamView_ViewMyTeams) || CheckRight(UserRightType.TeamView_ViewAll);
|
||||
public bool HasRightToViewTeams => CheckRight(UserRightType.TeamView_ViewMyTeams) || CheckRight(UserRightType.TeamView_ViewAll);
|
||||
|
||||
public static bool HasRightForMultiBooking => CheckRight(UserRightType.ServiceRecord_AllowCreatingMultiBooking);
|
||||
public bool HasRightForMultiBooking => CheckRight(UserRightType.ServiceRecord_AllowCreatingMultiBooking);
|
||||
|
||||
public static bool HasRightToDeleteReceiptSignatures => CheckRight(UserRightType.ConfirmationReceiptSignatures_Delete);
|
||||
public bool HasRightToDeleteReceiptSignatures => CheckRight(UserRightType.ConfirmationReceiptSignatures_Delete);
|
||||
|
||||
public static bool HasRightToRateGoals => CheckRight(UserRightType.BewertenInZeiterfassung);
|
||||
public bool HasRightToRateGoals => CheckRight(UserRightType.BewertenInZeiterfassung);
|
||||
|
||||
public static bool HasRightToEditCustomers => CheckRight(UserRightType.CustomerView_Edit);
|
||||
public bool HasRightToEditCustomers => CheckRight(UserRightType.CustomerView_Edit);
|
||||
|
||||
public static bool HasRightMitarbeiterstundenkontoViewAll => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewAll);
|
||||
public static bool HasRightMitarbeiterstundenkontoViewTeams => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams);
|
||||
public static bool HasRightMitarbeiterstundenkontoViewSelf => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf);
|
||||
public bool HasRightMitarbeiterstundenkontoViewAll => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewAll);
|
||||
public bool HasRightMitarbeiterstundenkontoViewTeams => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams);
|
||||
public bool HasRightMitarbeiterstundenkontoViewSelf => CheckRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf);
|
||||
|
||||
public static bool HasRightToViewReports => CheckForAtLeastOneRight(new UserRightType[]
|
||||
public bool HasRightToViewReports => CheckForAtLeastOneRight(new UserRightType[]
|
||||
{
|
||||
UserRightType.ViewAll,
|
||||
UserRightType.QueryView_View,
|
||||
@@ -172,7 +187,7 @@ namespace BeWoPlanerMobil.Models
|
||||
UserRightType.Auswertungen_HilfeplanuebersichtAnsehen
|
||||
});
|
||||
|
||||
public static bool HasRightToViewMitarbeiterstundenkonto
|
||||
public bool HasRightToViewMitarbeiterstundenkonto
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -180,34 +195,34 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasRightToViewDiagnosen => CheckRight(UserRightType.Customer_ViewDiagnosis);
|
||||
public bool HasRightToViewDiagnosen => CheckRight(UserRightType.Customer_ViewDiagnosis);
|
||||
|
||||
public static bool HasRightToProvideSingleSignature => CheckRight(UserRightType.Signature_ProvideSingleSignature);
|
||||
public bool HasRightToProvideSingleSignature => CheckRight(UserRightType.Signature_ProvideSingleSignature);
|
||||
|
||||
public static bool HasRightToViewOwnCustomersBargeldkassen => CheckRight(UserRightType.BargeldverwaltungNurEigeneAnsehen);
|
||||
public bool HasRightToViewOwnCustomersBargeldkassen => CheckRight(UserRightType.BargeldverwaltungNurEigeneAnsehen);
|
||||
|
||||
public static bool HasRightToViewAllCustomersBargeldkassen => CheckRight(UserRightType.BargeldverwaltungAnsehen);
|
||||
public bool HasRightToViewAllCustomersBargeldkassen => CheckRight(UserRightType.BargeldverwaltungAnsehen);
|
||||
|
||||
public static bool HasRightToDeleteCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungLoeschen);
|
||||
public bool HasRightToDeleteCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungLoeschen);
|
||||
|
||||
public static bool HasRightToCreateCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungAnlegen);
|
||||
public bool HasRightToCreateCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungAnlegen);
|
||||
|
||||
public static bool HasRightToEditCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungBearbeiten);
|
||||
public bool HasRightToEditCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungBearbeiten);
|
||||
|
||||
public static bool HasRightToViewCustomerAbsenceTimes => CheckRight(UserRightType.Customer_ViewAbsenceTimes);
|
||||
public bool HasRightToViewCustomerAbsenceTimes => CheckRight(UserRightType.Customer_ViewAbsenceTimes);
|
||||
|
||||
public static bool HasRightToProvideEmployeeSignatureForOthers => CheckRight(UserRightType.Signature_ProvideMonthlySignatureByProxy);
|
||||
public bool HasRightToProvideEmployeeSignatureForOthers => CheckRight(UserRightType.Signature_ProvideMonthlySignatureByProxy);
|
||||
|
||||
public static bool HasRightToViewBetreuung => CheckRight(UserRightType.Customer_ViewBetreuung);
|
||||
public bool HasRightToViewBetreuung => CheckRight(UserRightType.Customer_ViewBetreuung);
|
||||
|
||||
public static bool HasRightToViewCustomerDocuments => CheckForAtLeastOneRight(new[] { UserRightType.ViewAll, UserRightType.DokumenteKlienten });
|
||||
public bool HasRightToViewCustomerDocuments => CheckForAtLeastOneRight(new[] { UserRightType.ViewAll, UserRightType.DokumenteKlienten });
|
||||
|
||||
public static string UserMessage { get; set; }
|
||||
//public string UserMessage { get; set; }
|
||||
|
||||
public XtraReport Report { get; set; }
|
||||
public string ReportName { get; set; }
|
||||
|
||||
protected static string GetIsNotApproved(SupportConceptCostBearerRelDC rel)
|
||||
protected string GetIsNotApproved(SupportConceptCostBearerRelDC rel)
|
||||
{
|
||||
var result = string.Empty;
|
||||
|
||||
@@ -239,20 +254,20 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public Dictionary<string, bool> Collapsibles2IsShown { get; set; } = new Dictionary<string, bool>();
|
||||
|
||||
public static bool ShowDifferentQBInterval
|
||||
public bool ShowDifferentQBInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
var settingsValue = MobileUtils.GetSettingValue(MobileSessionFacade.Mandator.Settings, SettingsKeys.ShowServicesOverviewHalfOrWholeMonth);
|
||||
var settingsValue = MobileUtils.GetSettingValue(Mandator.Settings, SettingsKeys.ShowServicesOverviewHalfOrWholeMonth);
|
||||
|
||||
return "1" == settingsValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ShowDistanceField { get; set; }
|
||||
public bool ShowDistanceField { get; set; }
|
||||
|
||||
public static bool ShowBetrag { get; set; }
|
||||
public bool ShowBetrag { get; set; }
|
||||
|
||||
public static string LocalStorageKey => MobileSessionFacade.LoggedInUser is object ? $"bwp_{MobileSessionFacade.Tenant}_{MobileSessionFacade.LoggedInUser.Oid}" : null;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,25 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class CustomerModel : AbstractModel
|
||||
{
|
||||
|
||||
public CustomerModel()
|
||||
{
|
||||
SessionModel = new CustomerSessionModel();
|
||||
}
|
||||
|
||||
public CustomerSessionModel CustomerSessionModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return SessionModel as CustomerSessionModel;
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = "Klient")]
|
||||
public long? SelectedCustomerOid { get; set; }
|
||||
public long? SelectedCustomerOid { get { return CustomerSessionModel.SelectedCustomerOid; } set { CustomerSessionModel.SelectedCustomerOid = value; } }
|
||||
|
||||
public CustomerDC SelectedCustomer { get; set; }
|
||||
|
||||
public List<CompactCustomerDC> Customers { get; set; }
|
||||
|
||||
public IEnumerable<SelectListItem> CustomerListItems
|
||||
{
|
||||
get
|
||||
@@ -38,7 +50,7 @@ namespace BeWoPlanerMobil.Models
|
||||
public JsonCustomer SelectedJsonCustomer => SelectedCustomer != null ? new JsonCustomer(SelectedCustomer, FolderTree, ICD10Diagnosen) : null;
|
||||
|
||||
[Display(Name = "Filter")]
|
||||
public CustomerFilterEnum SelectedCustomerFilter { get; set; }
|
||||
public CustomerFilterEnum SelectedCustomerFilter { get { return CustomerSessionModel.SelectedCustomerFilter; } set { CustomerSessionModel.SelectedCustomerFilter = value; } }
|
||||
|
||||
public List<SelectListItem> CustomerFilter
|
||||
{
|
||||
@@ -46,7 +58,7 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
var user = MobileSessionFacade.LoggedInUser;
|
||||
var user = LoggedInUser;
|
||||
|
||||
const string allCustomers = "Alle Klienten anzeigen";
|
||||
const string myCustomersOnly = "Nur meine Klienten anzeigen";
|
||||
@@ -63,12 +75,12 @@ namespace BeWoPlanerMobil.Models
|
||||
result.Add(new SelectListItem { Text = allCustomers, Value = allCustomersValue });
|
||||
result.Add(new SelectListItem { Text = myCustomersOnly, Value = myCustomersValue });
|
||||
|
||||
if(user.CheckForRight(UserRightType.Customer_ViewMyTeams))
|
||||
if(user.HasRight(UserRightType.Customer_ViewMyTeams))
|
||||
{
|
||||
result.Add(new SelectListItem {Text = myTeamsCustomersOnly, Value = myTeamsCustomersValue });
|
||||
}
|
||||
}
|
||||
else if(user.CheckForRight(UserRightType.Customer_ViewMyTeams))
|
||||
else if(user.HasRight(UserRightType.Customer_ViewMyTeams))
|
||||
{
|
||||
result.Add(new SelectListItem { Text = myCustomersOnly, Value = myCustomersValue });
|
||||
result.Add(new SelectListItem { Text = myTeamsCustomersOnly, Value = myTeamsCustomersValue });
|
||||
@@ -84,7 +96,7 @@ namespace BeWoPlanerMobil.Models
|
||||
public List<CustomerReportType> ReportTypes { get; set; }
|
||||
|
||||
[Display(Name = "Bericht")]
|
||||
public CustomerReportType SelectedReportType { get; set; }
|
||||
public CustomerReportType SelectedReportType { get { return CustomerSessionModel.SelectedReportType; } set { CustomerSessionModel.SelectedReportType = value; } }
|
||||
|
||||
public List<SelectListItem> ReportTypeItems
|
||||
{
|
||||
@@ -108,7 +120,7 @@ namespace BeWoPlanerMobil.Models
|
||||
public List<BargeldkassenDC> Bargeldkassen { get; set; } = new List<BargeldkassenDC>();
|
||||
|
||||
[Display(Name = "Kategorie")]
|
||||
public long? SelectedAbsenceReason { get; set; }
|
||||
public long? SelectedAbsenceReasonOid { get { return CustomerSessionModel.SelectedAbsenceReasonOid; } set { CustomerSessionModel.SelectedAbsenceReasonOid = value; } }
|
||||
|
||||
public List<AbsenceReasonDC> AllAbsenceReasons { get; set; }
|
||||
|
||||
@@ -136,12 +148,24 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public long? SelectedAbsenceTimeOid { get { return CustomerSessionModel.SelectedAbsenceTimeOid; } set { CustomerSessionModel.SelectedAbsenceTimeOid = value; } }
|
||||
|
||||
public AbsenceTimeDC SelectedAbsenceTime { get; set; }
|
||||
//{
|
||||
// get { return selectedAbsenceTime; }
|
||||
// set
|
||||
// {
|
||||
// selectedAbsenceTime = value;
|
||||
// SelectedAbsenceTimeOid = selectedAbsenceTime != null ? selectedAbsenceTime.AbsenceTimeOid : null;
|
||||
// }
|
||||
//}
|
||||
|
||||
public long? SelectedBargeldkasseOid { get { return CustomerSessionModel.SelectedBargeldkasseOid; } set { CustomerSessionModel.SelectedBargeldkasseOid = value; } }
|
||||
|
||||
public BargeldkassenDC SelectedBargeldkasse { get; set; }
|
||||
|
||||
[Display(Name="Auszahlunsintervall")]
|
||||
public int SelectedAuszahlungsintervall { get; set; }
|
||||
public int SelectedAuszahlungsintervall { get { return CustomerSessionModel.SelectedAuszahlungsintervall; } set { CustomerSessionModel.SelectedAuszahlungsintervall = value; } }
|
||||
public List<SelectListItem> Auszahlungsintervalle =>
|
||||
new List<SelectListItem>
|
||||
{
|
||||
@@ -155,11 +179,13 @@ namespace BeWoPlanerMobil.Models
|
||||
public string BargeldkassenReportName { get; set; }
|
||||
|
||||
public XtraReport ZahlungsbelegsReportObject { get; set; }
|
||||
|
||||
|
||||
public long? SelectedBargeldtransaktionOid { get { return CustomerSessionModel.SelectedBargeldtransaktionOid; } set { CustomerSessionModel.SelectedBargeldtransaktionOid = value; } }
|
||||
|
||||
public BargeldtransaktionDC SelectedBargeldtransaktion { get; set; }
|
||||
|
||||
[Display(Name = "Art")]
|
||||
public int SelectedTransaktionsart { get; set; }
|
||||
public int SelectedTransaktionsart { get { return CustomerSessionModel.SelectedTransaktionsart; } set { CustomerSessionModel.SelectedTransaktionsart = value; } }
|
||||
public List<SelectListItem> Transaktionsarten =>
|
||||
new List<SelectListItem>
|
||||
{
|
||||
|
||||
51
BeWoPlanerMobil/Models/CustomerSessionModel.cs
Normal file
51
BeWoPlanerMobil/Models/CustomerSessionModel.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class CustomerSessionModel : ISessionModel
|
||||
{
|
||||
public long? SelectedCustomerOid { get; set; }
|
||||
|
||||
public CustomerFilterEnum SelectedCustomerFilter { get; set; }
|
||||
|
||||
public CustomerReportType SelectedReportType { get; set; }
|
||||
|
||||
public long? SelectedAbsenceReasonOid { get; set; }
|
||||
|
||||
public long? SelectedAbsenceTimeOid { get; set; }
|
||||
|
||||
public long? SelectedBargeldkasseOid { get; set; }
|
||||
|
||||
public int SelectedAuszahlungsintervall { get; set; }
|
||||
|
||||
public long? SelectedBargeldtransaktionOid { get; set; }
|
||||
|
||||
public int SelectedTransaktionsart { get; set; }
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
SelectedCustomerOid = null;
|
||||
//SelectedCustomerFilter = CustomerFilterEnum.All;
|
||||
//SelectedReportType = CustomerReportType.Medikamentenliste;
|
||||
SelectedAbsenceReasonOid = null;
|
||||
SelectedAbsenceTimeOid = null;
|
||||
SelectedBargeldkasseOid = null;
|
||||
//SelectedAuszahlungsintervall = 0;
|
||||
SelectedBargeldtransaktionOid = null;
|
||||
//SelectedTransaktionsart = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
BeWoPlanerMobil/Models/ISessionModel.cs
Normal file
9
BeWoPlanerMobil/Models/ISessionModel.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using BeWoPlanerMobil.Service;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public interface ISessionModel
|
||||
{
|
||||
void ResetValues();
|
||||
}
|
||||
}
|
||||
@@ -19,17 +19,33 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MainModel()
|
||||
{
|
||||
SessionModel = new MainSessionModel();
|
||||
SessionModel.ResetValues();
|
||||
|
||||
NewServiceRecord = new ServiceRecordDC();
|
||||
ShowOnlyOwnSupportConcepts = true;
|
||||
ErrorWert = 1;
|
||||
}
|
||||
|
||||
public MainSessionModel MainSessionModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return SessionModel as MainSessionModel;
|
||||
}
|
||||
}
|
||||
|
||||
public long? SelectedCostBearerSupportConceptRelOid { get; set; }
|
||||
public bool SessionInitialized { get { return MainSessionModel.SessionInitialized; } set { MainSessionModel.SessionInitialized = value; } }
|
||||
|
||||
[Display(Name = "Nur meine Klienten anzeigen")]
|
||||
public bool ShowOnlyOwnSupportConcepts { get; set; }
|
||||
public bool ShowOnlyOwnSupportConcepts { get { return MainSessionModel.ShowOnlyOwnSupportConcepts; } set { MainSessionModel.ShowOnlyOwnSupportConcepts = value; } }
|
||||
|
||||
[Display(Name = "Nur Klienten meiner Teams anzeigen")]
|
||||
public bool ShowOnlyMyTeamsSupportConcepts { get; set; }
|
||||
|
||||
public CustomerFilterEnum SelectedSupportConceptFilter { get; set; }
|
||||
public bool ShowOnlyMyTeamsSupportConcepts { get { return MainSessionModel.ShowOnlyMyTeamsSupportConcepts; } set { MainSessionModel.ShowOnlyMyTeamsSupportConcepts = value; } }
|
||||
|
||||
public CustomerFilterEnum SelectedSupportConceptFilter { get { return MainSessionModel.SelectedSupportConceptFilter; } set { MainSessionModel.SelectedSupportConceptFilter = value; } }
|
||||
|
||||
public List<SelectListItem> SupportConceptFilter
|
||||
{
|
||||
@@ -55,7 +71,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
var user = MobileSessionFacade.LoggedInUser;
|
||||
var user = LoggedInUser;
|
||||
|
||||
var alle = new CustomerFilterItem(CustomerFilterEnum.All);
|
||||
var nurMeine = new CustomerFilterItem(CustomerFilterEnum.MyCustomer);
|
||||
@@ -73,7 +89,7 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
if(user.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.ViewAll, UserRightType.SupportConcept_ViewAllSupportConcepts }))
|
||||
{
|
||||
if(user.CheckForRight(UserRightType.SupportConcept_ViewMyTeams))
|
||||
if(user.HasRight(UserRightType.SupportConcept_ViewMyTeams))
|
||||
{
|
||||
result.Add(new SelectListItem { Text = allSupportConcepts, Value = allSupportConceptsValue });
|
||||
result.Add(new SelectListItem { Text = myTeamsSupportConceptsOnly, Value = myTeamsSupportConceptsOnlyValue });
|
||||
@@ -85,7 +101,7 @@ namespace BeWoPlanerMobil.Models
|
||||
result.Add(new SelectListItem { Text = mySupportConceptsOnly, Value = mySupportConceptsValue });
|
||||
}
|
||||
}
|
||||
else if(user.CheckForRight(UserRightType.SupportConcept_ViewMyTeams))
|
||||
else if(user.HasRight(UserRightType.SupportConcept_ViewMyTeams))
|
||||
{
|
||||
result.Add(new SelectListItem { Text = myTeamsSupportConceptsOnly, Value = myTeamsSupportConceptsOnlyValue });
|
||||
result.Add(new SelectListItem { Text = mySupportConceptsOnly, Value = mySupportConceptsValue });
|
||||
@@ -97,37 +113,25 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
[Display(Name = "Abgelaufene Hilfepläne anzeigen")]
|
||||
public bool ShowExpiredSupportConcepts { get; set; }
|
||||
|
||||
private long? _CostBearer2SupportConceptOid;
|
||||
|
||||
public bool ShowExpiredSupportConcepts { get { return MainSessionModel.ShowExpiredSupportConcepts; } set { MainSessionModel.ShowExpiredSupportConcepts = value; } }
|
||||
|
||||
[Display(Name = "Hilfeplan")]
|
||||
public long? CostBearer2SupportConceptOid
|
||||
{
|
||||
get => _CostBearer2SupportConceptOid;
|
||||
public long? SelectedCostBearerSupportConceptOid { get { return MainSessionModel.SelectedCostBearerSupportConceptOid; } set { MainSessionModel.SelectedCostBearerSupportConceptOid = value; } }
|
||||
|
||||
public long? SelectedServiceCategoryOid { get { return MainSessionModel.SelectedServiceCategoryOid; } set { MainSessionModel.SelectedServiceCategoryOid = value; } }
|
||||
|
||||
set
|
||||
{
|
||||
Log.Info($"CostBearer2SupportConceptOid ausgewählt: {value}. Vorher: {_CostBearer2SupportConceptOid}; Benutzer: {MobileSessionFacade.LoggedInUser.LoginName} UserOid: {MobileSessionFacade.LoggedInUser.Oid}");
|
||||
_CostBearer2SupportConceptOid = value;
|
||||
}
|
||||
}
|
||||
|
||||
public long? SelectedServiceCategoryOid => SelectedServiceCategory?.ServiceCategoryOid;
|
||||
|
||||
public long? SelectedServiceDescriptionOid => SelectedServiceDescription?.ServiceDescriptionOid;
|
||||
|
||||
public long? SelectedServiceRecordOid { get; set; }
|
||||
public long? SelectedServiceDescriptionOid { get { return MainSessionModel.SelectedServiceDescriptionOid; } set { MainSessionModel.SelectedServiceDescriptionOid = value; } }
|
||||
|
||||
|
||||
public bool IsAllowedToDeleteServiceRecord(ServiceRecordDC serviceRecord)
|
||||
{
|
||||
var allowed = false;
|
||||
|
||||
if(MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordView_Delete))
|
||||
if(LoggedInUser.HasRight(UserRightType.ServiceRecordView_Delete))
|
||||
{
|
||||
allowed = true;
|
||||
}
|
||||
else if(MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowChangeWithin24Hours))
|
||||
else if(LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowChangeWithin24Hours))
|
||||
{
|
||||
if(serviceRecord.InsertedOn.HasValue)
|
||||
{
|
||||
@@ -140,7 +144,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(allowed && ApplicationSettings.MaxDaysEditServiceRecordsAllowed > 0)
|
||||
{
|
||||
if(!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowEditAfterMaxDaysInNextMonth))
|
||||
if(!LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowEditAfterMaxDaysInNextMonth))
|
||||
{
|
||||
if(serviceRecord.Start.HasValue)
|
||||
{
|
||||
@@ -158,7 +162,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if (allowed && ApplicationSettings.AnzTageZeiterfassErfolgt > 0)
|
||||
{
|
||||
if (!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordAllowEditAfterMindays))
|
||||
if (!LoggedInUser.HasRight(UserRightType.ServiceRecordAllowEditAfterMindays))
|
||||
{
|
||||
if (serviceRecord.Start != null)
|
||||
{
|
||||
@@ -172,9 +176,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
if(allowed && !MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowEditForOtherEmployees))
|
||||
if(allowed && !LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowEditForOtherEmployees))
|
||||
{
|
||||
if(MobileSessionFacade.LoggedInEmployee.EmployeeOid != serviceRecord.Employee.EmployeeOid)
|
||||
if(LoggedInUser.Employee.EmployeeOid != serviceRecord.Employee.EmployeeOid)
|
||||
{
|
||||
allowed = false;
|
||||
}
|
||||
@@ -182,7 +186,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(allowed && serviceRecord.GroupOid.HasValue)
|
||||
{
|
||||
if(!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
|
||||
if(!LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
|
||||
{
|
||||
allowed = false;
|
||||
}
|
||||
@@ -191,33 +195,23 @@ namespace BeWoPlanerMobil.Models
|
||||
return allowed;
|
||||
}
|
||||
|
||||
public long? SelectedServiceRecordOid { get { return MainSessionModel.SelectedServiceRecordOid; } set { MainSessionModel.SelectedServiceRecordOid = value; } }
|
||||
|
||||
public ServiceRecordDC SelectedServiceRecord { get; set; }
|
||||
|
||||
private SupportConceptDC _SelectedSupportConcept;
|
||||
|
||||
public SupportConceptDC SelectedSupportConcept
|
||||
{
|
||||
get => _SelectedSupportConcept;
|
||||
|
||||
set
|
||||
{
|
||||
var stackTrace = new StackTrace();
|
||||
var callingMethodsName = stackTrace.GetFrame(1).GetMethod().Name;
|
||||
Log.Info($"SC mit Oid {value?.SupportConceptOid} ausgewählt. Vorheriger SC: {_SelectedSupportConcept?.SupportConceptOid}. Aufrufende Methode: {callingMethodsName}");
|
||||
|
||||
_SelectedSupportConcept = value;
|
||||
}
|
||||
}
|
||||
public long? SelectedSupportConceptOid { get { return MainSessionModel.SelectedSupportConceptOid; } set { MainSessionModel.SelectedSupportConceptOid = value; } }
|
||||
|
||||
public SupportConceptDC SelectedSupportConcept { get; set; }
|
||||
|
||||
public int Zeitraum { get; set; }
|
||||
|
||||
public int ErrorWert { get; set; }
|
||||
|
||||
public bool ShowSignature { get; set; }
|
||||
|
||||
public long ServiceRecordOid { get; set; }
|
||||
public long LastCreatedServiceRecordOid { get { return MainSessionModel.LastCreatedServiceRecordOid; } set { MainSessionModel.LastCreatedServiceRecordOid = value; } }
|
||||
|
||||
public List<SupportConceptDC> SupportConcepts { get; set; }
|
||||
public List<SupportConceptDC> SupportConcepts { get; set; }
|
||||
|
||||
public List<TextModuleDC> Textbausteine { get; set; } = new List<TextModuleDC>();
|
||||
|
||||
@@ -239,6 +233,8 @@ namespace BeWoPlanerMobil.Models
|
||||
set => _ServiceRecords = value;
|
||||
}
|
||||
|
||||
public List<long> SelectedGoalOids { get { return MainSessionModel.SelectedGoalOids; } set { MainSessionModel.SelectedGoalOids = value; } }
|
||||
|
||||
private List<ValueListEntryDC> _SelectedGoals;
|
||||
|
||||
public List<ValueListEntryDC> SelectedGoals
|
||||
@@ -259,25 +255,21 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public long? ServiceRecordOidToDelete { get; set; }
|
||||
|
||||
public MainModel()
|
||||
{
|
||||
NewServiceRecord = new ServiceRecordDC();
|
||||
ShowOnlyOwnSupportConcepts = true;
|
||||
ErrorWert = 1;
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<CostBearer2SupportConceptRelListObject> SupportConceptListObjects
|
||||
{
|
||||
get
|
||||
{
|
||||
var allCostBearerRelations = new List<CostBearer2SupportConceptRelListObject> {new CostBearer2SupportConceptRelListObject("Hilfeplan auswählen", "", "-1", false, false), new CostBearer2SupportConceptRelListObject("Ohne Hilfeplan", "", "-2", false, false) };
|
||||
foreach(var sc in SupportConcepts.OrderBy(sc => sc.Customer.LastName))
|
||||
var allCostBearerRelations = new List<CostBearer2SupportConceptRelListObject> {new CostBearer2SupportConceptRelListObject("Hilfeplan auswählen", "", -1, false, false), new CostBearer2SupportConceptRelListObject("Ohne Hilfeplan", "", -2, false, false) };
|
||||
BS.Shared.Settings.ApplicationSettings.SupportConceptExpirationLimitInMonths = MokSettings.SupportConceptExpirationLimitInMonths;
|
||||
foreach (var sc in SupportConcepts.OrderBy(sc => sc.Customer.LastName))
|
||||
{
|
||||
allCostBearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate is null || w.EndDate.Value >= DateTime.Now.Date).Select(
|
||||
cb => new CostBearer2SupportConceptRelListObject(
|
||||
$"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}",
|
||||
$"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}{GetIsNotApproved(cb)}",
|
||||
cb.CostBearer2SupportConceptOid.ToString(),
|
||||
cb.CostBearer2SupportConceptOid.Value,
|
||||
cb.SupportConcept.IsAboutToExpire,
|
||||
cb.SupportConcept.ExpiresIn3MonthOrLess))
|
||||
);
|
||||
@@ -288,6 +280,8 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public CostBearer2SupportConceptRelListObject SelectedCostBearer2SupportConceptRelListObject { get; set; }
|
||||
|
||||
public List<long> SelectedConceptCostBearerRelationOids { get { return MainSessionModel.SelectedConceptCostBearerRelations; } set { MainSessionModel.SelectedConceptCostBearerRelations = value; } }
|
||||
|
||||
public List<SupportConceptCostBearerRelDC> SelectedConceptCostBearerRelations { get; set; }
|
||||
|
||||
public GroupBookingSelectionObject GroupBookingSelectionObject => new GroupBookingSelectionObject(SelectedConceptCostBearerRelations, GroupBookingSelectedGroupOfPeopleOids);
|
||||
@@ -304,7 +298,7 @@ namespace BeWoPlanerMobil.Models
|
||||
cb => new CostBearer2SupportConceptRelListObject(
|
||||
$"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}",
|
||||
$"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}",
|
||||
cb.CostBearer2SupportConceptOid.ToString(),
|
||||
cb.CostBearer2SupportConceptOid.Value,
|
||||
cb.SupportConcept.IsAboutToExpire,
|
||||
cb.SupportConcept.ExpiresIn3MonthOrLess))
|
||||
);
|
||||
@@ -322,16 +316,14 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public List<CompactEmployeeDC> Employees { get; set; }
|
||||
|
||||
public List<CompactEmployeeDC> EmployeesForGroupAndMultiBooking { get; set; }
|
||||
|
||||
public List<CompactEmployeeDC> AllEmployees { get; set; }
|
||||
|
||||
[Display(Name = "Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid => SelectedEmployee?.EmployeeOid;
|
||||
public long? SelectedEmployeeOid { get { return MainSessionModel.SelectedEmployeeOid; } set { MainSessionModel.SelectedEmployeeOid = value; } }
|
||||
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
|
||||
public List<GroupOfPeopleDC> GroupsOfPeople { get; set; } = new List<GroupOfPeopleDC>();
|
||||
|
||||
@@ -342,7 +334,7 @@ namespace BeWoPlanerMobil.Models
|
||||
get
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
result.AddRange(Employees.Select(item => new SelectListItem {Value = item.EmployeeOid.ToString(), Text = $"{item.LastName}, {item.FirstName}", Selected = item.Equals(MobileSessionFacade.LoggedInCompactEmployee)}).OrderBy(s => s.Text).ToList());
|
||||
result.AddRange(Employees.Select(item => new SelectListItem {Value = item.EmployeeOid.ToString(), Text = $"{item.LastName}, {item.FirstName}", Selected = item.Equals(LoggedInUser.Employee)}).OrderBy(s => s.Text).ToList());
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -369,36 +361,37 @@ namespace BeWoPlanerMobil.Models
|
||||
return maxDate;
|
||||
}
|
||||
|
||||
public List<SupportConceptDC> GroupBookingSelectedSupportConcepts { get; set; } = new List<SupportConceptDC>();
|
||||
public List<long> GroupBookingSelectedSupportConceptOids { get { return MainSessionModel.GroupBookingSelectedSupportConceptOids; } set { MainSessionModel.GroupBookingSelectedSupportConceptOids = value; } }
|
||||
public List<SupportConceptDC> GroupBookingSelectedSupportConcepts { get; set; } = new List<SupportConceptDC>();
|
||||
|
||||
public List<long> GroupBookingSelectedCostbearerRelOids { get; set; } = new List<long>();
|
||||
public List<long> GroupBookingSelectedCostbearerRelOids { get { return MainSessionModel.GroupBookingSelectedCostbearerRelOids; } set { MainSessionModel.GroupBookingSelectedCostbearerRelOids = value; } }
|
||||
|
||||
public List<CompactEmployeeDC> GroupBookingSelectedEmployees { get; set; } = new List<CompactEmployeeDC>();
|
||||
public List<long> GroupBookingSelectedEmployeeOids { get { return MainSessionModel.GroupBookingSelectedEmployeeOids; } set { MainSessionModel.GroupBookingSelectedEmployeeOids = value; } }
|
||||
public List<CompactEmployeeDC> GroupBookingSelectedEmployees { get; set; } = new List<CompactEmployeeDC>();
|
||||
|
||||
[Display(Name = "Gruppenbuchung")]
|
||||
public bool IsInGroupBookingMode
|
||||
{
|
||||
get => _IsInGroupBookingMode;
|
||||
get => MainSessionModel.IsInGroupBookingMode;
|
||||
|
||||
set
|
||||
{
|
||||
_IsInGroupBookingMode = value;
|
||||
MainSessionModel.IsInGroupBookingMode = value;
|
||||
|
||||
if(!_IsInGroupBookingMode)
|
||||
if(!MainSessionModel.IsInGroupBookingMode)
|
||||
{
|
||||
GroupBookingSelectedSupportConcepts?.Clear();
|
||||
GroupBookingSelectedEmployees?.Clear();
|
||||
}
|
||||
GroupBookingSelectedSupportConceptOids?.Clear();
|
||||
GroupBookingSelectedEmployeeOids?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool _IsInGroupBookingMode;
|
||||
|
||||
|
||||
public bool IsInEditingMode { get { return MainSessionModel.IsInEditingMode; } set { MainSessionModel.IsInEditingMode = value; } }
|
||||
|
||||
public bool IsInEditingMode { get; set; }
|
||||
|
||||
public List<ServiceDescriptionDC> GetServiceDesctiptions()
|
||||
public List<ServiceDescriptionDC> GetServiceDesctiptions()
|
||||
{
|
||||
var result = new List<ServiceDescriptionDC>();
|
||||
|
||||
@@ -412,23 +405,27 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public bool IsServiceRecordNoticeMandatory { get; set; } = true;
|
||||
|
||||
public CompactEmployeeDC PreviouslySelectedEmployee { get; set; }
|
||||
public SupportConceptDC PreviouslySelectedSupportConcept { get; set; }
|
||||
private long? _PreviouslySelectedCostbearer2SupportConceptOid;
|
||||
public long? PreviouslySelectedEmployeeOid { get { return MainSessionModel.PreviouslySelectedEmployeeOid; } set { MainSessionModel.PreviouslySelectedEmployeeOid = value; } }
|
||||
|
||||
public CompactEmployeeDC PreviouslySelectedEmployee { get; set; }
|
||||
|
||||
public long? PreviouslySelectedSupportConceptOid { get { return MainSessionModel.PreviouslySelectedSupportConceptOid; } set { MainSessionModel.PreviouslySelectedSupportConceptOid = value; } }
|
||||
public SupportConceptDC PreviouslySelectedSupportConcept { get; set; }
|
||||
|
||||
|
||||
public long? PreviouslySelectedCostbearer2SupportConceptOid
|
||||
{
|
||||
get => _PreviouslySelectedCostbearer2SupportConceptOid;
|
||||
get => MainSessionModel.PreviouslySelectedCostbearer2SupportConceptOid;
|
||||
set
|
||||
{
|
||||
var stackTrace = new StackTrace();
|
||||
var callingMethodsName = stackTrace.GetFrame(1).GetMethod().Name;
|
||||
|
||||
var alt = _PreviouslySelectedCostbearer2SupportConceptOid;
|
||||
var alt = MainSessionModel.PreviouslySelectedCostbearer2SupportConceptOid;
|
||||
|
||||
Log.Info($"PreviouslySelectedCostbearer2SupportConceptOid-Set von {alt} zu {value} von Methode: {callingMethodsName}");
|
||||
|
||||
_PreviouslySelectedCostbearer2SupportConceptOid = value;
|
||||
MainSessionModel.PreviouslySelectedCostbearer2SupportConceptOid = value;
|
||||
}
|
||||
}
|
||||
public bool IsEndDateVisible { get; set; }
|
||||
@@ -479,11 +476,11 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
var allowed = false;
|
||||
|
||||
if(MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordView_Edit))
|
||||
if(LoggedInUser.HasRight(UserRightType.ServiceRecordView_Edit))
|
||||
{
|
||||
allowed = true;
|
||||
}
|
||||
else if(MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowChangeWithin24Hours))
|
||||
else if(LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowChangeWithin24Hours))
|
||||
{
|
||||
if(serviceRecord.InsertedOn != null)
|
||||
{
|
||||
@@ -496,7 +493,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(allowed && ApplicationSettings.MaxDaysEditServiceRecordsAllowed > 0)
|
||||
{
|
||||
if(!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowEditAfterMaxDaysInNextMonth))
|
||||
if(!LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowEditAfterMaxDaysInNextMonth))
|
||||
{
|
||||
if(serviceRecord.Start != null)
|
||||
{
|
||||
@@ -512,9 +509,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
if(allowed && !MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowEditForOtherEmployees))
|
||||
if(allowed && !LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowEditForOtherEmployees))
|
||||
{
|
||||
if(MobileSessionFacade.LoggedInEmployee.EmployeeOid != serviceRecord.Employee.EmployeeOid)
|
||||
if(LoggedInUser.Employee.EmployeeOid != serviceRecord.Employee.EmployeeOid)
|
||||
{
|
||||
allowed = false;
|
||||
}
|
||||
@@ -522,7 +519,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(allowed && serviceRecord.GroupOid.HasValue)
|
||||
{
|
||||
if(!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
|
||||
if(!LoggedInUser.HasRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking))
|
||||
{
|
||||
allowed = false;
|
||||
}
|
||||
@@ -530,7 +527,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(allowed && ApplicationSettings.AnzTageZeiterfassErfolgt > 0)
|
||||
{
|
||||
if(!MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordAllowEditAfterMindays))
|
||||
if(!LoggedInUser.HasRight(UserRightType.ServiceRecordAllowEditAfterMindays))
|
||||
{
|
||||
if(serviceRecord.Start != null)
|
||||
{
|
||||
@@ -690,39 +687,29 @@ namespace BeWoPlanerMobil.Models
|
||||
/// </summary>
|
||||
public ServiceRecordTimeInterval ServiceRecordTimeInterval { get; set; }
|
||||
public int SelectedDayCount { get; set; }
|
||||
public NullableDateTimeSpan SelectedZeitraum { get; set; }
|
||||
public NullableDateTimeSpan SelectedZeitraum { get { return MainSessionModel.SelectedZeitraum; } set { MainSessionModel.SelectedZeitraum = value; } }
|
||||
|
||||
public bool IsOnlyYearMonthVisible { get; set; }
|
||||
|
||||
#region Mehrfachbuchung
|
||||
|
||||
private bool _IsInMultiBookingMode;
|
||||
|
||||
[Display(Name = "Mehrfachbuchung")]
|
||||
public bool IsInMultiBookingMode
|
||||
{
|
||||
get => _IsInMultiBookingMode;
|
||||
public bool IsInMultiBookingMode { get { return MainSessionModel.IsInMultiBookingMode; } set { MainSessionModel.IsInMultiBookingMode = value; } }
|
||||
|
||||
set
|
||||
{
|
||||
_IsInMultiBookingMode = value;
|
||||
|
||||
if(!_IsInMultiBookingMode)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public List<long> MultiBookingSelectedSupportConceptOids { get { return MainSessionModel.MultiBookingSelectedSupportConceptOids; } set { MainSessionModel.MultiBookingSelectedSupportConceptOids = value; } }
|
||||
|
||||
public List<SupportConceptDC> MultiBookingSelectedSupportConcepts { get; set; } = new List<SupportConceptDC>();
|
||||
|
||||
public List<long> MultiBookingSelectedGroupOfPeopleOids { get; set; } = new List<long>();
|
||||
public List<long> MultiBookingSelectedGroupOfPeopleOids { get { return MainSessionModel.MultiBookingSelectedGroupOfPeopleOids; } set { MainSessionModel.MultiBookingSelectedGroupOfPeopleOids = value; } }
|
||||
|
||||
public List<SupportConceptCostBearerRelDC> MultiBookingSelectedConceptCostBearerRelations { get; set; }
|
||||
|
||||
public GroupBookingSelectionObject MultiBookingSelectionObject => new GroupBookingSelectionObject(MultiBookingSelectedConceptCostBearerRelations, MultiBookingSelectedGroupOfPeopleOids);
|
||||
|
||||
public List<long> MultiBookingSelectedCostbearerRelOids { get; set; } = new List<long>();
|
||||
public List<long> MultiBookingSelectedCostbearerRelOids { get { return MainSessionModel.MultiBookingSelectedCostbearerRelOids; } set { MainSessionModel.MultiBookingSelectedCostbearerRelOids = value; } }
|
||||
|
||||
public List<long> MultiBookingSelectedEmployeeOids { get { return MainSessionModel.MultiBookingSelectedEmployeeOids; } set { MainSessionModel.MultiBookingSelectedEmployeeOids = value; } }
|
||||
public List<CompactEmployeeDC> MultiBookingSelectedEmployees { get; set; } = new List<CompactEmployeeDC>();
|
||||
|
||||
public List<CostBearer2SupportConceptRelListObject> MultiBookingSupportConceptListObjects
|
||||
@@ -737,7 +724,7 @@ namespace BeWoPlanerMobil.Models
|
||||
cb => new CostBearer2SupportConceptRelListObject(
|
||||
$"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}",
|
||||
$"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}",
|
||||
cb.CostBearer2SupportConceptOid.ToString(),
|
||||
cb.CostBearer2SupportConceptOid.Value,
|
||||
cb.SupportConcept.IsAboutToExpire,
|
||||
cb.SupportConcept.ExpiresIn3MonthOrLess))
|
||||
);
|
||||
@@ -749,8 +736,6 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
#endregion
|
||||
|
||||
public MandatorDC Mandator { get; set; }
|
||||
|
||||
public bool IsPasswordSecurityEnabled { get; set; }
|
||||
|
||||
public bool ShowMarker { get; set; }
|
||||
@@ -758,7 +743,7 @@ namespace BeWoPlanerMobil.Models
|
||||
#region ServiceRecord-Pagination
|
||||
public int ServiceRecordCount { get; set; }
|
||||
|
||||
public int CurrentPage { get; set; }
|
||||
public int CurrentPage { get { return MainSessionModel.CurrentPage; } set { MainSessionModel.CurrentPage = value; } }
|
||||
|
||||
public int MaxResults { get; set; } = 10;
|
||||
|
||||
@@ -783,6 +768,7 @@ namespace BeWoPlanerMobil.Models
|
||||
public ServiceCategoryDC SelectedServiceCategory { get; set; }
|
||||
|
||||
public ServiceDescriptionDC SelectedServiceDescription { get; set; }
|
||||
public List<ValueListEntryDC> AllGoals { get; internal set; }
|
||||
|
||||
public ServiceDescriptionDC GetSelectedOrFirstServiceDescription()
|
||||
{
|
||||
@@ -830,7 +816,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public string SupportConceptTimeSpan { get; }
|
||||
|
||||
public string CostBearer2SupportConceptOid { get; }
|
||||
public long CostBearer2SupportConceptOid { get; }
|
||||
|
||||
public string CostBearer2SupportConceptOidName { get; }
|
||||
|
||||
@@ -838,13 +824,13 @@ namespace BeWoPlanerMobil.Models
|
||||
public bool ExpiresInThreeMonthsOrLess { get; }
|
||||
|
||||
|
||||
public CostBearer2SupportConceptRelListObject(string pNameAndDateOfBirth, string pSupportConceptTimeSpan, string pCostBearer2SupportConceptOid, bool isAboutToExpire, bool expiresIn3MonthOrLess)
|
||||
public CostBearer2SupportConceptRelListObject(string pNameAndDateOfBirth, string pSupportConceptTimeSpan, long pCostBearer2SupportConceptOid, bool isAboutToExpire, bool expiresIn3MonthOrLess)
|
||||
{
|
||||
NameAndDateOfBirth = pNameAndDateOfBirth;
|
||||
SupportConceptTimeSpan = pSupportConceptTimeSpan;
|
||||
CostBearer2SupportConceptOid = pCostBearer2SupportConceptOid;
|
||||
|
||||
CostBearer2SupportConceptOidName = "OidHolder_" + CostBearer2SupportConceptOid;
|
||||
CostBearer2SupportConceptOidName = String.Format("OidHolder_{0}", CostBearer2SupportConceptOid);
|
||||
|
||||
IsAboutToExpire = isAboutToExpire;
|
||||
ExpiresInThreeMonthsOrLess = expiresIn3MonthOrLess;
|
||||
@@ -873,7 +859,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
hash = (hash * hashingMultiplier) ^ (NameAndDateOfBirth?.GetHashCode() ?? 0);
|
||||
hash = (hash * hashingMultiplier) ^ (SupportConceptTimeSpan?.GetHashCode() ?? 0);
|
||||
hash = (hash * hashingMultiplier) ^ (CostBearer2SupportConceptOid?.GetHashCode() ?? 0);
|
||||
hash = (hash * hashingMultiplier) ^ (CostBearer2SupportConceptOid.GetHashCode());
|
||||
hash = (hash * hashingMultiplier) ^ IsAboutToExpire.GetHashCode();
|
||||
hash = (hash * hashingMultiplier) ^ ExpiresInThreeMonthsOrLess.GetHashCode();
|
||||
|
||||
|
||||
88
BeWoPlanerMobil/Models/MainSessionModel.cs
Normal file
88
BeWoPlanerMobil/Models/MainSessionModel.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class MainSessionModel : ISessionModel
|
||||
{
|
||||
public bool SessionInitialized { get; internal set; }
|
||||
public long? SelectedSupportConceptOid { get; internal set; }
|
||||
public long? SelectedCostBearerSupportConceptOid { get; internal set; }
|
||||
public bool ShowOnlyOwnSupportConcepts { get; internal set; }
|
||||
public bool ShowOnlyMyTeamsSupportConcepts { get; internal set; }
|
||||
public CustomerFilterEnum SelectedSupportConceptFilter { get; internal set; }
|
||||
public bool ShowExpiredSupportConcepts { get; internal set; }
|
||||
public long? SelectedServiceCategoryOid { get; internal set; }
|
||||
public long? SelectedServiceDescriptionOid { get; internal set; }
|
||||
public long? SelectedServiceRecordOid { get; internal set; }
|
||||
public long? SelectedEmployeeOid { get; internal set; }
|
||||
public NullableDateTimeSpan SelectedZeitraum { get; internal set; }
|
||||
public List<long> SelectedConceptCostBearerRelations { get; internal set; }
|
||||
public List<long> GroupBookingSelectedSupportConceptOids { get; internal set; }
|
||||
public List<long> GroupBookingSelectedEmployeeOids { get; internal set; }
|
||||
public List<long> GroupBookingSelectedCostbearerRelOids { get; internal set; }
|
||||
public bool IsInGroupBookingMode { get; internal set; }
|
||||
public bool IsInEditingMode { get; internal set; }
|
||||
public long? PreviouslySelectedEmployeeOid { get; internal set; }
|
||||
public long? PreviouslySelectedSupportConceptOid { get; internal set; }
|
||||
public long? PreviouslySelectedCostbearer2SupportConceptOid { get; internal set; }
|
||||
public bool IsInMultiBookingMode { get; internal set; }
|
||||
public List<long> MultiBookingSelectedSupportConceptOids { get; internal set; }
|
||||
public List<long> MultiBookingSelectedGroupOfPeopleOids { get; internal set; }
|
||||
public List<long> MultiBookingSelectedCostbearerRelOids { get; internal set; }
|
||||
public List<long> MultiBookingSelectedEmployeeOids { get; internal set; }
|
||||
public int CurrentPage { get; internal set; }
|
||||
public List<long> SelectedGoalOids { get; internal set; }
|
||||
public long LastCreatedServiceRecordOid { get; internal set; }
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
SessionInitialized = false;
|
||||
SelectedSupportConceptOid = null;
|
||||
SelectedCostBearerSupportConceptOid = null;
|
||||
ShowOnlyOwnSupportConcepts = false;
|
||||
ShowOnlyMyTeamsSupportConcepts = false;
|
||||
SelectedSupportConceptFilter = CustomerFilterEnum.All;
|
||||
ShowExpiredSupportConcepts = false;
|
||||
SelectedServiceCategoryOid = null;
|
||||
SelectedServiceDescriptionOid = null;
|
||||
SelectedServiceRecordOid = null;
|
||||
SelectedEmployeeOid = null;
|
||||
SelectedZeitraum = null;
|
||||
|
||||
SelectedConceptCostBearerRelations = new List<long>();
|
||||
GroupBookingSelectedSupportConceptOids = new List<long>();
|
||||
GroupBookingSelectedEmployeeOids = new List<long>();
|
||||
GroupBookingSelectedCostbearerRelOids = new List<long>();
|
||||
MultiBookingSelectedSupportConceptOids = new List<long>();
|
||||
MultiBookingSelectedGroupOfPeopleOids = new List<long>();
|
||||
MultiBookingSelectedCostbearerRelOids = new List<long>();
|
||||
MultiBookingSelectedEmployeeOids = new List<long>();
|
||||
|
||||
SelectedGoalOids = new List<long>();
|
||||
|
||||
PreviouslySelectedEmployeeOid = null;
|
||||
PreviouslySelectedSupportConceptOid = null;
|
||||
PreviouslySelectedCostbearer2SupportConceptOid = null;
|
||||
|
||||
IsInGroupBookingMode = false;
|
||||
IsInEditingMode = false;
|
||||
IsInMultiBookingMode = false;
|
||||
|
||||
CurrentPage = 0;
|
||||
LastCreatedServiceRecordOid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,19 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class ReportModel : AbstractModel
|
||||
{
|
||||
public ReportModel()
|
||||
{
|
||||
SessionModel = new ReportSessionModel();
|
||||
}
|
||||
|
||||
public ReportSessionModel ReportSessionModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return SessionModel as ReportSessionModel;
|
||||
}
|
||||
}
|
||||
|
||||
public QbSignatureIntervalSelection SelectedIntervalSelection { get; set; }
|
||||
|
||||
public List<SelectListItem> IntervalSelections => new List<SelectListItem>
|
||||
@@ -41,16 +54,16 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
};
|
||||
|
||||
[Display(Name = "Klient")]
|
||||
public long? SelectedCustomerOid => SelectedCustomer?.CustomerOid;
|
||||
[Display(Name = "Klient")]
|
||||
public long? SelectedCustomerOid { get { return ReportSessionModel.SelectedCustomerOid; } set { ReportSessionModel.SelectedCustomerOid = value; } }
|
||||
|
||||
public CompactCustomerDC SelectedCustomer { get; set; }
|
||||
|
||||
[Display(Name = "Monat")]
|
||||
public int? SelectedMonth { get; set; }
|
||||
public int? SelectedMonth { get { return ReportSessionModel.SelectedMonth; } set { ReportSessionModel.SelectedMonth = value; } }
|
||||
|
||||
[Display(Name = "Jahr")]
|
||||
public int? SelectedYear { get; set; }
|
||||
public int? SelectedYear { get { return ReportSessionModel.SelectedYear; } set { ReportSessionModel.SelectedYear = value; } }
|
||||
|
||||
public List<SelectListItem> Months
|
||||
{
|
||||
@@ -115,27 +128,27 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
[Display(Name = "Vom")]
|
||||
public int? SelectedStartDay { get; set; }
|
||||
public int? SelectedStartDay { get { return ReportSessionModel.SelectedStartDay; } set { ReportSessionModel.SelectedStartDay = value; } }
|
||||
|
||||
[Display(Name = "Bis")]
|
||||
public int? SelectedEndDay { get; set; }
|
||||
public int? SelectedEndDay { get { return ReportSessionModel.SelectedEndDay; } set { ReportSessionModel.SelectedEndDay = value; } }
|
||||
|
||||
public ConfirmationReceiptObject ConfirmationReceiptObject { get; set; }
|
||||
|
||||
[Display(Name = "Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid => SelectedEmployee?.EmployeeOid;
|
||||
public long? SelectedEmployeeOid { get { return ReportSessionModel.SelectedEmployeeOid; } set { ReportSessionModel.SelectedEmployeeOid = value; } }
|
||||
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
|
||||
[Display(Name="Kostenträger")]
|
||||
public long? SelectedOrganisationOid => SelectedOrganisation?.OrganisationOid;
|
||||
public long? SelectedOrganisationOid { get { return ReportSessionModel.SelectedOrganisationOid; } set { ReportSessionModel.SelectedOrganisationOid = value; } }
|
||||
|
||||
public CompactOrganisationDC SelectedOrganisation { get; set; }
|
||||
|
||||
public List<CompactOrganisationDC> Organisations { get; set; } = new List<CompactOrganisationDC>();
|
||||
|
||||
[Display(Name="Leistungskategorie")]
|
||||
public long? SelectedServiceCategoryOid => SelectedServiceCategory?.ServiceCategoryOid;
|
||||
public long? SelectedServiceCategoryOid { get { return ReportSessionModel.SelectedServiceCategoryOid; } set { ReportSessionModel.SelectedServiceCategoryOid = value; } }
|
||||
|
||||
public ServiceCategoryDC SelectedServiceCategory { get; set; }
|
||||
|
||||
@@ -166,21 +179,33 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
[Display(Name="Filter")]
|
||||
public QbFilterItem SelectedFilterItem { get; set; }
|
||||
|
||||
public int? SelectedFilterItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
if(SelectedFilterItem is null)
|
||||
|
||||
public QbFilterItem SelectedFilterItem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (QbFilters == null || !SelectedFilterItemId.HasValue)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (int)SelectedFilterItem.FilterEnum;
|
||||
}
|
||||
return QbFilters.FirstOrDefault(f => f.FilterEnum == SelectedFilterItemId.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public QBFilterEnum? SelectedFilterItemId { get { return ReportSessionModel.SelectedFilterItemId; } set { ReportSessionModel.SelectedFilterItemId = value; } }
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if(SelectedFilterItem is null)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// return (int)SelectedFilterItem.FilterEnum;
|
||||
// }
|
||||
//}
|
||||
|
||||
public List<QbFilterItem> QbFilters { get; set; } = new List<QbFilterItem>();
|
||||
|
||||
public List<SelectListItem> QbFilterItems
|
||||
@@ -203,7 +228,7 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
[Display(Name = "Team")]
|
||||
public long? SelectedTeamOid => SelectedTeam?.TeamOid;
|
||||
public long? SelectedTeamOid { get { return ReportSessionModel.SelectedTeamOid; } set { ReportSessionModel.SelectedTeamOid = value; } }
|
||||
|
||||
public CompactTeamDC SelectedTeam { get; set; }
|
||||
|
||||
@@ -244,9 +269,9 @@ namespace BeWoPlanerMobil.Models
|
||||
ConfirmationReceiptSignatures.Where(crs => crs.ConfirmationReceiptSignatureOid != null && confirmationReceiptSignatureOids.Contains(crs.ConfirmationReceiptSignatureOid.Value)).ToList();
|
||||
}
|
||||
|
||||
public bool IsForSelectedEmployeesOnly { get; set; }
|
||||
public bool IsForSelectedCostbearersOnly { get; set; }
|
||||
public bool IsForSelectedCategoryOnly { get; set; }
|
||||
public bool IsForSelectedEmployeesOnly { get { return ReportSessionModel.IsForSelectedEmployeesOnly; } set { ReportSessionModel.IsForSelectedEmployeesOnly = value; } }
|
||||
public bool IsForSelectedCostbearersOnly { get { return ReportSessionModel.IsForSelectedCostbearersOnly; } set { ReportSessionModel.IsForSelectedCostbearersOnly = value; } }
|
||||
public bool IsForSelectedCategoryOnly { get { return ReportSessionModel.IsForSelectedCategoryOnly; } set { ReportSessionModel.IsForSelectedCategoryOnly = value; } }
|
||||
|
||||
public List<ConfirmationReceiptSignatureObject> SelectedConfirmationReceiptSignatures { get; set; }
|
||||
|
||||
@@ -254,7 +279,9 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public AbstractReportCreator ReportCreator { get; set; }
|
||||
|
||||
public XtraReport QuittierungsbelegsReportObject { get; set; }
|
||||
public QuittierungsbelegsReportSettings QuittierungsbelegsReportSettings { get { return ReportSessionModel.QuittierungsbelegsReportSettings; } set { ReportSessionModel.QuittierungsbelegsReportSettings = value; } }
|
||||
|
||||
public XtraReport QuittierungsbelegsReport { get; set; }
|
||||
|
||||
public int QbEntryCount { get; set; }
|
||||
public int MaxResults { get; set; } = 10;
|
||||
|
||||
54
BeWoPlanerMobil/Models/ReportSessionModel .cs
Normal file
54
BeWoPlanerMobil/Models/ReportSessionModel .cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BeWoPlanerMobil.Util.ReportUtils;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class ReportSessionModel : ISessionModel
|
||||
{
|
||||
public long? SelectedCustomerOid { get; set; }
|
||||
public long? SelectedEmployeeOid { get; set; }
|
||||
public long? SelectedTeamOid { get; set; }
|
||||
public long? SelectedOrganisationOid { get; set; }
|
||||
public long? SelectedServiceCategoryOid { get; set; }
|
||||
public int? SelectedMonth { get; internal set; }
|
||||
public int? SelectedYear { get; internal set; }
|
||||
public int? SelectedStartDay { get; internal set; }
|
||||
public int? SelectedEndDay { get; internal set; }
|
||||
public QBFilterEnum? SelectedFilterItemId { get; internal set; }
|
||||
public bool IsForSelectedEmployeesOnly { get; internal set; }
|
||||
public bool IsForSelectedCostbearersOnly { get; internal set; }
|
||||
public bool IsForSelectedCategoryOnly { get; internal set; }
|
||||
public QuittierungsbelegsReportSettings QuittierungsbelegsReportSettings { get; internal set; }
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
SelectedCustomerOid = null;
|
||||
SelectedEmployeeOid = null;
|
||||
SelectedTeamOid = null;
|
||||
SelectedOrganisationOid = null;
|
||||
SelectedServiceCategoryOid = null;
|
||||
SelectedMonth = null;
|
||||
SelectedYear = null;
|
||||
SelectedStartDay = null;
|
||||
SelectedEndDay = null;
|
||||
SelectedFilterItemId = null;
|
||||
IsForSelectedEmployeesOnly = false;
|
||||
IsForSelectedCostbearersOnly = false;
|
||||
IsForSelectedCategoryOnly = false;
|
||||
QuittierungsbelegsReportSettings = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,26 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class ReportViewerModel : AbstractModel
|
||||
{
|
||||
public ReportViewerModel()
|
||||
{
|
||||
SessionModel = new ReportViewerSessionModel();
|
||||
}
|
||||
|
||||
public ReportViewerSessionModel ReportViewerSessionModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return SessionModel as ReportViewerSessionModel;
|
||||
}
|
||||
}
|
||||
|
||||
public List<CompactEmployeeDC> AllEmployees { get; set; }
|
||||
public List<CompactTeamDC> AllTeams { get; set; }
|
||||
public List<QueryDC> Queries { get; set; }
|
||||
public AbstractReportCreator ReportCreator { get; set; }
|
||||
|
||||
[Display(Name = "Monat")]
|
||||
public int? SelectedMonth { get; set; }
|
||||
public int? SelectedMonth { get { return ReportViewerSessionModel.SelectedMonth; } set { ReportViewerSessionModel.SelectedMonth = value; } }
|
||||
public List<SelectListItem> Months
|
||||
{
|
||||
get
|
||||
@@ -40,7 +53,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
|
||||
[Display(Name = "Jahr")]
|
||||
public int? SelectedYear { get; set; }
|
||||
public int? SelectedYear { get { return ReportViewerSessionModel.SelectedYear; } set { ReportViewerSessionModel.SelectedYear = value; } }
|
||||
public List<SelectListItem> Years
|
||||
{
|
||||
get
|
||||
@@ -62,7 +75,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
|
||||
[Display(Name="Bericht")]
|
||||
public ReportType SelectedReportType { get; set; }
|
||||
public ReportType SelectedReportType { get { return ReportViewerSessionModel.SelectedReportType; } set { ReportViewerSessionModel.SelectedReportType = value; } }
|
||||
public List<SelectListItem> ReportTypes { get; set; }
|
||||
|
||||
|
||||
@@ -94,7 +107,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
|
||||
[Display(Name = "Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid => SelectedEmployee?.EmployeeOid;
|
||||
public long? SelectedEmployeeOid { get { return ReportViewerSessionModel.SelectedEmployeeOid; } set { ReportViewerSessionModel.SelectedEmployeeOid = value; } }
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
public List<SelectListItem> Employees
|
||||
{
|
||||
@@ -109,7 +122,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
if(HasRightMitarbeiterstundenkontoViewSelf && !HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
result.Add(new SelectListItem{ Text = Employee.LastNameFirstName, Value = Employee.EmployeeOid.ToString()});
|
||||
result.Add(new SelectListItem{ Text = LoggedInEmployee.LastNameFirstName, Value = LoggedInEmployee.EmployeeOid.ToString()});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -126,7 +139,7 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
|
||||
[Display(Name = "Team")]
|
||||
public long? SelectedTeamOid => SelectedTeam?.TeamOid;
|
||||
public long? SelectedTeamOid { get { return ReportViewerSessionModel.SelectedTeamOid; } set { ReportViewerSessionModel.SelectedTeamOid = value; } }
|
||||
public CompactTeamDC SelectedTeam { get; set; }
|
||||
public List<SelectListItem> Teams
|
||||
{
|
||||
@@ -151,11 +164,14 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
|
||||
public List<CompactEmployeeDC> SelectedEmployees { get; set; }
|
||||
public List<CompactTeamDC> SelectedTeams { get; set; }
|
||||
//public List<CompactEmployeeDC> SelectedEmployees { get; set; }
|
||||
//public List<CompactTeamDC> SelectedTeams { get; set; }
|
||||
|
||||
public long? SelectedQueryOid { get { return ReportViewerSessionModel.SelectedQueryOid; } set { ReportViewerSessionModel.SelectedQueryOid = value; } }
|
||||
public QueryDC SelectedQuery { get; set; }
|
||||
|
||||
|
||||
|
||||
public List<SupportConceptDC> SupportConcepts { get; set; }
|
||||
|
||||
public CostBearer2SupportConceptRelListObject SelectedCostBearer2SupportConceptRelListObject { get; set; }
|
||||
@@ -164,14 +180,14 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
get
|
||||
{
|
||||
var allCostBearerRelations = new List<CostBearer2SupportConceptRelListObject> { new CostBearer2SupportConceptRelListObject("Hilfeplan auswählen", "", "0", false, false) };
|
||||
var allCostBearerRelations = new List<CostBearer2SupportConceptRelListObject> { new CostBearer2SupportConceptRelListObject("Hilfeplan auswählen", "", 0, false, false) };
|
||||
foreach(var sc in SupportConcepts.OrderBy(sc => sc.Customer.LastName))
|
||||
{
|
||||
allCostBearerRelations.AddRange(sc.CostBearerRelations.Select(
|
||||
cb => new CostBearer2SupportConceptRelListObject(
|
||||
$"{sc.Customer.SimpleDescription} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}",
|
||||
$"{cb.AuswahlBezeichnung} {cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}{GetIsNotApproved(cb)}",
|
||||
cb.CostBearer2SupportConceptOid.ToString(),
|
||||
cb.CostBearer2SupportConceptOid.Value,
|
||||
cb.SupportConcept.IsAboutToExpire,
|
||||
cb.SupportConcept.ExpiresIn3MonthOrLess))
|
||||
);
|
||||
@@ -231,6 +247,7 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ReportSelectListItem : SelectListItem
|
||||
{
|
||||
public long? QueryOid { get; set; }
|
||||
|
||||
37
BeWoPlanerMobil/Models/ReportViewerSessionModel.cs
Normal file
37
BeWoPlanerMobil/Models/ReportViewerSessionModel.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class ReportViewerSessionModel : ISessionModel
|
||||
{
|
||||
public long? SelectedEmployeeOid { get; set; }
|
||||
public long? SelectedTeamOid { get; set; }
|
||||
public int? SelectedMonth { get; internal set; }
|
||||
public int? SelectedYear { get; internal set; }
|
||||
public ReportType SelectedReportType { get; internal set; }
|
||||
public long? SelectedQueryOid { get; internal set; }
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
SelectedEmployeeOid = null;
|
||||
SelectedTeamOid = null;
|
||||
SelectedMonth = null;
|
||||
SelectedYear = null;
|
||||
SelectedReportType = ReportType.Berichte;
|
||||
SelectedQueryOid = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,49 +15,38 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class SchedulerModel : AbstractModel
|
||||
{
|
||||
public List<long> TeamMemberCustomerOids { get; set; }
|
||||
|
||||
public DateTime SelectedDate { get; set; } = DateTime.Today;
|
||||
|
||||
public SchedulerAppointmentDC SelectedAppointment { get; set; }
|
||||
|
||||
private List<SchedulerAppointmentDC> _Appointments;
|
||||
|
||||
public List<SchedulerAppointmentDC> Appointments
|
||||
public SchedulerModel()
|
||||
{
|
||||
get => _Appointments ?? (_Appointments = new List<SchedulerAppointmentDC>());
|
||||
SessionModel = new SchedulerSessionModel();
|
||||
SessionModel.ResetValues();
|
||||
}
|
||||
|
||||
set
|
||||
public SchedulerSessionModel SchedulerSessionModel
|
||||
{
|
||||
get
|
||||
{
|
||||
var oldAppointments = AppointmentListItems.Select(li => li.SchedulerAppointment).ToList();
|
||||
|
||||
_Appointments = value ?? new List<SchedulerAppointmentDC>();
|
||||
|
||||
if(_Appointments.AreListEqual(oldAppointments))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_AppointmentListItems = new List<AppointmentListItem>();
|
||||
|
||||
foreach(var appointment in _Appointments)
|
||||
{
|
||||
var listItem = new AppointmentListItem(appointment);
|
||||
listItem.GenerateIdentifier(_AppointmentListItems.Select(a => a.Identifier).ToList());
|
||||
|
||||
_AppointmentListItems.Add(listItem);
|
||||
}
|
||||
return SessionModel as SchedulerSessionModel;
|
||||
}
|
||||
}
|
||||
|
||||
private List<AppointmentListItem> _AppointmentListItems;
|
||||
public List<AppointmentListItem> AppointmentListItems => _AppointmentListItems ?? (_AppointmentListItems = new List<AppointmentListItem>());
|
||||
|
||||
public bool HasRightToEditAppointment(Guid identifier)
|
||||
public List<long> TeamMemberCustomerOids { get; set; }
|
||||
|
||||
public DateTime SelectedDate { get { return SchedulerSessionModel.SelectedDate; } set { SchedulerSessionModel.SelectedDate = value; } }
|
||||
|
||||
public long? SelectedAppointmentOid { get { return SchedulerSessionModel.SelectedAppointmentOid; } set { SchedulerSessionModel.SelectedAppointmentOid = value; } }
|
||||
|
||||
public SchedulerAppointmentDC SelectedAppointment { get; set; }
|
||||
|
||||
|
||||
public List<SchedulerAppointmentDC> Appointments { get; set; }
|
||||
|
||||
public List<AppointmentListItem> AppointmentListItems { get; set; }
|
||||
|
||||
public bool HasRightToEditAppointment(String identifier)
|
||||
{
|
||||
var appointment = AppointmentListItems.FirstOrDefault(app => app.Identifier.Equals(identifier))?.SchedulerAppointment; //Appointments.FirstOrDefault(app => app.SchedulerAppointmentOid.HasValue && app.SchedulerAppointmentOid.Value == appointmentOid);
|
||||
|
||||
return appointment != null && Utils.CheckSchedulerRights(appointment.CustomerList, appointment.ResourceList, appointment.EmployeeList, appointment.Originator, appointment.SchedulerAppointmentOid is null, SchedulerRightsCheckType.Edit, MobileSessionFacade.LoggedInUserDC, TeamMemberCustomerOids ?? new List<long>());
|
||||
return appointment != null && BS.Shared.Core.Utils.CheckSchedulerRights(appointment.CustomerList, appointment.ResourceList, appointment.EmployeeList, appointment.Originator, appointment.SchedulerAppointmentOid is null, SchedulerRightsCheckType.Edit, LoggedInUser, TeamMemberCustomerOids ?? new List<long>());
|
||||
}
|
||||
|
||||
public string DescriptionToEdit => SelectedAppointment?.Description ?? string.Empty;
|
||||
@@ -85,7 +74,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public List<ResourceDC> SelectedResources { get; set; } = new List<ResourceDC>();
|
||||
public List<long> SelectedResourceOids { get { return SchedulerSessionModel.SelectedResourceOids; } set { SchedulerSessionModel.SelectedResourceOids = value; } }
|
||||
|
||||
public List<ResourceDC> SelectedResources { get; set; }
|
||||
|
||||
public Dictionary<ValueListEntryDC, List<ResourceDC>> ResourceCategories2Resources { get; set; } = new Dictionary<ValueListEntryDC, List<ResourceDC>>();
|
||||
|
||||
@@ -112,42 +103,30 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public List<CompactEmployeeDC> AllEmployees { get; set; } = new List<CompactEmployeeDC>();
|
||||
|
||||
public List<CompactEmployeeDC> SelectedEmployees { get; set; } = new List<CompactEmployeeDC>();
|
||||
public List<long> SelectedEmployeeOids { get { return SchedulerSessionModel.SelectedEmployeeOids; } set { SchedulerSessionModel.SelectedEmployeeOids = value; } }
|
||||
|
||||
public List<CompactEmployeeDC> SelectedEmployees { get; set; }
|
||||
|
||||
public List<CompactCustomerDC> AllCustomers { get; set; } = new List<CompactCustomerDC>();
|
||||
|
||||
public List<long> SelectedCustomerOids { get { return SchedulerSessionModel.SelectedCustomerOids; } set { SchedulerSessionModel.SelectedCustomerOids = value; } }
|
||||
|
||||
public List<CompactCustomerDC> SelectedCustomers { get; set; } = new List<CompactCustomerDC>();
|
||||
|
||||
public bool IsInEditMode => SelectedAppointment != null;
|
||||
public bool IsInEditMode => SelectedAppointmentOid.HasValue;
|
||||
|
||||
// ToDo: Überarbeiten? Es kam das Ansehen hinzu
|
||||
public bool HasResourcesEmployeesOrCustomers
|
||||
{
|
||||
get
|
||||
{
|
||||
var isOwnAppointment = !IsInEditMode || SelectedAppointment.Originator.EmployeeOid == Employee.EmployeeOid;
|
||||
|
||||
var v1 = HasRightToInsertEmployeeAppointments || IsInEditMode && HasRightToEditEmployeeAppointments;
|
||||
|
||||
var v2 = HasRightToInsertRessourceAppointments || IsInEditMode && HasRightToEditResourceAppointments;
|
||||
|
||||
if (IsInEditMode && !isOwnAppointment)
|
||||
{
|
||||
v2 = HasRightToEditOthersResourceAppointments;
|
||||
}
|
||||
|
||||
var v3 = HasRightToInsertCustomerAppointments || IsInEditMode && HasRightToEditCustomerAppointments;
|
||||
|
||||
return v1 || v2 || v3;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasResourcesEmployeesOrCustomers { get; set; }
|
||||
|
||||
public bool ShowEmployeeButton => IsInEditMode ? HasRightToInsertEmployeeAppointments : HasRightToEditEmployeeAppointments;
|
||||
public bool ShowCustomerButton => IsInEditMode ? HasRightToInsertCustomerAppointments : HasRightToEditCustomerAppointments;
|
||||
|
||||
//IntervalFinder
|
||||
public List<long> SelectedEmployeeOidsForIntervalFinder { get { return SchedulerSessionModel.SelectedEmployeeOidsForIntervalFinder; } set { SchedulerSessionModel.SelectedEmployeeOidsForIntervalFinder = value; } }
|
||||
public List<CompactEmployeeDC> SelectedEmployeesForIntervalFinder { get; set; } = new List<CompactEmployeeDC>();
|
||||
public List<long> SelectedCustomerOidsForIntervalFinder { get { return SchedulerSessionModel.SelectedCustomerOidsForIntervalFinder; } set { SchedulerSessionModel.SelectedCustomerOidsForIntervalFinder = value; } }
|
||||
public List<CompactCustomerDC> SelectedCustomersForIntervalFinder { get; set; } = new List<CompactCustomerDC>();
|
||||
public List<long> SelectedResourceOidsForIntervalFinder { get { return SchedulerSessionModel.SelectedResourceOidsForIntervalFinder; } set { SchedulerSessionModel.SelectedResourceOidsForIntervalFinder = value; } }
|
||||
public List<ResourceDC> SelectedResourcesForIntervalFinder { get; set; } = new List<ResourceDC>();
|
||||
|
||||
public Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> FreeIntervals { get; set; } = new Dictionary<DateTimeSpan, Dictionary<DateTime, bool>>();
|
||||
@@ -170,34 +149,38 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInIntervalFinderMode { get; set; }
|
||||
public DateTime? IntervalStartDate { get; set; }
|
||||
public DateTime? IntervalEndDate { get; set; }
|
||||
public bool IsInIntervalFinderMode { get { return SchedulerSessionModel.IsInIntervalFinderMode; } set { SchedulerSessionModel.IsInIntervalFinderMode = value; } }
|
||||
public DateTime? IntervalStartDate { get { return SchedulerSessionModel.IntervalStartDate; } set { SchedulerSessionModel.IntervalStartDate = value; } }
|
||||
public DateTime? IntervalEndDate { get { return SchedulerSessionModel.IntervalEndDate; } set { SchedulerSessionModel.IntervalEndDate = value; } }
|
||||
|
||||
public string IntervalStartDateStr => IntervalStartDate.HasValue ? IntervalStartDate.Value.ToString("yyyy-MM-ddTHH:mm") : string.Empty;
|
||||
public string IntervalEndDateStr => IntervalEndDate.HasValue ? IntervalEndDate.Value.ToString("yyyy-MM-ddTHH:mm") : string.Empty;
|
||||
public string IntervalStartTimeStr => IntervalStartDate.HasValue ? $"{IntervalStartDate:HH:mm}" : string.Empty;
|
||||
public string IntervalEndTimeStr => IntervalEndDate.HasValue ? $"{IntervalEndDate:HH:mm}" : string.Empty;
|
||||
|
||||
public int? IntervalDuration { get; set; }
|
||||
public int? IntervalDuration { get { return SchedulerSessionModel.IntervalDuration; } set { SchedulerSessionModel.IntervalDuration = value; } }
|
||||
|
||||
public string IntervalDurationStr => IntervalDuration.HasValue ? $"{IntervalDuration}" : string.Empty;
|
||||
|
||||
[Display(Name = "Ganztägig")]
|
||||
public bool IsAllDay { get; set; }
|
||||
|
||||
public bool IsAllDay { get { return SchedulerSessionModel.IsAllDay; } set { SchedulerSessionModel.IsAllDay = value; } }
|
||||
|
||||
[Display(Name = "Privat")]
|
||||
public bool IsPrivate { get; set; }
|
||||
public bool IsPrivate { get { return SchedulerSessionModel.IsPrivate; } set { SchedulerSessionModel.IsPrivate = value; } }
|
||||
|
||||
|
||||
public List<CompactEmployeeDC> MyTeamEmployees { get; set; }
|
||||
|
||||
public List<ResourceDC> SelectedResourcesForFiltering { get; set; } = new List<ResourceDC>();
|
||||
public List<CompactEmployeeDC> SelectedEmployeesForFiltering { get; set; } = new List<CompactEmployeeDC>();
|
||||
public List<CompactCustomerDC> SelectedCustomersForFiltering { get; set; } = new List<CompactCustomerDC>();
|
||||
public List<long> SelectedResourceOidsForFiltering { get { return SchedulerSessionModel.SelectedResourceOidsForFiltering; } set { SchedulerSessionModel.SelectedResourceOidsForFiltering = value; } }
|
||||
public List<ResourceDC> SelectedResourcesForFiltering { get; set; }
|
||||
public List<long> SelectedEmployeeOidsForFiltering { get { return SchedulerSessionModel.SelectedEmployeeOidsForFiltering; } set { SchedulerSessionModel.SelectedEmployeeOidsForFiltering = value; } }
|
||||
public List<CompactEmployeeDC> SelectedEmployeesForFiltering { get; set; }
|
||||
public List<long> SelectedCustomerOidsForFiltering { get { return SchedulerSessionModel.SelectedCustomerOidsForFiltering; } set { SchedulerSessionModel.SelectedCustomerOidsForFiltering = value; } }
|
||||
public List<CompactCustomerDC> SelectedCustomersForFiltering { get; set; }
|
||||
|
||||
public List<CompactTeamDC> MyTeams { get; set; } = new List<CompactTeamDC>();
|
||||
|
||||
public bool ShouldLoadTasks { get; set; }
|
||||
public bool ShouldLoadTasks { get { return SchedulerSessionModel.ShouldLoadTasks; } set { SchedulerSessionModel.ShouldLoadTasks = value; } }
|
||||
}
|
||||
|
||||
public class WeekViewObject
|
||||
@@ -240,13 +223,13 @@ namespace BeWoPlanerMobil.Models
|
||||
SaturdayAppointments = new KeyValuePair<DateTime, List<AppointmentListItem>>(saturday, new List<AppointmentListItem>());
|
||||
SundayAppointments = new KeyValuePair<DateTime, List<AppointmentListItem>>(last, new List<AppointmentListItem>());
|
||||
|
||||
mondays.DoForEach(app => MondayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
tuesdays.DoForEach(app => TuesdayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
wednesdays.DoForEach(app => WednesdayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
thursdays.DoForEach(app => ThursdayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
fridays.DoForEach(app => FridayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
saturdays.DoForEach(app => SaturdayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
sundays.DoForEach(app => SundayAppointments.Value.Add(new AppointmentListItem(app)));
|
||||
mondays.DoForEach(app => MondayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
tuesdays.DoForEach(app => TuesdayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
wednesdays.DoForEach(app => WednesdayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
thursdays.DoForEach(app => ThursdayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
fridays.DoForEach(app => FridayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
saturdays.DoForEach(app => SaturdayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
sundays.DoForEach(app => SundayAppointments.Value.Add(new AppointmentListItem("", app)));
|
||||
}
|
||||
}
|
||||
}
|
||||
61
BeWoPlanerMobil/Models/SchedulerSessionModel.cs
Normal file
61
BeWoPlanerMobil/Models/SchedulerSessionModel.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class SchedulerSessionModel : ISessionModel
|
||||
{
|
||||
public DateTime SelectedDate { get; set; }
|
||||
public long? SelectedAppointmentOid { get; internal set; }
|
||||
public List<long> SelectedResourceOids { get; internal set; }
|
||||
public List<long> SelectedEmployeeOids { get; internal set; }
|
||||
public List<long> SelectedCustomerOids { get; internal set; }
|
||||
public List<long> SelectedEmployeeOidsForIntervalFinder { get; internal set; }
|
||||
public List<long> SelectedCustomerOidsForIntervalFinder { get; internal set; }
|
||||
public List<long> SelectedResourceOidsForIntervalFinder { get; internal set; }
|
||||
public bool IsAllDay { get; set; }
|
||||
public bool IsPrivate { get; set; }
|
||||
public List<long> SelectedEmployeeOidsForFiltering { get; internal set; }
|
||||
public List<long> SelectedCustomerOidsForFiltering { get; internal set; }
|
||||
public List<long> SelectedResourceOidsForFiltering { get; internal set; }
|
||||
public bool ShouldLoadTasks { get; internal set; }
|
||||
public bool IsInIntervalFinderMode { get; internal set; }
|
||||
public DateTime? IntervalStartDate { get; internal set; }
|
||||
public DateTime? IntervalEndDate { get; internal set; }
|
||||
public int? IntervalDuration { get; internal set; }
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
SelectedDate = DateTime.Today;
|
||||
SelectedAppointmentOid = null;
|
||||
SelectedResourceOids = new List<long>();
|
||||
SelectedEmployeeOids = new List<long>();
|
||||
SelectedCustomerOids = new List<long>();
|
||||
SelectedEmployeeOidsForIntervalFinder = new List<long>();
|
||||
SelectedCustomerOidsForIntervalFinder = new List<long>();
|
||||
SelectedResourceOidsForIntervalFinder = new List<long>();
|
||||
SelectedEmployeeOidsForFiltering = new List<long>();
|
||||
SelectedCustomerOidsForFiltering = new List<long>();
|
||||
SelectedResourceOidsForFiltering = new List<long>();
|
||||
IsAllDay = false;
|
||||
IsPrivate = false;
|
||||
ShouldLoadTasks = false;
|
||||
IsInIntervalFinderMode = false;
|
||||
IntervalStartDate = null;
|
||||
IntervalEndDate = null;
|
||||
IntervalDuration = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ using System.Web;
|
||||
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
@@ -110,10 +111,10 @@ namespace BeWoPlanerMobil.Service
|
||||
|
||||
var userLoaded = TryAuthenticateWithLoginForm(context);
|
||||
|
||||
if(!userLoaded && MobileSessionFacade.LoggedInUser != null && MobileSessionFacade.LoggedInUser.Oid.HasValue)
|
||||
{
|
||||
MobileSessionFacade.LoggedInUser = DAOFactory.GenericDAO.LoadByID<ApplicationUser>(MobileSessionFacade.LoggedInUser.Oid.Value);
|
||||
}
|
||||
//if(!userLoaded && MobileSessionFacade.LoggedInUser != null && MobileSessionFacade.LoggedInUser.UserOid.HasValue)
|
||||
//{
|
||||
// MobileSessionFacade.LoggedInUser = MapperFactory.UserDC_User.MapToNewDC(DAOFactory.GenericDAO.LoadByID<ApplicationUser>(MobileSessionFacade.LoggedInUser.UserOid.Value));
|
||||
//}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -203,7 +204,10 @@ namespace BeWoPlanerMobil.Service
|
||||
}
|
||||
|
||||
MobileSessionFacade.PasswordStrength = new PasswordUtils().EvaluatePasswordStrength(password);
|
||||
MobileSessionFacade.LoggedInUser = user;
|
||||
|
||||
MobileSessionFacade.LoggedInUserOid = user.Oid;
|
||||
MobileSessionFacade.EmployeeFullname = user.Employee.Person.FirstNameLastName;
|
||||
//MobileSessionFacade.LoggedInEmployee = MapperFactory.EmployeeDC_Employee.MapToNewDC(user.Employee);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -6,8 +6,7 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
|
||||
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
@@ -43,52 +42,85 @@ namespace BeWoPlanerMobil.Service
|
||||
public IReportService ReportService { get; }
|
||||
public IQueryService QueryService { get; }
|
||||
|
||||
public static ApplicationUser LoggedInUser
|
||||
public static long? LoggedInUserOid
|
||||
{
|
||||
get => HttpContext.Current.Session["apuser"] as ApplicationUser;
|
||||
get => HttpContext.Current.Session["LoggedInUserOid"] as long?;
|
||||
|
||||
set => HttpContext.Current.Session["apuser"] = value;
|
||||
set => HttpContext.Current.Session["LoggedInUserOid"] = value;
|
||||
}
|
||||
|
||||
public static string EmployeeFullname => LoggedInUser != null ? LoggedInUser.Employee.Person.FirstNameLastName : string.Empty;
|
||||
//public static UserDC LoggedInUser
|
||||
//{
|
||||
// get => HttpContext.Current.Session["apuser"] as UserDC;
|
||||
|
||||
public static EmployeeDC LoggedInEmployee => LoggedInUser == null ? null : MapperFactory.EmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee);
|
||||
// set => HttpContext.Current.Session["apuser"] = value;
|
||||
//}
|
||||
|
||||
public static CompactEmployeeDC LoggedInCompactEmployee => LoggedInUser == null ? null : MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(LoggedInUser.Employee);
|
||||
//public static EmployeeDC LoggedInEmployee
|
||||
//{
|
||||
// get => HttpContext.Current.Session["LoggedInEmployee"] as EmployeeDC;
|
||||
|
||||
public static UserDC LoggedInUserDC => LoggedInUser == null ? null : MapperFactory.UserDC_User.MapToNewDC(LoggedInUser);
|
||||
// set => HttpContext.Current.Session["LoggedInEmployee"] = value;
|
||||
//}
|
||||
|
||||
public static List<SettingsDC> UserSettings => LoggedInUserDC.Settings;
|
||||
//public static string EmployeeFullname => LoggedInUser != null ? LoggedInUser.Employee.FirstNameLastName : string.Empty;
|
||||
|
||||
public static string Tenant
|
||||
// public static CompactEmployeeDC LoggedInCompactEmployee => LoggedInUser == null ? null : LoggedInUser.Employee;
|
||||
|
||||
|
||||
// public static List<SettingsDC> UserSettings => LoggedInUser.Settings;
|
||||
public static string LocalStorageKey => LoggedInUserOid.HasValue ? $"bwp_{MobileSessionFacade.Tenant}_{LoggedInUserOid}" : null;
|
||||
|
||||
public static string EmployeeFullname
|
||||
{
|
||||
get => HttpContext.Current.Session["EmployeeFullname"] as string;
|
||||
|
||||
set => HttpContext.Current.Session["EmployeeFullname"] = value;
|
||||
}
|
||||
|
||||
public static string Tenant
|
||||
{
|
||||
get => HttpContext.Current.Session["tenant"] as string;
|
||||
|
||||
set => HttpContext.Current.Session["tenant"] = value;
|
||||
}
|
||||
|
||||
public static MandatorDC Mandator
|
||||
public static string TimeOfLastAction
|
||||
{
|
||||
get => HttpContext.Current.Session["mandator"] as MandatorDC;
|
||||
get => HttpContext.Current.Session["TimeOfLastAction"] as string;
|
||||
|
||||
set => HttpContext.Current.Session["mandator"] = value;
|
||||
set => HttpContext.Current.Session["TimeOfLastAction"] = value;
|
||||
}
|
||||
|
||||
public static bool IsUserLoggedIn()
|
||||
//public long? MandatorOid
|
||||
//{
|
||||
// get => HttpContext.Current.Session["MandatorOid"] as long?;
|
||||
|
||||
// set => HttpContext.Current.Session["MandatorOid"] = value;
|
||||
//}
|
||||
|
||||
public static MokMandator Mandator
|
||||
{
|
||||
get => HttpContext.Current.Session["mandator"] as MokMandator;
|
||||
|
||||
set => HttpContext.Current.Session["mandator"] = value;
|
||||
}
|
||||
|
||||
public static bool IsUserLoggedIn()
|
||||
{
|
||||
return LoggedInUser != null;
|
||||
return LoggedInUserOid.HasValue;
|
||||
}
|
||||
|
||||
public static void LogUserOut()
|
||||
{
|
||||
HttpContext.Current.Session["apuser"] = null;
|
||||
HttpContext.Current.Session["LoggedInUserOid"] = null;
|
||||
HttpContext.Current.Session.Abandon();
|
||||
}
|
||||
|
||||
public static bool CheckForUserRight(UserRightType userRightType)
|
||||
{
|
||||
return LoggedInUser != null && LoggedInUser.UserGroups.Any(ug => ug.Rights.Any(rr => rr.RightType.Equals(userRightType)));
|
||||
}
|
||||
//public static bool CheckForUserRight(UserRightType userRightType)
|
||||
//{
|
||||
// return LoggedInUser != null && LoggedInUser.UserGroups.Any(ug => ug.Rights.Any(rr => rr.Equals(userRightType)));
|
||||
//}
|
||||
|
||||
public static string CookieName => "tenantKeks";
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BeWoPlanerMobil.Service;
|
||||
@@ -50,7 +51,8 @@ namespace BeWoPlanerMobil
|
||||
}
|
||||
else
|
||||
{
|
||||
MobileSessionFacade.LoggedInUser = user;
|
||||
MobileSessionFacade.LoggedInUserOid = user.Oid;
|
||||
MobileSessionFacade.EmployeeFullname = user.Employee.Person.FirstNameLastName;
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
public class AppointmentListItem
|
||||
{
|
||||
public Guid Identifier { get; private set; }
|
||||
public String Identifier { get; }
|
||||
|
||||
public long? Oid { get; }
|
||||
|
||||
@@ -71,20 +71,9 @@ namespace BeWoPlanerMobil.Util
|
||||
|
||||
public SchedulerAppointmentDC SchedulerAppointment { get; }
|
||||
|
||||
public void GenerateIdentifier(List<Guid> existingIdentifiers)
|
||||
public AppointmentListItem(String id, SchedulerAppointmentDC schedulerAppointment)
|
||||
{
|
||||
var identifier = Guid.NewGuid();
|
||||
while(existingIdentifiers.Contains(identifier))
|
||||
{
|
||||
identifier = Guid.NewGuid();
|
||||
}
|
||||
|
||||
Identifier = identifier;
|
||||
}
|
||||
|
||||
public AppointmentListItem(SchedulerAppointmentDC schedulerAppointment)
|
||||
{
|
||||
Identifier = Guid.NewGuid();
|
||||
Identifier = id;
|
||||
|
||||
Subject = schedulerAppointment.Subject;
|
||||
|
||||
|
||||
23
BeWoPlanerMobil/Util/DcToMokMapper.cs
Normal file
23
BeWoPlanerMobil/Util/DcToMokMapper.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.DataContracts.Invoicing;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
|
||||
public class DcToMokMapper
|
||||
{
|
||||
public static MokMandator CreateMandator(MandatorDC dc)
|
||||
{
|
||||
return new MokMandator
|
||||
{
|
||||
Settings = dc.Settings
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -56,22 +56,22 @@
|
||||
public static string ServiceRecordOidForSignature => "ServiceRecordOidForSignature";
|
||||
}
|
||||
|
||||
public class ModelSessionConstants
|
||||
{
|
||||
public static string ReportModelKey => "ReportModel";
|
||||
public static string CustomerModelKey => "CustomerModelModel";
|
||||
public static string SchedulerModelKey => "SchedulerModel";
|
||||
public static string MainModelKey => "MainModel";
|
||||
public static string DevelopmentModelKey => "DevelopmentModel";
|
||||
public static string DevExpressReportModelKey => "DevExpressReportModel";
|
||||
public static string ReportViewerModelKey => "ReportViewerModel";
|
||||
public static string DebuggingToolsModelKey => "DebuggingToolsModel";
|
||||
}
|
||||
//public class ModelSessionConstants
|
||||
//{
|
||||
// public static string ReportModelKey => "ReportModel";
|
||||
// public static string CustomerModelKey => "CustomerModelModel";
|
||||
// public static string SchedulerModelKey => "SchedulerModel";
|
||||
// public static string MainModelKey => "MainModel";
|
||||
// public static string DevelopmentModelKey => "DevelopmentModel";
|
||||
// public static string DevExpressReportModelKey => "DevExpressReportModel";
|
||||
// public static string ReportViewerModelKey => "ReportViewerModel";
|
||||
// public static string DebuggingToolsModelKey => "DebuggingToolsModel";
|
||||
//}
|
||||
|
||||
public class TempDataConstants
|
||||
{
|
||||
public static string ShowSignatureSuggestionPopup => "ShowSignatureSuggestionPopup";
|
||||
public static string AppointmentListItemKey => "AppointmentListItem";
|
||||
public static string AppointmentOidKey => "AppointmentOid";
|
||||
public static string IsInTransferModeKey => "IsInTransferMode";
|
||||
public static string AfterValidationStateKey => "AfterValidation";
|
||||
public static string PwChErrKey => "passwd-change-error";
|
||||
|
||||
37
BeWoPlanerMobil/Util/MokMandator.cs
Normal file
37
BeWoPlanerMobil/Util/MokMandator.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.DataContracts.Invoicing;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
[Serializable]
|
||||
public class MokMandator
|
||||
{
|
||||
//public long BeWoClientType { get; set; }
|
||||
//public string ClientId { get; set; }
|
||||
//public string Country { get; set; }
|
||||
//public long? MandatorOid { get; set; }
|
||||
//public long? MandatorVersion { get; set; }
|
||||
//public string Name { get; set; }
|
||||
//public string Website { get; set; }
|
||||
//public string PostalCode { get; set; }
|
||||
public string Settings { get; set; }
|
||||
//public string State { get; set; }
|
||||
//public string Street { get; set; }
|
||||
//public string Town { get; set; }
|
||||
//public string RssFeedUrl { get; set; }
|
||||
//public string SupportToolUrl { get; set; }
|
||||
//public bool IsSchedulerAllowed { get; set; }
|
||||
//public bool IsMedicationAllowed { get; set; }
|
||||
//public bool AllowSbd { get; set; }
|
||||
//public string Apikey { get; set; }
|
||||
//public string IKLeistungserbringer { get; set; }
|
||||
//public bool CanEditIKLeistungserbringer { get; set; }
|
||||
//public string ColorWaitTooLong { get; set; }
|
||||
//public string ColorSendUrbelege { get; set; }
|
||||
//public bool ShowGkvBzEinzel { get; set; }
|
||||
//public bool ShowGkvBzUrbelege { get; set; }
|
||||
}
|
||||
}
|
||||
13
BeWoPlanerMobil/Util/MokSettings.cs
Normal file
13
BeWoPlanerMobil/Util/MokSettings.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using BS.Shared.Core;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
public class MokSettings
|
||||
{
|
||||
public int SupportConceptExpirationLimitInMonths { get; set; }
|
||||
public int AnzTageZeiterfassErfolgt { get; set; }
|
||||
public int MaxDaysEditServiceRecordsAllowed { get; set; }
|
||||
public int ServiceRecordAllowChangeHours { get; set; }
|
||||
public int TimeUntilUILock { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Diagnostics;
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
[DebuggerDisplay("{StartDate} - {EndDate}")]
|
||||
[Serializable]
|
||||
public class NullableDateTimeSpan
|
||||
{
|
||||
public DateTime? StartDate { get; set; }
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using BS.Shared;
|
||||
using System;
|
||||
|
||||
namespace BeWoPlanerMobil.Util.ReportUtils
|
||||
{
|
||||
[Serializable]
|
||||
public class QuittierungsbelegsReportSettings
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int StartDay { get; set; }
|
||||
public int EndDay { get; set; }
|
||||
public long? CustomerOid { get; internal set; }
|
||||
public long? TeamOid { get; internal set; }
|
||||
public long? EmployeeOid { get; internal set; }
|
||||
public long? OrganisationOid { get; internal set; }
|
||||
public long? ServiceCategoryOid { get; internal set; }
|
||||
public QBFilterEnum FilterEnum { get; internal set; }
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
<div class="container mt-3 lg-max-width">
|
||||
<div class="row mb-3">
|
||||
@if(AbstractModel.IsAllowedToSeeCustomerFilter)
|
||||
@if(Model.IsAllowedToSeeCustomerFilter)
|
||||
{
|
||||
<div class="col-md mb-2">
|
||||
@using(Html.BeginForm("SetCustomerFilter", "Customer", FormMethod.Post))
|
||||
@@ -188,7 +188,7 @@
|
||||
<div class="card-body py-0">
|
||||
@using(Html.BeginForm("UpdateCustomer", "Customer", FormMethod.Post, new { id = "stammdaten-form", @class = "needs-validation", novalidate = "novalidate" }))
|
||||
{
|
||||
var inputDisabled = !AbstractModel.HasRightToEditCustomers ? "disabled" : string.Empty;
|
||||
var inputDisabled = !Model.HasRightToEditCustomers ? "disabled" : string.Empty;
|
||||
|
||||
<div class="row" id="stammdaten-container">
|
||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-3 mt-2 px-1">
|
||||
@@ -519,7 +519,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightToEditCustomers)
|
||||
@if(Model.HasRightToEditCustomers)
|
||||
{
|
||||
<div class="col-12 mb-2 px-1 mt-2">
|
||||
<button type="submit" class="btn btn-primary float-right w-100 m-0" onclick="showSpinner()">Speichern</button>
|
||||
@@ -808,7 +808,7 @@
|
||||
}
|
||||
|
||||
@* ----- Dokumente ----- *@
|
||||
if(AbstractModel.HasRightToViewCustomerDocuments)
|
||||
if(Model.HasRightToViewCustomerDocuments)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100 my-1">
|
||||
@@ -832,11 +832,10 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@* ----- Medikamentenliste ----- *@
|
||||
if(AbstractModel.IsAllowedToSeeMedikamentenliste && Model.SelectedCustomer.Medikamentenverordnungslisten.Any())
|
||||
{
|
||||
if (Model.IsAllowedToSeeMedikamentenliste && Model.SelectedCustomer.Medikamentenverordnungslisten.Any())
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100 my-1">
|
||||
<div class="card-header" onclick="cardHeaderClick2(this)">
|
||||
@@ -859,7 +858,7 @@
|
||||
}
|
||||
|
||||
@* ----- Diagnosen ----- *@
|
||||
if(AbstractModel.HasRightToViewDiagnosen && (Model.SelectedJsonCustomer.HasDiagnosen || Model.SelectedJsonCustomer.HasDisabilities || Model.SelectedJsonCustomer.HasSchwebi))
|
||||
if(Model.HasRightToViewDiagnosen && (Model.SelectedJsonCustomer.HasDiagnosen || Model.SelectedJsonCustomer.HasDisabilities || Model.SelectedJsonCustomer.HasSchwebi))
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100 my-1">
|
||||
@@ -989,9 +988,9 @@
|
||||
}
|
||||
|
||||
|
||||
var isRelatedCustomer = Model.SelectedCustomerOid.HasValue && Model.Employee.RelatedCustomers.Any(cer => cer.Customer.CustomerOid.Equals(Model.SelectedCustomerOid.Value));
|
||||
var isRelatedCustomer = Model.SelectedCustomerOid.HasValue && Model.LoggedInEmployee.RelatedCustomers.Any(cer => cer.Customer.CustomerOid.Equals(Model.SelectedCustomerOid.Value));
|
||||
|
||||
var isAllowedToViewBargeldkassen = AbstractModel.HasRightToViewAllCustomersBargeldkassen || (isRelatedCustomer && AbstractModel.HasRightToViewOwnCustomersBargeldkassen);
|
||||
var isAllowedToViewBargeldkassen = Model.HasRightToViewAllCustomersBargeldkassen || (isRelatedCustomer && Model.HasRightToViewOwnCustomersBargeldkassen);
|
||||
|
||||
|
||||
@* ----- Bargeldverwaltung ----- *@
|
||||
@@ -1021,7 +1020,7 @@
|
||||
}
|
||||
|
||||
@* ----- Abwesenheiten ----- *@
|
||||
if(AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
if(Model.HasRightToViewCustomerAbsenceTimes)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100 my-1">
|
||||
@@ -1054,7 +1053,7 @@
|
||||
var hasRelatedEmployees = Model.SelectedCustomer?.RelatedEmployees.Any() ?? false;
|
||||
var hasRelatedTeams = Model.SelectedCustomer?.RelatedTeams.Any() ?? false;
|
||||
|
||||
if(AbstractModel.HasRightToViewBetreuung && (hasRelatedEmployees || hasRelatedTeams))
|
||||
if(Model.HasRightToViewBetreuung && (hasRelatedEmployees || hasRelatedTeams))
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100 my-1">
|
||||
@@ -1081,7 +1080,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
@if(Model.HasRightToViewCustomerAbsenceTimes)
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="customer-absence-times-form-popup">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
const selectedOption = $("#absence-reason-select option:selected");
|
||||
|
||||
if(!isInfinite && end.getTime() < start.getTime()) {
|
||||
validationMessage = "Das Enddatum muss vor dem Startdatum liegen.";
|
||||
validationMessage = "Das Startdatum muss vor dem Enddatum liegen.";
|
||||
}
|
||||
|
||||
if(selectedOption.val() === "-1") {
|
||||
@@ -221,7 +221,7 @@
|
||||
Kategorie
|
||||
</div>
|
||||
</div>
|
||||
@Html.DropDownListFor(m => m.SelectedAbsenceReason, Model.AbsenceReasonItems, new { @class = "custom-select", Id = "absence-reason-select", Name = "customer-absence-time-category" })
|
||||
@Html.DropDownListFor(m => m.SelectedAbsenceReasonOid, Model.AbsenceReasonItems, new { @class = "custom-select", Id = "absence-reason-select", Name = "customer-absence-time-category" })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -665,7 +665,7 @@
|
||||
<input type="hidden" id="bk-to-delete-oid" name="bk-to-delete-oid" />
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToCreateCustomerBargeldkassen || AbstractModel.HasRightToEditCustomerBargeldkassen)
|
||||
@if(Model.HasRightToCreateCustomerBargeldkassen || Model.HasRightToEditCustomerBargeldkassen)
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="customer-bargeldkassen-form-popup">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(AbstractModel.UserMessage != null)
|
||||
@*@if(AbstractModel.UserMessage != null)
|
||||
{
|
||||
<div class="alert alert-danger mx-3" role="alert">
|
||||
@AbstractModel.UserMessage;
|
||||
</div>
|
||||
|
||||
AbstractModel.UserMessage = null;
|
||||
}
|
||||
}*@
|
||||
|
||||
@using(Html.BeginForm("Index", "Login", FormMethod.Post, new { @class = "px-3 col-12", id = "loginForm" }))
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
@if(AbstractModel.HasRightToRateGoals)
|
||||
@if(Model.HasRightToRateGoals)
|
||||
{
|
||||
<ul class="list-group">
|
||||
@foreach(var ratingType in Model.GoalRatingTypes)
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
<div class="custom-control custom-checkbox goal-card-header float-left" onclick="stopToggle(event)" >
|
||||
<input type="checkbox" class="custom-control-input goal-input" value="@goalTreeItem.ValueListEntryOid" @isCheckedValue id="goal-cb-@goalTreeItem.ValueListEntryOid" onchange="updateSelectedGoals()" />
|
||||
<label class="custom-control-label goal-name-label @textClass" for="goal-cb-@goalTreeItem.ValueListEntryOid">@goalTreeItem.Header</label>
|
||||
@if(AbstractModel.HasRightToRateGoals)
|
||||
@if(Model.HasRightToRateGoals)
|
||||
{
|
||||
<span style="cursor: pointer;" id="goal-rating-@goalTreeItem.ValueListEntryOid" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
|
||||
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
|
||||
@@ -194,7 +194,7 @@
|
||||
<div class="custom-control custom-checkbox goal-text @marginBottom">
|
||||
<input type="checkbox" class="custom-control-input goal-input" id="goal-cb-@goalTreeItem.ValueListEntryOid" @isCheckedValue onchange="updateSelectedGoals()">
|
||||
<label for="goal-cb-@goalTreeItem.ValueListEntryOid" class="custom-control-label goal-name-label @textClass">@goalTreeItem.Header</label>
|
||||
@if(AbstractModel.HasRightToRateGoals)
|
||||
@if(Model.HasRightToRateGoals)
|
||||
{
|
||||
<span id="goal-rating-@goalTreeItem.ValueListEntryOid" style="cursor: pointer;" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
|
||||
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
|
||||
|
||||
@@ -53,11 +53,9 @@
|
||||
$("#groupbooking-selection-container").load("@Url.Action("ReloadGroupBookingForm")", function () {
|
||||
toggleForm();
|
||||
|
||||
$("#goals-tree").load("@Url.Action("ReloadGoals")", function () {
|
||||
$("#goal-ratings-container").load("@Url.Action("ReloadGoalRatings")", function() {
|
||||
$("#goals-tree").load("@Url.Action("ReloadGoals")", function() {
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -66,18 +64,14 @@
|
||||
$(`#cb2sc-checkbox-${relOid}`).prop("checked", false);
|
||||
|
||||
$("#groupbooking-selection-container").load("@Url.Action("RemoveSupportConceptCostbearerRel")", {relOid: relOid}
|
||||
, function () {
|
||||
$("#goals-tree").load("@Url.Action("ReloadGoals")"
|
||||
, function () {
|
||||
$("#goal-ratings-container").load("@Url.Action("ReloadGoalRatings")", function() {
|
||||
toggleForm();
|
||||
, function () {
|
||||
$("#goals-tree").load("@Url.Action("ReloadGoals")"
|
||||
, function () {
|
||||
toggleForm();
|
||||
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
$("#tree").load("@Url.Action("LoadUpToDateTextModules")");
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -133,7 +127,7 @@
|
||||
}
|
||||
|
||||
@* ----- Betrag ----- *@
|
||||
@if(AbstractModel.ShowBetrag)
|
||||
@if(Model.ShowBetrag)
|
||||
{
|
||||
var betrag = string.Empty;
|
||||
if(Model.SelectedServiceRecord?.Betrag != null && Model.SelectedServiceRecord.Betrag.Value > 0)
|
||||
@@ -268,7 +262,7 @@
|
||||
</div>
|
||||
|
||||
@* Gefahrene Kilometer *@
|
||||
@if(AbstractModel.ShowDistanceField)
|
||||
@if(Model.ShowDistanceField)
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
@@ -285,7 +279,7 @@
|
||||
}
|
||||
|
||||
@* Textbausteine *@
|
||||
@if(AbstractModel.HasRightToSeeTextModules)
|
||||
@if(Model.HasRightToSeeTextModules)
|
||||
{
|
||||
<div class="form-row" id="textmodule-container">
|
||||
<div class="col-md">
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
@{
|
||||
var timeSpanColorClass2 = cb2Sc.IsAboutToExpire ? "text-bewo-is-about-to-expire" : cb2Sc.ExpiresInThreeMonthsOrLess ? "text-bewo-expires-in-three-months" : "text-dark";
|
||||
|
||||
var wasSuccessful = long.TryParse(cb2Sc.CostBearer2SupportConceptOid, out var cb2ScOid);
|
||||
|
||||
var checkedValue = wasSuccessful ? Model.SelectedConceptCostBearerRelations.Any(a => a.CostBearer2SupportConceptOid.Equals(cb2ScOid)) : wasSuccessful;
|
||||
var checkedValue = Model.SelectedConceptCostBearerRelations.Any(a => a.CostBearer2SupportConceptOid == cb2Sc.CostBearer2SupportConceptOid);
|
||||
|
||||
}
|
||||
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
|
||||
@@ -209,13 +209,13 @@
|
||||
@{
|
||||
var shouldShowSignaturePopup = TempData[TempDataConstants.ShowSignatureSuggestionPopup]?.GetType() == typeof(bool) && (bool) TempData[TempDataConstants.ShowSignatureSuggestionPopup];
|
||||
|
||||
if(Model.ServiceRecordOid > 0)
|
||||
if(Model.LastCreatedServiceRecordOid > 0)
|
||||
{
|
||||
if(shouldShowSignaturePopup && Model.ShowSignature)
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithCallback("Erfolgreich gespeichert", "Möchten Sie den Eintrag unterschreiben lassen?", function() {
|
||||
initializeSignature(@Model.ServiceRecordOid);
|
||||
initializeSignature(@Model.LastCreatedServiceRecordOid);
|
||||
}, false);
|
||||
</text>
|
||||
}
|
||||
@@ -356,7 +356,7 @@
|
||||
|
||||
<div class="container mt-3 lg-max-width" id="checkbox-container">
|
||||
<div class="row">
|
||||
@if(AbstractModel.IsAllowedToSeeSupportConceptFilter)
|
||||
@if(Model.IsAllowedToSeeSupportConceptFilter)
|
||||
{
|
||||
<div class="col-md">
|
||||
@using(Html.BeginForm("SetSupportConceptFilter", "Main", FormMethod.Post))
|
||||
@@ -376,7 +376,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightForGroupBookings)
|
||||
@if(Model.HasRightForGroupBookings)
|
||||
{
|
||||
<div class="col-md pt-1">
|
||||
@using(Html.BeginForm("SetGroupBookingMode", "Main", FormMethod.Post))
|
||||
@@ -389,7 +389,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightForMultiBooking)
|
||||
@if(Model.HasRightForMultiBooking)
|
||||
{
|
||||
<div class="col-md pt-1">
|
||||
@using(Html.BeginForm("SetMultiBookingMode", "Main", FormMethod.Post))
|
||||
@@ -578,7 +578,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Bewertungspopup für Ziele ----- *@
|
||||
@if(AbstractModel.HasRightToRateGoals)
|
||||
@if(Model.HasRightToRateGoals)
|
||||
{
|
||||
<div id="goal-rating-popup" class="modal" tabindex="-1" role="dialog" style="z-index: 9999 !important">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
|
||||
@* ----- Betrag ----- *@
|
||||
@if(AbstractModel.ShowBetrag)
|
||||
@if(Model.ShowBetrag)
|
||||
{
|
||||
<div class="form-row mt-2">
|
||||
<div class="col-md">
|
||||
@@ -221,7 +221,7 @@
|
||||
</div>
|
||||
|
||||
@* Gefahrene Kilometer *@
|
||||
@if(AbstractModel.ShowDistanceField)
|
||||
@if(Model.ShowDistanceField)
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
@@ -240,7 +240,7 @@
|
||||
}
|
||||
|
||||
@* Textbausteinebutton *@
|
||||
@if(AbstractModel.HasRightToSeeTextModules)
|
||||
@if(Model.HasRightToSeeTextModules)
|
||||
{
|
||||
<div class="form-row" id="textmodule-container">
|
||||
<div class="col-md">
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
<button type="button" data-toggle="modal" class="btn btn-outline-primary" onclick="getSignatureImage(@serviceRecord.ServiceRecordOid.Value, @serviceRecord.SignatureOid.Value)">
|
||||
<span class="fas fa-file-contract"></span>
|
||||
</button>
|
||||
if(AbstractModel.HasRightToDeleteReceiptSignatures)
|
||||
if(Model.HasRightToDeleteReceiptSignatures)
|
||||
{
|
||||
<button type="button" class="btn btn-outline-danger" onclick="deleteSigntarue(@serviceRecord.SignatureOid.Value, @serviceRecord.ServiceRecordOid.Value, '@serviceRecord.Customer', '@MainModel.GetServiceRecordTimeHeader(serviceRecord, false)')">
|
||||
<i class="fas fa-file-contract"></i>
|
||||
@@ -341,7 +341,7 @@
|
||||
</tr>
|
||||
|
||||
@* Gefahrene Kilometer *@
|
||||
@if(AbstractModel.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0)
|
||||
@if(Model.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">
|
||||
@@ -412,7 +412,7 @@
|
||||
</tr>
|
||||
|
||||
@* Angelegt von & angelegt am *@
|
||||
@if(AbstractModel.ShowServiceRecordInsertedOn)
|
||||
@if(Model.ShowServiceRecordInsertedOn)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">
|
||||
@@ -433,7 +433,7 @@
|
||||
}
|
||||
|
||||
@* Betrag *@
|
||||
@if(AbstractModel.ShowBetrag && serviceRecord.Betrag.HasValue && serviceRecord.Betrag.Value > 0)
|
||||
@if(Model.ShowBetrag && serviceRecord.Betrag.HasValue && serviceRecord.Betrag.Value > 0)
|
||||
{
|
||||
var betrag = serviceRecord.Betrag.Value.ToString("#.00") + " €";
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
});
|
||||
|
||||
@{
|
||||
if(Model.SelectedSupportConcept != null || Model.CostBearer2SupportConceptOid == -2)
|
||||
if(Model.SelectedSupportConcept != null || Model.SelectedCostBearerSupportConceptOid == -2)
|
||||
{
|
||||
<text>
|
||||
initializeIntervalSelection();
|
||||
@@ -163,7 +163,7 @@
|
||||
? "text-bewo-expires-in-three-months"
|
||||
: "text-light";
|
||||
|
||||
var isFormDisabled = Model.SelectedCostBearerSupportConceptRelOid.HasValue ? string.Empty : "disabled";
|
||||
var isFormDisabled = Model.SelectedCostBearerSupportConceptOid.HasValue ? string.Empty : "disabled";
|
||||
|
||||
<div>
|
||||
<div class="container p-0">
|
||||
@@ -174,7 +174,7 @@
|
||||
<div class="d-flex">
|
||||
<h5 class="mb-1 text-light text-left" id="selectedSupportConceptCustomerInfo">@Model.SelectedCostBearer2SupportConceptRelListObject.NameAndDateOfBirth</h5>
|
||||
</div>
|
||||
@if(Model.SelectedCostBearerSupportConceptRelOid > 0)
|
||||
@if(Model.SelectedCostBearerSupportConceptOid > 0)
|
||||
{
|
||||
<div class="dropdown-divider my-0 py-0"></div>
|
||||
}
|
||||
@@ -184,7 +184,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.CostBearer2SupportConceptOid != null && Model.CostBearer2SupportConceptOid > 0)
|
||||
@if (Model.SelectedCostBearerSupportConceptOid != null && Model.SelectedCostBearerSupportConceptOid > 0)
|
||||
{
|
||||
<div class="col-md-auto mt-3">
|
||||
<button type="button" class="btn btn-outline-primary w-100 h-100" id="statistics-button" data-toggle="modal" data-target="#statistics-popup" onclick="showPieChart()">
|
||||
@@ -307,7 +307,7 @@
|
||||
}
|
||||
|
||||
@* ----- Betrag ----- *@
|
||||
@if(AbstractModel.ShowBetrag)
|
||||
@if(Model.ShowBetrag)
|
||||
{
|
||||
var betrag = string.Empty;
|
||||
if(Model.SelectedServiceRecord?.Betrag != null && Model.SelectedServiceRecord.Betrag.Value > 0)
|
||||
@@ -429,7 +429,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Einzelbuchung: Distanz ----- *@
|
||||
@if(AbstractModel.ShowDistanceField)
|
||||
@if(Model.ShowDistanceField)
|
||||
{
|
||||
<div class="form-row mt-2">
|
||||
<div class="col-md">
|
||||
@@ -448,7 +448,7 @@
|
||||
}
|
||||
|
||||
@* ----- Einzelbuchung: Textbausteine ----- *@
|
||||
@if(AbstractModel.HasRightToSeeTextModules)
|
||||
@if(Model.HasRightToSeeTextModules)
|
||||
{
|
||||
<script type="text/javascript">
|
||||
function textModuleButtonOnClick() {
|
||||
@@ -543,11 +543,16 @@
|
||||
<div class="col col-12 col-md-7">
|
||||
@if(Model != null)
|
||||
{
|
||||
if(Model.SelectedSupportConcept != null || Model.CostBearer2SupportConceptOid == -2)
|
||||
if(Model.SelectedSupportConcept != null || Model.SelectedCostBearerSupportConceptOid == -2)
|
||||
{
|
||||
var defaultStartDate = DateTime.Now.GetFirstOfMonth().ToShortDateString();
|
||||
var defaultEndDate = DateTime.Today.ToShortDateString();
|
||||
|
||||
if (Model.SelectedZeitraum != null && Model.SelectedZeitraum.StartDate.HasValue && Model.SelectedZeitraum.EndDate.HasValue)
|
||||
{
|
||||
defaultStartDate = Model.SelectedZeitraum.StartDate.Value.ToShortDateString();
|
||||
defaultEndDate = Model.SelectedZeitraum.EndDate.Value.ToShortDateString();
|
||||
}
|
||||
<div class="container-fluid w-100 mt-3 p-0">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
@durationStr
|
||||
</td>
|
||||
</tr>
|
||||
@if(AbstractModel.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0)
|
||||
@if(Model.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">
|
||||
@@ -358,7 +358,7 @@
|
||||
@serviceRecord.Employee.FirstNameLastName
|
||||
</td>
|
||||
</tr>
|
||||
@if(AbstractModel.ShowServiceRecordInsertedOn)
|
||||
@if(Model.ShowServiceRecordInsertedOn)
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">
|
||||
@@ -377,7 +377,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if(AbstractModel.ShowBetrag && serviceRecord.Betrag.HasValue && serviceRecord.Betrag.Value > 0)
|
||||
@if(Model.ShowBetrag && serviceRecord.Betrag.HasValue && serviceRecord.Betrag.Value > 0)
|
||||
{
|
||||
var betrag = serviceRecord.Betrag.Value.ToString("#.00") + " €";
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
@if(Model.QuittierungsbelegsReport != null)
|
||||
{
|
||||
@Html.DevExpress().WebDocumentViewer(settings =>
|
||||
{
|
||||
@@ -36,5 +36,5 @@
|
||||
settings.SettingsMobile.ReaderMode = true;
|
||||
settings.SettingsMobile.AnimationEnabled = false;
|
||||
settings.ClientSideEvents.Init = "quittierungsbelegsViewerInit";
|
||||
}).Bind(Model.QuittierungsbelegsReportObject).GetHtml()
|
||||
}).Bind(Model.QuittierungsbelegsReport).GetHtml()
|
||||
}
|
||||
@@ -259,13 +259,13 @@
|
||||
var canCustomerSign = customerSignatureState != SignatureState.All;
|
||||
var canEmployeeSign = employeeSignatureState != SignatureState.All && employeeSignatureState != SignatureState.AllOwnServiceRecords; // || (employeeSignatureState != SignatureState.AllOwnServiceRecords);
|
||||
|
||||
var employeeName = Model.Employee.ToString();
|
||||
var employeeName = Model.LoggedInEmployee.ToString();
|
||||
|
||||
var overwrite_ssp = (employeeSignatureState == SignatureState.All).ToString().ToLower();
|
||||
var cardBodyId_ssp = $"#collapse-result-{result.Identifier}";
|
||||
var timeSpan_ssp = Model.ConfirmationReceiptObject.TimeSpanString;
|
||||
|
||||
var hasNoOwnEntries = !AbstractModel.HasRightToProvideEmployeeSignatureForOthers && result.Items.All(item => !item.EmployeeOid.Equals(Model.Employee.EmployeeOid));
|
||||
var hasNoOwnEntries = !Model.HasRightToProvideEmployeeSignatureForOthers && result.Items.All(item => !item.EmployeeOid.Equals(Model.LoggedInEmployee.EmployeeOid));
|
||||
var disabledString = hasNoOwnEntries ? "disabled" : string.Empty;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
<div class="btn-toolbar">
|
||||
<!-- w-auto -->
|
||||
<div class="btn-group pr-1" role="group" style="width: 150px !important;">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.CustomerSignatureOids.Any())
|
||||
@if(Model.HasRightToDeleteReceiptSignatures && result.CustomerSignatureOids.Any())
|
||||
{
|
||||
<button class="btn btn-danger mx-0" type="button" onclick="deleteCustomerSignatures('#collapse-result-@result.Identifier', '@result.Identifier', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
@@ -316,7 +316,7 @@
|
||||
</div>
|
||||
<!-- w-auto -->
|
||||
<div class="btn-group" role="group" style="width: 150px !important;">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.EmployeeSignatureOids.Any())
|
||||
@if(Model.HasRightToDeleteReceiptSignatures && result.EmployeeSignatureOids.Any())
|
||||
{
|
||||
<button class="btn btn-danger mx-0" type="button" onclick="deleteEmployeeSignature('#collapse-result-@result.Identifier', '@result.Identifier', '@employeeName', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
@@ -331,7 +331,7 @@
|
||||
<i class="fas fa-slash fa-stack-1x mx-0 px-0" style="color: tomato;"></i>
|
||||
</span>
|
||||
}
|
||||
else if(employeeSignatureState == SignatureState.AllOwnServiceRecords && !AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
else if(employeeSignatureState == SignatureState.AllOwnServiceRecords && !Model.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
<span class="fas fa-ban" style="color: tomato;"></span>
|
||||
}
|
||||
@@ -351,7 +351,7 @@
|
||||
<div class="container-fluid">
|
||||
@foreach(var item in result.Items)
|
||||
{
|
||||
var isNotOwnEntry = !AbstractModel.HasRightToProvideEmployeeSignatureForOthers && !item.EmployeeOid.Equals(Model.Employee.EmployeeOid);
|
||||
var isNotOwnEntry = !Model.HasRightToProvideEmployeeSignatureForOthers && !item.EmployeeOid.Equals(Model.LoggedInEmployee.EmployeeOid);
|
||||
|
||||
var headerTextColorClass = isNotOwnEntry ? "text-secondary" : "text-primary";
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
$("#test-div3").addClass("d-block");
|
||||
}
|
||||
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
@if(Model.QuittierungsbelegsReportSettings != null)
|
||||
{
|
||||
<text>
|
||||
const windowHeight = $(window).height() * .8;
|
||||
@@ -262,7 +262,7 @@
|
||||
const month = $("#month-select option:selected").val();
|
||||
const year = $("#year-select option:selected").val();
|
||||
|
||||
@if(AbstractModel.ShowDifferentQBInterval)
|
||||
@if(Model.ShowDifferentQBInterval)
|
||||
{
|
||||
<text>
|
||||
const interval = $("#qb-interval-selection option:selected").val();
|
||||
@@ -366,7 +366,7 @@
|
||||
|
||||
<div class="mt-3">
|
||||
<div class="form-row">
|
||||
@if(AbstractModel.ShowDifferentQBInterval)
|
||||
@if(Model.ShowDifferentQBInterval)
|
||||
{
|
||||
<div class="input-group">
|
||||
@Html.DropDownListFor(m => m.SelectedIntervalSelection, Model.IntervalSelections, new { id = "qb-interval-selection", onchange = "checkForExistingSignature()", @class = "custom-select" })
|
||||
@@ -440,7 +440,7 @@
|
||||
<span class="fas fa-question"></span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary float-right" id="create-button" onclick="createServiceOverview()">Erstellen</button>
|
||||
<button type="button" class="btn btn-primary float-right" id="create-button" onclick="createServiceOverview()">Einträge anzeigen</button>
|
||||
|
||||
@using(Html.BeginForm("LoadQuittierungsbeleg", "Report", FormMethod.Post, new { id = "load-report-form" }))
|
||||
{
|
||||
@@ -595,12 +595,12 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="qb-container">
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
@if (Model.QuittierungsbelegsReportSettings != null)
|
||||
{
|
||||
@Html.Partial("QuittierungsbelegsPreviewPartial", Model)
|
||||
Html.RenderAction("CreateQuittierungsbelegsReport");
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Popup des Quittierungsbelegsdokuments -->
|
||||
@@ -145,10 +145,10 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(Model.SelectedReportType == ReportType.Mitarbeiterstundenkonto && AbstractModel.HasRightToViewMitarbeiterstundenkonto)
|
||||
@if(Model.SelectedReportType == ReportType.Mitarbeiterstundenkonto && Model.HasRightToViewMitarbeiterstundenkonto)
|
||||
{
|
||||
<div id="report-form-container">
|
||||
@if(AbstractModel.HasRightMitarbeiterstundenkontoViewAll || AbstractModel.HasRightMitarbeiterstundenkontoViewTeams)
|
||||
@if(Model.HasRightMitarbeiterstundenkontoViewAll || Model.HasRightMitarbeiterstundenkontoViewTeams)
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
@@ -169,7 +169,7 @@
|
||||
}
|
||||
|
||||
<div id="msk-employee-form">
|
||||
@if(AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
@if(Model.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col mb-2">
|
||||
@@ -186,7 +186,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(AbstractModel.HasRightMitarbeiterstundenkontoViewAll || AbstractModel.HasRightMitarbeiterstundenkontoViewTeams)
|
||||
@if(Model.HasRightMitarbeiterstundenkontoViewAll || Model.HasRightMitarbeiterstundenkontoViewTeams)
|
||||
{
|
||||
<div id="msk-team-form">
|
||||
<div class="form-row">
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
@if(Model.HasResourcesEmployeesOrCustomers)
|
||||
{
|
||||
<div class="form-row">
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments && AbstractModel.HasRightToInsertEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments && Model.HasRightToInsertEmployeeAppointments)
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -231,7 +231,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments)
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler && Model.HasRightToInsertCustomerAppointments)
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -239,7 +239,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.HasRightToInsertRessourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -249,13 +249,13 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
if(AbstractModel.HasRightToViewEmployeeAppointments && AbstractModel.HasRightToInsertEmployeeAppointments ||
|
||||
AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments ||
|
||||
AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments)
|
||||
if(Model.HasRightToViewEmployeeAppointments && Model.HasRightToInsertEmployeeAppointments ||
|
||||
Model.HasRightToViewCustomerSelectionInScheduler && Model.HasRightToInsertCustomerAppointments ||
|
||||
Model.HasRightToViewAllResourceAppointments && Model.HasRightToInsertRessourceAppointments)
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments && AbstractModel.HasRightToInsertEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments && Model.HasRightToInsertEmployeeAppointments)
|
||||
{
|
||||
<div id="scheduler-selected-employees-container">
|
||||
@Html.Partial("SchedulerEmployeeSelectionPartial", Model)
|
||||
@@ -265,7 +265,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col mx-0">
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments)
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler && Model.HasRightToInsertCustomerAppointments)
|
||||
{
|
||||
<div id="scheduler-selected-customer-container">
|
||||
@Html.Partial("SchedulerCustomerSelectionPartial", Model)
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col mx-0">
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments)
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.HasRightToInsertRessourceAppointments)
|
||||
{
|
||||
<div id="scheduler-selected-resources-container">
|
||||
@Html.Partial("SchedulerResourceSelectionPartial", Model)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
validationMessage = "Das Startdatum ist ungültig!";
|
||||
}
|
||||
|
||||
if(end > start) {
|
||||
if(end < start) {
|
||||
if(validationMessage.length === 0) {
|
||||
validationMessage += "Das Enddatum darf nicht vor dem Startdatum liegen!";
|
||||
} else {
|
||||
@@ -192,7 +192,7 @@
|
||||
{
|
||||
<!-- Hinzufügen-Buttons -->
|
||||
<div class="form-row">
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -200,7 +200,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewCustomerAppointments)
|
||||
@if(Model.HasRightToViewCustomerAppointments)
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -208,7 +208,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
{
|
||||
<div class="col-md">
|
||||
<div class="form-group my-1">
|
||||
@@ -219,7 +219,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="form-group my-1">
|
||||
@@ -257,7 +257,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewCustomerAppointments)
|
||||
@if(Model.HasRightToViewCustomerAppointments)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="form-group my-1">
|
||||
@@ -294,7 +294,7 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="form-group my-1">
|
||||
@@ -344,7 +344,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="resources-interval-finder-popup">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -414,7 +414,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments && Model.AllEmployees.Any())
|
||||
@if(Model.HasRightToViewEmployeeAppointments && Model.AllEmployees.Any())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="employees-interval-finder-popup">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -449,7 +449,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightToViewTeams)
|
||||
@if(Model.HasRightToViewTeams)
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" data-toggle="collapse" data-target="#collapsable-teams-selection">
|
||||
@@ -500,7 +500,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewCustomerAppointments && Model.AllCustomers.Any())
|
||||
@if(Model.HasRightToViewCustomerAppointments && Model.AllCustomers.Any())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="customers-interval-finder-popup">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && Model.AllCustomers.Any())
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler && Model.AllCustomers.Any())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="customers-popup2">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -119,7 +119,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid" id="customers-for-filtering-container">
|
||||
@{
|
||||
Html.RenderAction("FetchCustomerFilteringModalBody");
|
||||
Html.RenderPartial("CustomerFilteringModalContentPartial", Model);
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<!-- /Suche -->
|
||||
<!-- Meine Teams -->
|
||||
@if(AbstractModel.HasRightToViewTeams && Model.MyTeams.Any())
|
||||
@if(Model.HasRightToViewTeams && Model.MyTeams.Any())
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="toggleTeamList()">
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
try {
|
||||
$.get('@Url.Action("SelectTeamForFiltering")', { teamOidString: teamOid }).done(function() {
|
||||
updateEmployeeForFilteringPopup();
|
||||
$("#one-day-scheduler-partial-container").load('@Url.Action("FetchAppointments")');
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
@@ -128,7 +129,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments && Model.AllEmployees.Any())
|
||||
@if(Model.HasRightToViewEmployeeAppointments && Model.AllEmployees.Any())
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="employees-popup2">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -142,7 +143,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid" id="employees-for-filtering-container">
|
||||
@{
|
||||
Html.RenderAction("FetchEmployeeFilteringModalBody");
|
||||
Html.RenderPartial("EmployeeFilteringModalContentPartial", Model);
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(AbstractModel.HasRightToViewTeams)
|
||||
@if(Model.HasRightToViewTeams)
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" data-toggle="collapse" data-target="#collapsable-teams-selection">
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
if(Model.HasResourcesEmployeesOrCustomers)
|
||||
{
|
||||
<div class="row justify-content-center m-0 p-0 mt-1">
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
<div class="col-auto d-flex justify-content-center mx-1 px-0">
|
||||
<button type="button" class="btn btn-sm btn-bewo-employee" onclick="openEmployeeForFilteringPopup()">
|
||||
@@ -194,7 +194,7 @@
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler)
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler)
|
||||
{
|
||||
<div class="col-auto d-flex justify-content-center mx-1 px-0">
|
||||
<button type="button" class="btn btn-sm btn-bewo-customers" data-toggle="modal" data-target="#customers-popup2">
|
||||
@@ -202,7 +202,7 @@
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments)
|
||||
@if(Model.HasRightToViewAllResourceAppointments)
|
||||
{
|
||||
<div class="col-auto d-flex justify-content-center mx-1 px-0">
|
||||
<button type="button" class="btn btn-sm btn-bewo-resource" data-toggle="modal" data-target="#resources-popup2">
|
||||
@@ -269,7 +269,7 @@
|
||||
|
||||
|
||||
<!-- Filterauswahl: -->
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments)
|
||||
@if(Model.HasRightToViewAllResourceAppointments)
|
||||
{
|
||||
<div class="modal" tabindex="-1" role="dialog" id="resources-popup2">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
@@ -339,28 +339,28 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
Html.RenderAction("FetchSelectedEmployeesForPopup", Model);
|
||||
Html.RenderPartial("EmployeeForFilteringPartial", Model);
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler)
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler)
|
||||
{
|
||||
Html.RenderAction("FetchCustomersForFiltering", Model);
|
||||
Html.RenderPartial("CustomerFilterSelectionPartial", Model);
|
||||
}
|
||||
<!-- /Filterauswahl -->
|
||||
|
||||
@if(AbstractModel.HasRightToViewEmployeeAppointments)
|
||||
@if(Model.HasRightToViewEmployeeAppointments)
|
||||
{
|
||||
Html.RenderPartial("EmployeeSelectionPopupPartial", Model);
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewCustomerSelectionInScheduler && AbstractModel.HasRightToInsertCustomerAppointments)
|
||||
@if(Model.HasRightToViewCustomerSelectionInScheduler && Model.HasRightToInsertCustomerAppointments)
|
||||
{
|
||||
Html.RenderPartial("CustomerSelectionPopupPartial", Model);
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && AbstractModel.HasRightToInsertRessourceAppointments)
|
||||
@if(Model.HasRightToViewAllResourceAppointments && Model.HasRightToInsertRessourceAppointments)
|
||||
{
|
||||
Html.RenderPartial("ResourceSelectionPopupPartial", Model);
|
||||
}
|
||||
@@ -439,7 +439,7 @@
|
||||
@* Eingabenwiederherstellung *@
|
||||
|
||||
function getLocalStorageKey() {
|
||||
return "@AbstractModel.LocalStorageKey";
|
||||
return "@MobileSessionFacade.LocalStorageKey";
|
||||
}
|
||||
|
||||
function getBeWoStorage() {
|
||||
@@ -566,7 +566,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if(AbstractModel.IsAllowedToSeeCustomers)
|
||||
@if(Model.IsAllowedToSeeCustomers)
|
||||
{
|
||||
using(Html.BeginForm("RedirectToCustomer", "Main", FormMethod.Post))
|
||||
{
|
||||
@@ -589,7 +589,7 @@
|
||||
</li>
|
||||
}
|
||||
|
||||
@if(AbstractModel.IsAllowedToSeeScheduler)
|
||||
@if(Model.IsAllowedToSeeScheduler)
|
||||
{
|
||||
using(Html.BeginForm("RedirectToScheduler", "Main", FormMethod.Post))
|
||||
{
|
||||
@@ -603,7 +603,7 @@
|
||||
}
|
||||
|
||||
|
||||
@if(AbstractModel.HasRightToViewQuittierungsbelege)
|
||||
@if(Model.HasRightToViewQuittierungsbelege)
|
||||
{
|
||||
using(Html.BeginForm("RedirectToReportView", "Main", FormMethod.Post))
|
||||
{
|
||||
@@ -618,7 +618,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if(AbstractModel.HasRightToViewReports && AbstractModel.HasRightToViewMitarbeiterstundenkonto)
|
||||
@if(Model.HasRightToViewReports && Model.HasRightToViewMitarbeiterstundenkonto)
|
||||
{
|
||||
using(Html.BeginForm("RedirectToReportViewer", "Main", FormMethod.Post))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user