using System;

namespace BS.Shared
{
    public enum TableID
    {
        Unknown                                   = 0,
        Person                                    = 1,
        Employee                                  = 2,
        ValueListEntry2Object                     = 3,
        ValueListEntry                            = 4,
        Address                                   = 5,
        Contact                                   = 6,
        BankAccount                               = 7,
        Customer                                  = 8,
        Employee2Customer                         = 9,
        Customer2Person                           = 10,
        Organisation                              = 11,
        Organisation2Person                       = 12,
        AbsenceReason                             = 13,
        AbsenceTime                               = 14,
        SupportConcept                            = 15,
        SupportConceptAnnotation                  = 16,
        Resource                                  = 17,
        ResourceBooking                           = 18,
        ResourceBookingSequence                   = 19,
        FileAttachment                            = 20,
        AppUserFileAttachmentLock                 = 21,
        CostBearer                                = 22,
        CostBearer2SupportConcept                 = 23,
        Query                                     = 24,
        Parameter                                 = 25,
        AccountingTransaction                     = 26,
        Settings                                  = 27,
        ApplicationUser                           = 28,
        ReportParameter                           = 29,
        Team                                      = 30,
        Customer2CostBearer                       = 31,
        Mail                                      = 32,
        Mail2Receiver                             = 33,
        FollowUp                                  = 34,
        Login                                     = 35,
        CostRatePeriod                            = 36,
        Diagnosis                                 = 37,
        Diagnosis2Customer                        = 38,
        Timesheet                                 = 39,
        Employee2Team                             = 40,
        InGroup                                   = 41,
        RightRelation                             = 42,
        ServiceCategory                           = 43,
        ServiceDescription                        = 44,
        ServiceRecord                             = 45,
        UserGroup                                 = 46,
        Mandator                                  = 47,
        Placement                                 = 48,
        Invoice                                   = 49,
        InvoiceBase                               = 50,
        InvoiceItem                               = 51,
        SettlementInvoice                         = 52,
        AssessmentSheetValue                      = 53,
        AssessmentSheetCategory                   = 54,
        AssessmentSheetEntry                      = 55,
        VarFieldDef                               = 56,
        VarFieldValue                             = 57,
        Task                                      = 58,
        NewsItem                                  = 59,
        File                                      = 60,
        Folder                                    = 61,
        SupportConceptApprovalPeriod              = 62,
        InvoiceNumber                             = 63,
        ServiceInvoice                            = 64,
        Contract                                  = 65,
        EmploymentType                            = 66,
        AppointmentCategory                       = 67,
        Appointment                               = 68,
        Customer2Organisation                     = 69,
        ServiceAccounting                         = 70,
        GroupOfPeople                             = 71,
        GroupMember                               = 72,
        ServiceRecordHistory                      = 73,
        CustomerHistory                           = 74,
        Customer2PersonHistory                    = 75,
        Customer2OrganisationHistory              = 76,
        Employee2CustomerHistory                  = 77,
        FamilyData                                = 78,
        AdditionalService                         = 79,
        AdditionalServiceRegion                   = 80,
        AdditionalService2GroupOfPeople           = 81,
        AdditionalServiceGroupOfPeople            = 82,
        AdditionalServiceGroupMember              = 83,
        Participation                             = 84,
        TemporaryToken                            = 85,
        AdditionalServiceBooking                  = 86,
        SupportPin                                = 87,
		ResourceAppointment                       = 88,
		Overtime                                  = 89,
		Auszahlungsart                            = 90,
		NewSchedulerAppointment                   = 91,
		MedArt                                    = 92,
		Medikamentenverordnung                    = 93,
		Medikamentenverordnungsliste              = 94,
		Employee2SchedulerAppointment             = 95,
		ResetPasswordInfo                         = 96,
		UiElement                                 = 97,
		BeWoMobilBrowserInfo                      = 98,
		Darreichungsform                          = 99,
		DepotRhythmus                             = 100,
        Textbaustein                              = 101,
		Bargeldtransaktion                        = 102,
        Wohnheim                                  = 103,
        Employee2Wohnheim                         = 104,
        Employee2WohnheimHistory                  = 105,
        Customer2Wohnheim                         = 106,
        Customer2WohnheimHistory                  = 107,
        SignatureTable                            = 108,
        Wohnheimbuchung                           = 109,
        Wohnheimbuchung2Costbearer2SupportConcept = 110,
        Wohnheimbuchung2Employee                  = 111,
        SupportConceptApprovalPeriod2Employee     = 112,
        FinanzDokumente                           = 113,
        Bargeldkasse                              = 114,
        MedRecord                                 = 115
    }

    public enum SystemEntryID
    {
        // LVR Kostenträger
        CostBearerLVR = 0,

        // Vertrauensperson
        PersonConfidant = 1,

        // gesetzliche Vertretung
        PersonRepresentative = 2,

        // Hauptbetreung
        EmployeeRoleMainAttendant = 3,

        CustomerAmbulant = 4,

        CustomerStationary = 5,

        InvoiceNumber = 6,

        // Bereich als Punktebogeneintrag
        AdditionalServiceAssessmentSheet = 7,

        // Verzeichnis für die Word-Vorlagen
        TemplateDirectory = 8
    }

    public enum ControlType
    {
        TextBox        = 0,
        CheckBox       = 1,
        NumericTextBox = 2,
        DatePicker     = 3,
        ComboBox       = 4,
        CheckBoxList   = 5,
        MemoBox        = 6
    }

    public enum ActivationTypeId
    {
        Deleted      = 0,
        Active       = 1,
        Archived     = 2,
        InRecycleBin = 3
    }

    public enum ServiceRecordTypeId
    {
        DefaultActivity           = 0, //Abrechenbare Doku / Leistung
        Content                   = 1, //Inhaltliche Doku, rein beschreibend 
        AdditionalService         = 2,
        AdditionalServiceBillable = 3,
        Wohnheimbuchung           = 4
    }

    public enum GroupTypeId
    {
        ServiceRecordSupportConcepts = 0, //Hilfeplangruppe in der Zeiterfassung
        ServiceRecordEmployees       = 1, //Mitarbeitergruppe in der Zeiterfassung
        SupplementaryServiceCustomer = 2 //Ergänzende Dienste Klientengruppe
    }

    public enum ReportParameterType
    {
        CompanyName
    }

    public enum SettingsType
    {
        HistoryCacheCount,
        OpenedEmployeesHistory,
        OpenedCustomersHistory,
        OpenedSupportConceptsHistory,
        OpenedOrganisationsHistory,
        OpenedPersonsHistory,
        OpenedTeamsHistory,
        OpenedUserGroupsHistory,
        OpenedApplicationUsersHistory,
        ApplicationSettings,
        MinutesToLockUI,
        OpenedWohnheimHistory
    }

    public enum QueryType
    {
        Public,
        Internal,
        Monthly
    }

    public enum QueryParameterType
    {
        SupportConcept, //0
        Employee,
        Customer,
        Month,
        Date,
        DateRange, //5
        Team,
        CostCenter,
        ServiceCategory,
        ServiceDescription,
        Text, //10
        Year,
        CurrentUser,
        CurrentEmployee,
        ValueListEntryType //14
    }

    public enum FileAttachmentType
    {
        NotSpecified,
        SupportConceptDocument,
        CustomerTemplate,
        OrganisationTemplate,
        PersonTemplate,
        SupportConceptTemplate
    }

    public enum CostBearer2SupportConceptStatus
    {
        Created,
        Requested,
        Approved
    }

    public enum ResourceBookingFrequencyType
    {
        Once,
        Daily,
        Weekly,
        Monthly,
        Yearly,
        MonthlyOnFirstDay,
        MonthlyOnLastDay
    }

    public enum UserRightType : long
    {
        None                                                     = 0,
        DeleteAll                                                = 1,
        CreateAll                                                = 2,
        EditAll                                                  = 4,
        ViewAll                                                  = 8,
        ServiceRecordView_View                                   = 16,
        ServiceRecordView_Edit                                   = 32,
        ServiceRecordView_Create                                 = 64,
        ServiceRecordView_Delete                                 = 128,
        AccountingTransactionView_View                           = 256,
        AccountingTransactionView_Edit                           = 512,
        AccountingTransactionView_Create                         = 1024,
        AccountingTransactionView_Delete                         = 2048,
        ResourceBookingView_View                                 = 4096,
        ResourceBookingView_Edit                                 = 8192,
        ResourceBookingView_Create                               = 16384,
        ResourceBookingView_Delete                               = 32768,
        QueryView_View                                           = 65536,
        QueryView_Edit                                           = 131072,
        QueryView_Create                                         = 262144,
        QueryView_Delete                                         = 524288,
        SupportConceptView_View                                  = 1048576,
        SupportConceptView_Edit                                  = 2097152,
        SupportConceptView_Create                                = 4194304,
        SupportConceptView_Delete                                = 8388608,
        CustomerView_View                                        = 16777216,
        CustomerView_Edit                                        = 33554432,
        CustomerView_Create                                      = 67108864,
        CustomerView_Delete                                      = 134217728,
        OrganisationView_View                                    = 268435456,
        OrganisationView_Edit                                    = 536870912,
        OrganisationView_Create                                  = 1073741824,
        OrganisationView_Delete                                  = 2147483648,
        PersonView_View                                          = 4294967296,
        PersonView_Edit                                          = 8589934592,
        PersonView_Create                                        = 17179869184,
        PersonView_Delete                                        = 34359738368,
        EmployeeView_View                                        = 68719476736,
        EmployeeView_Edit                                        = 137438953472,
        EmployeeView_Create                                      = 274877906944,
        EmployeeView_Delete                                      = 549755813888,
        WohnheimView_View                                        = 22201,
        WohnheimView_Edit                                        = 22202,
        WohnheimView_Create                                      = 22203,
        WohnheimView_Delete                                      = 22204,
        Wohnheim_AllowArchiving                                  = 22205,
        TeamView_ViewAll                                         = 1099511627776,
        TeamView_Edit                                            = 2199023255552,
        TeamView_Create                                          = 4398046511104,
        TeamView_Delete                                          = 8796093022208,
        UserView_View                                            = 17592186044416,
        UserView_Edit                                            = 35184372088832,
        UserView_Create                                          = 70368744177664,
        UserView_Delete                                          = 140737488355328,
        UserGroupView_View                                       = 281474976710656,
        UserGroupView_Edit                                       = 562949953421312,
        UserGroupView_Create                                     = 1125899906842624,
        UserGroupView_Delete                                     = 2251799813685248,
        AdministrationView_View                                  = 4503599627370496,
        AdministrationView_Edit                                  = 9007199254740992,
        AdministrationView_Create                                = 18014398509481984,
        AdministrationView_Delete                                = 36028797018963968,
        Employee_ShowFinance                                     = 72057594037927936,
        Analysis_Settlement_View                                 = 144115188075855872,
        Analysis_EmployeeOverviewAll_View                        = 288230376151711744,
        Analysis_ServiceOverview_View                            = 576460752303423488,
        Analysis_SupportConceptOverviewAll_View                  = 1152921504606846976,
        UserView_AllowChangePassword                             = 2305843009213693952,
        OrganisationView_AllowEditCostBearer                     = 4611686018427387904,
        ServiceRecord_AllowChangeWithin24Hours                   = 10000,
        ServiceRecord_AllowCreateServiceRecordsForAllClients     = 10001,
        SupportConcept_ViewAllSupportConcepts                    = 10002,
        SupportConcept_AllowGoalOrientedSupportConcepts          = 10003,
        Customer_ViewMyCustomers                                 = 10004,
        Analysis_AllowFLSOverviewForCostbearer                   = 10005,
        SupportConceptView_AllowArchiving                        = 10006,
        Person_AllowArchiving                                    = 10007,
        Customer_AllowArchiving                                  = 10008,
        ServiceRecord_AllowCreationForOtherEmployees             = 10009,
        ResourceBookingView_AllowEditResourcesFromOtherEmployees = 10010,
        ServiceRecord_AllowEditAfterMaxDaysInNextMonth           = 10011,
        AssessmentSheet_View                                     = 10012,
        AssessmentSheet_Edit                                     = 10013,
        AssessmentSheet_Create                                   = 10014,
        AssessmentSheet_Delete                                   = 10015,
        ServiceRecord_AllowCreateMoreFLSThanApproved             = 10016,

        Analysis_AuslastungAllEmployee_View = 10017,
        Analysis_AuslastungTeam_View = 10018,
        Analysis_Auslastung_View = 10019,
        Analysis_AllowFLSOverviewForTeam = 10020,
        Analysis_AllowFLSOverviewForAllTeams = 10021,

        ServiceRecord_AllowCreateOverlappingFLS = 10022,
        ServiceRecord_AllowCreationForOtherTeamMember = 10023,

		BookServiceRecordOutOfSupportConcept = 10024,
        BookServiceRecordAfterSettlementInvoice = 10025,
		Organisation_AllowArchiving = 10026,

		ServiceRecord_ShowHistory = 10027,

		ServiceRecord_AllowCreateOverlappingFLSForEmployee = 10028,
		ServiceRecord_AllowCreatingGroupBooking = 10029,
		ServiceRecord_AllowCreatingMultiBooking = 10030,
		TeamView_ViewMyTeams = 10031,

        Employee_AllowEditExtendedProperties = 20000,
        Employee_AllowEditContracts = 20001,
        Employee_AllowEditOwnEmployees = 20002,
		Employee_AllowArchiving = 20003,
		User_AllowOrderLicense = 20004,

        GroupOfPeopleView_Edit = 20100,
        GroupOfPeopleView_Create = 20101,
        GroupOfPeopleView_Delete = 20102,

		AdditionalService_View = 20200,
		OvertimeView = 20300,
		//ServiceRecord_AllowCreateIfAbsenceTimeExceeded = 20300,

		Mitarbeiterstundenkonto_ViewSelf = 20400,
		Mitarbeiterstundenkonto_ViewAll = 20401,

		Support_View = 20500,

		SupportConcept_AllowEditGoals = 20600,

		SupportConcept_AllowEditTasks = 20601,

		ServiceRecord_AllowEditForOtherEmployees = 20602,

		KalenderAnsehen                         = 20700,
		KalenderMitarbeitertermineAnsehen       = 20701,
		KalenderMitarbeitertermineAnlegen       = 20702,
		KalenderMitarbeitertermineAendern       = 20703,
		KalenderKliententermineAlleAnsehen      = 20704,
		KalenderKliententermineAnlegen          = 20706,
		KalenderKliententermineAendern          = 20707,
		KalenderRessourcentermineAnsehen        = 20708,
		KalenderRessourcentermineAnlegen        = 20709,
		KalenderRessourcentermineAendern        = 20710,
		KalenderRessourcentermineAndererAendern = 20711,

		AllowChangeOwnPassword = 20800,

        TextbausteineAlleAnsehen         = 20900,
        TextbausteineNurEigeneAnsehen    = 20901,
        TextbausteineAlleBearbeiten      = 20902,
        TextbausteineNurEigeneBearbeiten = 20903,
        //TextbausteineAlleAnlegen         = 20904,
        //TextbausteineNurEigeneAnlegen    = 20905,

		BargeldverwaltungAnsehen          = 21000,
		BargeldverwaltungNurEigeneAnsehen = 21001,
		BargeldverwaltungBearbeiten       = 21002,
		BargeldverwaltungAnlegen          = 21003,
        BargeldverwaltungLoeschen         = 21004,

		SupportConceptAllowReactivation = 21100,
		CustomerAllowReactivation       = 21101,
		OrganisationAllowReactivation   = 21102,
		PersonAllowReactivation         = 21103,

		ServiceRecordAllowRebooking = 22000,

		CostbearerAllowChange       = 22001,
		ServiceRecordAllowEditAfterMindays = 22002,
		DocumentsAllowViewAll		= 22010,
		
		
        Betreuungsschluessel_View   = 23000,
        Betreuungsschluessel_Edit   = 23001,
        Betreuungsschluessel_Delete = 23002,
        Betreuungsschluessel_Create = 23003,

        Jahresbericht               = 24000,
        DokumenteFinanzen           = 25000,
		DokumenteKlienten = 25001,
		DokumenteMitarbeiter = 25002,
		DokumenteOrganisationen = 25003,
		DokumentePersonen = 25004,
		DokumenteHilfeplaene = 25005,
		DokumenteTeams = 25006,

        BargeldverwaltungFinanzenAnsehen    = 26000,
        BargeldverwaltungFinanzenAnlegen    = 26001,
        BargeldverwaltungFinanzenBearbeiten = 26002,
        BargeldverwaltungFinanzenLoeschen   = 26003,

        MedRecordsAnsehen  = 27000,
        MedRecordsAnlegen  = 27001,
        MedRecordsAendern  = 27002,
        MedRecordsLoeschen = 27003,

        ChatSettings = 28000
    }

    public enum PersonType
    {
        Employee = 1,
        Customer = 2,
        Others = 3
    }

    public enum Sex
    {
        Male,
        Female
    }

    public enum FamilyStatus
    {
        Single,
        Married,
        Divorced,
        Widowed,
        Partner,
		PartnerDivorced, //=Separated (Getrennt)
        PartnerDead,
		PartnerMarried,
		Entpartnert

    }

    public enum Pflegegrad {
        Grad1,
        Grad2,
        Grad3,
        Grad4,
        Grad5
    }

    public enum ValueListEntryType
    {
        EmploymentType, //0
        DisabilityType,
        AccountingTransactionType,
        StaffRoleType,
        StaffActivityFocusType,
        StaffQualificationsType, //5
        ResourceCategory,
        EnvironmentPersonType,
        CustomerCareType, //8
        SupportConceptGoalCategoryType,
        SupportConceptGoalType, //10
        TitleType,
        FunctionType,
        PlacementObjectiveType,
        TerminationReasonType,
        PersonCategoryType, //15
        CustomerCategoryType,
        EnvironmentOrganisationType,
        SupportConceptIndividualGoalType,
		Auszahlungsart,
        SupportConceptIndividualGoalCategoryType, // 20
        DocumentType

    }

    public enum ContactType
    {
        private_MobilePhone,
        business_MobilePhone,
        private_Phone,
        business_Phone,
        private_Fax,
        business_Fax,
        private_Mail,
        business_Mail,
        private_Homepage,
        business_Homepage,
        ContactPerson,
        business_POBox,
        private_POBox
    }

    public enum Status
    {
        read,
        unread
    }

    public enum Priority
    {
        high,
        normal,
        low
    }

    public enum CostRatePeriodType
    {
        Unknown               = -1,
        HourlyRate            = 0,
        MinutesIntervall      = 1,
        RateFactor            = 2,
        MinutesPerServiceUnit = 3,
        ServiceTolerance      = 4,
        AmountOfMoney         = 5
    }

    public enum InvoiceType
    {
        CustomerEquity,
        Settlement,
        General,
        Service
    }

    public enum UserValidationResult
    {
        UserUnknown    = 0,
        UserValid      = 1,
        UnkownError    = 2,
        TenantUnknown  = 3,
        IncorrectPin   = 4,
        PinExpired     = 5,
		PinAlreadyUsed = 6,
        PasswordExpired = 7
    }

    public enum SupportConceptApprovalInterval
    {
        Daily,
        Weekly,
        Fortnightly,
        Monthly,
        Quarterly,
        HalfYearly,
        Yearly
    }

    public enum AccountingIntervalType
    {
        Hourly,
        Daily,
        Weekly,
        Fortnightly,
        Monthly,
        Quarterly,
        HalfYearly,
        Yearly,
        FlatRate
    }

    public enum AccountingvisibilityType
    {
        Beides,
        NurKlientenbezogen,
        NichtKlientenbezogen
    }

    public enum ScopeTypeId
    {
        Global,
        Individual
    }

    public enum ServiceUnit
    {
        DateTime,
        Piece
    }

    public enum AppointmentKind
    {
        General,
        ServiceRecord,
        Resource,
        Task,
        Customer,
        Employee,
        SupportConcept,
		CommonCalendar,
		KlientenKalender
    }

    public enum AppointmentViewType
    {
        Day      = 0,
        Week     = 1,
        Month    = 2,
        WorkWeek = 3,
        Timeline = 4
    }

    public enum ServiceRecordTimeInterval
    {
        LastWeek,
        LastMonth,
        Last3Month,
        All, 
		LastNDays
    }


    public static class BeWoEnum
    {
        public static T ByName<T>(string pName)
        {
            return (T)Enum.Parse(typeof(T), pName);
        }
    }

    public enum StatementType
    {
        Insert     = 0,
        Update     = 1,
        Delete     = 2,
        Archived   = 3,
		Reactivate = 4
    }

    public enum AppointmentDayOfWeek
    {
        Montag     = 0,
        Dienstag   = 1,
        Mittwoch   = 2,
        Donnerstag = 3,
        Freitag    = 4,
        Samstag    = 5,
        Sonntag    = 6
    }

    public enum Monat
    {
        Januar    = 1,
        Februar   = 2,
        März      = 3,
        April     = 4,
        Mai       = 5,
        Juni      = 6,
        Juli      = 7,
        August    = 8,
        September = 9,
        Oktober   = 10,
        November  = 11,
        Dezember  = 12
    }

    public enum ServiceRecordValidationResult
    {
        ServiceRecordOverlapping         = 0,
        EmployeeOverlapping              = 1,
        OutsideOfSupportConcept          = 2,
        ApprovedFLSOverspending          = 3,
        OutOfEditLimit                   = 4,
        Error                            = 5,
        SettlementInvoiceAlreadyExisting = 6,
		FristAbgelaufen = 7,
		Custom = 8
    }

    public enum ViewDestination
    {
        Edit    = 0,
        Preview = 1,
        Printer = 2,
        File    = 3,
    }

	public enum CommonCalendarVMType
	{
		Geburtstag  = 0,
		Hilfeplan   = 1,
		Abwesenheit = 2
	}

	public enum KlientenKalenderTyp
	{
		Geburtstag  = 0,
		Hilfeplan   = 1,
		Abwesenheit = 2,
		Termin      = 3
	}

	public enum ParticipationAnswer
	{
		Offen     = 0,
		Zusage    = 1,
		Absage    = 2,
		Vorbehalt = 3
	}

	public enum UiElementType
	{
		Common,
		StartPanel,
		ServiceRecordStatistic
	}

	public enum FLSReportType
	{
		Employee,
		Customer,
		Costbearer,
		Team
	}

	public enum Auszahlungsintervall
	{
		Kein,
		Monatlich,
		Woechentlich,
		Taeglich
	}

	public enum Zahlungstyp
	{
		Einzahlung,
		Auszahlung
	}

	public enum Interval
	{
		Hour,
		HalfHour,
		QuaterHour
	}

	public enum ReportEnum
	{
		KalenderMonatsReportEnum,
		KassenbuchReportEnum,
		ZahlungsbelegEnum
	}

    public enum Behinderungsart
    {
        Blindheit,
        Epilepsie,
        Gehoerlosigkeit,
        GeistigeBehinderung,
        Hoerbehinderung,
        InnereErkrankungen,
        Koerperbehinderung,
        Lernbehinderung,
        PsychischeErkrankungen,
        Sehbehinderung,
        Suchtkrankheiten
    }

    public enum Merkzeichen
    {
        aG,
        H,
        Bl,
        Gl,
        RF,
        Kl1,
        B,
        G
    }

    public enum WohnheimbuchungsintervallTyp
    {
        SupportConcept,
        Employee
    }
}