2019-07-25 14:58:13 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
using BeWoPlanerMobil.Service;
|
|
|
|
|
|
|
|
|
|
|
|
using BS.Shared;
|
2020-02-07 15:21:36 +01:00
|
|
|
|
using BS.Shared.DataContracts;
|
2019-07-25 14:58:13 +02:00
|
|
|
|
|
|
|
|
|
|
namespace BeWoPlanerMobil.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class AbstractModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public static bool IsDeleteBtnVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecordView_Delete))); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-07-29 19:40:14 +02:00
|
|
|
|
public static bool IsAllowedToSeeScheduler
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return MobileSessionFacade.LoggedInUser != null && MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(right => right.RightType.Equals(UserRightType.KalenderAnsehen))); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-02 13:19:14 +02:00
|
|
|
|
public static bool IsAllowedToSeeCustomers => MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll) || (MobileSessionFacade.CheckForUserRight(UserRightType.CustomerView_View) || MobileSessionFacade.CheckForUserRight(UserRightType.Customer_ViewMyCustomers));
|
2019-07-25 14:58:13 +02:00
|
|
|
|
|
|
|
|
|
|
public static bool IsEmployeeSelectionVisible => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) || MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember);
|
|
|
|
|
|
|
|
|
|
|
|
public static bool HasRightForGroupBookings => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking);
|
|
|
|
|
|
|
2019-07-29 19:40:14 +02:00
|
|
|
|
public static bool HasRightToSeeAllCustomerAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderKliententermineAlleAnsehen) && MobileSessionFacade.CheckForUserRight(UserRightType.CustomerView_View) || MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll);
|
|
|
|
|
|
public static bool HasRightToSeeAllEmployeeAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderMitarbeitertermineAnsehen) || MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll);
|
|
|
|
|
|
public static bool HasRightToSeeAllResourceAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderRessourcentermineAnsehen) || MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll);
|
2020-02-07 15:21:36 +01:00
|
|
|
|
|
|
|
|
|
|
public EmployeeDC Employee { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string LoggedInEmplyeeFirstNameLastName => Employee != null ? $"{Employee.FirstName} {Employee.LastName}" : "BeWoPlaner";
|
|
|
|
|
|
|
|
|
|
|
|
public static bool HasRightToSeeAllSupportConcepts => MobileSessionFacade.CheckForUserRight(UserRightType.SupportConcept_ViewAllSupportConcepts);
|
2020-04-02 13:19:14 +02:00
|
|
|
|
|
|
|
|
|
|
public static bool HasRightToSeeTextModules => MobileSessionFacade.CheckForUserRight(UserRightType.TextbausteineNurEigeneAnsehen) || MobileSessionFacade.CheckForUserRight(UserRightType.TextbausteineAlleAnsehen);
|
|
|
|
|
|
|
|
|
|
|
|
public static bool HasRightToSeeServiceRecords => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordView_View) && MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordView_Create);
|
2019-07-25 14:58:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|