using BeWoPlanerMobil.Service; using BS.Shared; using BS.Shared.DataContracts; namespace BeWoPlanerMobil.Models { public class AbstractModel { public static bool IsDeleteBtnVisible => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecordView_Delete); public static bool IsAllowedToSeeScheduler => MobileSessionFacade.LoggedInUser != null && MobileSessionFacade.CheckForUserRight(UserRightType.KalenderAnsehen) || MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll); public static bool IsAllowedToSeeCustomers => MobileSessionFacade.CheckForUserRight(UserRightType.ViewAll) || MobileSessionFacade.CheckForUserRight(UserRightType.CustomerView_View) || MobileSessionFacade.CheckForUserRight(UserRightType.Customer_ViewMyCustomers); public static bool IsEmployeeSelectionVisible => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) || MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember); public static bool HasRightForGroupBookings => MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreatingGroupBooking); 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); public EmployeeDC Employee { get; set; } public string LoggedInEmplyeeFirstNameLastName => Employee != null ? $"{Employee.FirstName} {Employee.LastName}" : "BeWoPlaner"; public static bool HasRightToSeeAllSupportConcepts => MobileSessionFacade.CheckForUserRight(UserRightType.SupportConcept_ViewAllSupportConcepts); 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); public static string TimeOfLastAction { get; set; } public static bool HasRightToInsertRessourceAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderRessourcentermineAnlegen) || MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll); public static bool IsAllowedToSeeBills => MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View); } }