/// <summary> /// Determines whether [has feature permission] [the specified feature reference identifier]. /// </summary> /// <param name="featureReferenceId">The feature reference identifier.</param> /// <returns></returns> public bool HasFeaturePermission(string featureReferenceId) { return(GblIQCare.HasFeaturePermission(featureReferenceId, this.UserRights)); //DataView theDV = new DataView(this.UserRights); //theDV.RowFilter = "ReferenceId = '" + featureReferenceId + "'"; //if (theDV.Count > 0) //{ // return true; //} //else //{ // return false; //} }
/// <summary> /// Determines whether [has feature permission] [the specified feature identifier]. /// </summary> /// <param name="featureId">The feature identifier.</param> /// <returns></returns> public bool HasFeaturePermission(int featureId) { return(GblIQCare.HasFeaturePermission(featureId, this.UserRights)); //DataView theDV = new DataView(this.UserRights); //theDV.RowFilter = "FeatureId = " + featureId.ToString(); //if (theDV.Count > 0) //{ // return true; //} //else //{ // return false; //} }
/// <summary> /// Handles the Load event of the frmMain control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void frmMain_Load(object sender, EventArgs e) { clsCssStyle theStyle = new clsCssStyle(); theStyle.setStyle(this); this.Text = PMTCTConstants.strIQCareTitle + " [" + GblIQCare.AppUserName + "] - " + GblIQCare.AppLocation; lblStatus.Text = GblIQCare.AppVersion + " Release Date: " + GblIQCare.ReleaseDate; lblCopyRight.Text = string.Format("©{0} Palladium", DateTime.Now.Year); ThreadPool.QueueUserWorkItem(new WaitCallback(GenerateCache)); #region "Module Validation" DataTable theModTable = GblIQCare.dtModules; DataView theDV = new DataView(theModTable); theDV.RowFilter = "ModuleId = 201"; if (theDV.Count < 1) { mnuPMSCM.Visible = false; } #endregion #region "User Authentication" if (GblIQCare.HasFeaturePermission(ApplicationAccess.FormBuilder, GblIQCare.dtUserRight) == false) { mnuFormBuilder.Visible = false; mnuDBMerge.Visible = false; mnuDBMerge.Visible = false; mnuDBMigration.Visible = false; mnuUpsize.Visible = false; toolStripSeparator1.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.ManageFields, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuManageFields.Visible = false; mnuManageCareEndedFields.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.ConfigureHomePages, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuConfigureHomePageForms.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.ConfigureCareTermination, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuConfigCareTermination.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.ManageForms, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuManageForms.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.DatabaseMigration, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuDBMigration.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.Upsize, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuUpsize.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.DatabaseMerge, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuDBMerge.Visible = false; } //if (GblIQCare.HasFunctionRight(ApplicationAccess.SpecialFormLinking, FunctionAccess.View, GblIQCare.dtUserRight) == false) //{ // mnuSplFormLinking.Visible = false; //} if (GblIQCare.HasFunctionRight(ApplicationAccess.ManageTechnicalArea, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuManageModule.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.PatientVisitConfiguration, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuVisitConfiguration.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.DrugDispense, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuPatientDrugDispense.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.PurchaseOrder, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuPurchaseOrder.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.GoodReceiveNotes, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuGoodReceivedNote.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.OpeningStock, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuOpeningStock.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.AdjustStocklevel, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuAdjustStock.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.DisposeItem, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuDisposeItem.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.BatchSummary, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuBatchSummary.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.StockSummary, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuStockSummary.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.ExpiryReport, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuExpiryReport.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.BudgetConfiguration, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuConfigureBudget.Visible = false; } if (GblIQCare.HasFunctionRight(ApplicationAccess.PatientVisitConfiguration, FunctionAccess.View, GblIQCare.dtUserRight) == false) { mnuVisitConfiguration.Visible = false; } #endregion }