public AccessControl(Role role, AccessType accessType, AccessSubType accessSubType) { this._role = role; _accessSubType = accessSubType; _accessType = accessType; this.AccessType = accessType; this.AccessSubType = accessSubType; }
public static bool HasSameEntity(Role entity) { EntityModelContainer context = entity.Context; if (context.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified | EntityState.Unchanged) .Select(e => e.Entity).OfType<Role>().Any(x => x.Title == entity.Title && (x != entity))) return true; return false; }
public static bool Validate(Role entity) { if (entity == null || entity.Title == null || entity.Title.Trim().Length == 0) { Methods.ShowStandardMsgBox(FormMessageType.Error, RscError.ValidationTitle, RscError.RoleTitleNull); return false; } return true; }
/// <summary> /// Create a new Role object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="employeeAccess">Initial value of the EmployeeAccess property.</param> /// <param name="drugAccess">Initial value of the DrugAccess property.</param> /// <param name="roleAccess">Initial value of the RoleAccess property.</param> /// <param name="serviceAccess">Initial value of the ServiceAccess property.</param> /// <param name="insuranceAccess">Initial value of the InsuranceAccess property.</param> /// <param name="prescriptionAccess">Initial value of the PrescriptionAccess property.</param> /// <param name="calendarAccess">Initial value of the CalendarAccess property.</param> /// <param name="labratoryAccess">Initial value of the LabratoryAccess property.</param> /// <param name="patientAccess">Initial value of the PatientAccess property.</param> /// <param name="patientDoumentcAccess">Initial value of the PatientDoumentcAccess property.</param> /// <param name="patientHistoryAccess">Initial value of the PatientHistoryAccess property.</param> /// <param name="labratoryOrderAccess">Initial value of the LabratoryOrderAccess property.</param> /// <param name="visitAccess">Initial value of the VisitAccess property.</param> /// <param name="updateAccess">Initial value of the UpdateAccess property.</param> /// <param name="networkSettingAccess">Initial value of the NetworkSettingAccess property.</param> /// <param name="rvgSettingAccess">Initial value of the RvgSettingAccess property.</param> /// <param name="smsSettingAccess">Initial value of the SmsSettingAccess property.</param> /// <param name="clinicAccess">Initial value of the ClinicAccess property.</param> /// <param name="sendSmsAccess">Initial value of the SendSmsAccess property.</param> /// <param name="backupAccess">Initial value of the BackupAccess property.</param> /// <param name="backupSettingAccess">Initial value of the BackupSettingAccess property.</param> /// <param name="isAdmin">Initial value of the IsAdmin property.</param> public static Role CreateRole(global::System.Int32 id, global::System.String title, global::System.Int32 employeeAccess, global::System.Int32 drugAccess, global::System.Int32 roleAccess, global::System.Int32 serviceAccess, global::System.Int32 insuranceAccess, global::System.Int32 prescriptionAccess, global::System.Int32 calendarAccess, global::System.Int32 labratoryAccess, global::System.Int32 patientAccess, global::System.Int32 patientDoumentcAccess, global::System.Int32 patientHistoryAccess, global::System.Int32 labratoryOrderAccess, global::System.Int32 visitAccess, global::System.Int32 updateAccess, global::System.Int32 networkSettingAccess, global::System.Int32 rvgSettingAccess, global::System.Int32 smsSettingAccess, global::System.Int32 clinicAccess, global::System.Int32 sendSmsAccess, global::System.Int32 backupAccess, global::System.Int32 backupSettingAccess, global::System.Boolean isAdmin) { Role role = new Role(); role.Id = id; role.Title = title; role.EmployeeAccess = employeeAccess; role.DrugAccess = drugAccess; role.RoleAccess = roleAccess; role.ServiceAccess = serviceAccess; role.InsuranceAccess = insuranceAccess; role.PrescriptionAccess = prescriptionAccess; role.CalendarAccess = calendarAccess; role.LabratoryAccess = labratoryAccess; role.PatientAccess = patientAccess; role.PatientDoumentcAccess = patientDoumentcAccess; role.PatientHistoryAccess = patientHistoryAccess; role.LabratoryOrderAccess = labratoryOrderAccess; role.VisitAccess = visitAccess; role.UpdateAccess = updateAccess; role.NetworkSettingAccess = networkSettingAccess; role.RvgSettingAccess = rvgSettingAccess; role.SmsSettingAccess = smsSettingAccess; role.ClinicAccess = clinicAccess; role.SendSmsAccess = sendSmsAccess; role.BackupAccess = backupAccess; role.BackupSettingAccess = backupSettingAccess; role.IsAdmin = isAdmin; return role; }
/// <summary> /// Deprecated Method for adding a new object to the Roles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRoles(Role role) { base.AddObject("Roles", role); }
/// <summary> /// Create a new Role object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="employeeAccess">Initial value of the EmployeeAccess property.</param> /// <param name="drugAccess">Initial value of the DrugAccess property.</param> /// <param name="roleAccess">Initial value of the RoleAccess property.</param> /// <param name="serviceAccess">Initial value of the ServiceAccess property.</param> /// <param name="insuranceAccess">Initial value of the InsuranceAccess property.</param> /// <param name="prescriptionAccess">Initial value of the PrescriptionAccess property.</param> /// <param name="calendarAccess">Initial value of the CalendarAccess property.</param> /// <param name="labratoryAccess">Initial value of the LabratoryAccess property.</param> /// <param name="patientAccess">Initial value of the PatientAccess property.</param> /// <param name="patientDoumentcAccess">Initial value of the PatientDoumentcAccess property.</param> /// <param name="patientHistoryAccess">Initial value of the PatientHistoryAccess property.</param> /// <param name="labratoryOrderAccess">Initial value of the LabratoryOrderAccess property.</param> /// <param name="visitAccess">Initial value of the VisitAccess property.</param> /// <param name="updateAccess">Initial value of the UpdateAccess property.</param> /// <param name="networkSettingAccess">Initial value of the NetworkSettingAccess property.</param> /// <param name="rvgSettingAccess">Initial value of the RvgSettingAccess property.</param> /// <param name="smsSettingAccess">Initial value of the SmsSettingAccess property.</param> /// <param name="clinicAccess">Initial value of the ClinicAccess property.</param> /// <param name="sendSmsAccess">Initial value of the SendSmsAccess property.</param> /// <param name="backupAccess">Initial value of the BackupAccess property.</param> /// <param name="backupSettingAccess">Initial value of the BackupSettingAccess property.</param> /// <param name="isAdmin">Initial value of the IsAdmin property.</param> /// <param name="insuranceReceptionAccess">Initial value of the InsuranceReceptionAccess property.</param> /// <param name="patientReceptionAccess">Initial value of the PatientReceptionAccess property.</param> /// <param name="moneyReceptionAccess">Initial value of the MoneyReceptionAccess property.</param> /// <param name="chequeReceptionAccess">Initial value of the ChequeReceptionAccess property.</param> /// <param name="moneyPaymentAccess">Initial value of the MoneyPaymentAccess property.</param> /// <param name="chequePaymentAccess">Initial value of the ChequePaymentAccess property.</param> /// <param name="bankAccountAccess">Initial value of the BankAccountAccess property.</param> /// <param name="chequeBunchAccess">Initial value of the ChequeBunchAccess property.</param> /// <param name="accountantLevelsAccess">Initial value of the AccountantLevelsAccess property.</param> /// <param name="turnoverReportAccess">Initial value of the TurnoverReportAccess property.</param> /// <param name="doctorSalaryReportAccess">Initial value of the DoctorSalaryReportAccess property.</param> /// <param name="patientTurnoverReportAccess">Initial value of the PatientTurnoverReportAccess property.</param> /// <param name="insuranceTurnoverReportAccess">Initial value of the InsuranceTurnoverReportAccess property.</param> /// <param name="doctorReportAccess">Initial value of the DoctorReportAccess property.</param> public static Role CreateRole(global::System.Int32 id, global::System.String title, global::System.Int32 employeeAccess, global::System.Int32 drugAccess, global::System.Int32 roleAccess, global::System.Int32 serviceAccess, global::System.Int32 insuranceAccess, global::System.Int32 prescriptionAccess, global::System.Int32 calendarAccess, global::System.Int32 labratoryAccess, global::System.Int32 patientAccess, global::System.Int32 patientDoumentcAccess, global::System.Int32 patientHistoryAccess, global::System.Int32 labratoryOrderAccess, global::System.Int32 visitAccess, global::System.Int32 updateAccess, global::System.Int32 networkSettingAccess, global::System.Int32 rvgSettingAccess, global::System.Int32 smsSettingAccess, global::System.Int32 clinicAccess, global::System.Int32 sendSmsAccess, global::System.Int32 backupAccess, global::System.Int32 backupSettingAccess, global::System.Boolean isAdmin, global::System.Int32 insuranceReceptionAccess, global::System.Int32 patientReceptionAccess, global::System.Int32 moneyReceptionAccess, global::System.Int32 chequeReceptionAccess, global::System.Int32 moneyPaymentAccess, global::System.Int32 chequePaymentAccess, global::System.Int32 bankAccountAccess, global::System.Int32 chequeBunchAccess, global::System.Int32 accountantLevelsAccess, global::System.Int32 turnoverReportAccess, global::System.Int32 doctorSalaryReportAccess, global::System.Int32 patientTurnoverReportAccess, global::System.Int32 insuranceTurnoverReportAccess, global::System.Int32 doctorReportAccess) { Role role = new Role(); role.Id = id; role.Title = title; role.EmployeeAccess = employeeAccess; role.DrugAccess = drugAccess; role.RoleAccess = roleAccess; role.ServiceAccess = serviceAccess; role.InsuranceAccess = insuranceAccess; role.PrescriptionAccess = prescriptionAccess; role.CalendarAccess = calendarAccess; role.LabratoryAccess = labratoryAccess; role.PatientAccess = patientAccess; role.PatientDoumentcAccess = patientDoumentcAccess; role.PatientHistoryAccess = patientHistoryAccess; role.LabratoryOrderAccess = labratoryOrderAccess; role.VisitAccess = visitAccess; role.UpdateAccess = updateAccess; role.NetworkSettingAccess = networkSettingAccess; role.RvgSettingAccess = rvgSettingAccess; role.SmsSettingAccess = smsSettingAccess; role.ClinicAccess = clinicAccess; role.SendSmsAccess = sendSmsAccess; role.BackupAccess = backupAccess; role.BackupSettingAccess = backupSettingAccess; role.IsAdmin = isAdmin; role.InsuranceReceptionAccess = insuranceReceptionAccess; role.PatientReceptionAccess = patientReceptionAccess; role.MoneyReceptionAccess = moneyReceptionAccess; role.ChequeReceptionAccess = chequeReceptionAccess; role.MoneyPaymentAccess = moneyPaymentAccess; role.ChequePaymentAccess = chequePaymentAccess; role.BankAccountAccess = bankAccountAccess; role.ChequeBunchAccess = chequeBunchAccess; role.AccountantLevelsAccess = accountantLevelsAccess; role.TurnoverReportAccess = turnoverReportAccess; role.DoctorSalaryReportAccess = doctorSalaryReportAccess; role.PatientTurnoverReportAccess = patientTurnoverReportAccess; role.InsuranceTurnoverReportAccess = insuranceTurnoverReportAccess; role.DoctorReportAccess = doctorReportAccess; return role; }