private Setting GetSettingByCode(ETEMEnums.AppSettings appSettings) { Setting settings = AdminClientRef.GetSettingByCode(appSettings.ToString()); return settings; }
public Setting GetSettingByCode(ETEMEnums.AppSettings appSettings) { string settingName = appSettings.ToString(); Setting setting = this.dbContext.Settings.Where(k => k.SettingIntCode == settingName).FirstOrDefault(); return setting; }
public bool CheckUserActionPermissionByIntCode(ETEMEnums.SecuritySettings securitySetting) { if (userProps != null) { this.userProps.SecuritySetting = securitySetting.ToString(); if (this.FormContext.DictionaryPermittedActionSetting.FirstOrDefault(s => s.Value.SecuritySetting == securitySetting.ToString()).Value != null) { this.userProps.SecuritySettingBG = this.FormContext.DictionaryPermittedActionSetting.FirstOrDefault(s => s.Value.SecuritySetting == securitySetting.ToString()).Value.FrendlyName; } else { this.userProps.SecuritySettingBG = "###" + securitySetting.ToString() + "###"; } } if (this.UserProps.Roles.Any(a => a.Name == "SUPPORT")) { return true; } if (this.UserProps.Roles.Any(a => a.Name == "VIEW")) { return true; } int checkCount = (from pa in this.FormContext.DictionaryPermittedActionSetting.Values where pa.SecuritySetting == securitySetting.ToString() && this.UserProps.ListUserPermittedActionsID.Contains(pa.idPermittedAction) select pa.SecuritySetting).Count(); return (checkCount > 0 ? true : false); }
public bool CheckUserActionPermission(ETEMEnums.SecuritySettings securitySetting, bool _MakeRedirect) { if (userProps != null) { this.userProps.SecuritySetting = securitySetting.ToString(); this.userProps.SecuritySettingBG = this.FormContext.DictionaryPermittedActionSetting.FirstOrDefault(s => s.Value.SecuritySetting == securitySetting.ToString()).Value.FrendlyName; } if (this.UserProps.Roles.Any(a => a.Name == "SUPPORT")) { return true; } if (this.UserProps.Roles.Any(a => a.Name == "VIEW")) { return true; } bool result = CheckUserActionPermissionByIntCode(securitySetting); if (!result) { if (_MakeRedirect) { if (this.Page.Master != null) { Response.Redirect("~/UI/NoPermission.aspx"); } else { Response.Redirect("~/UI/NoPermissionWithoutMasterPage.aspx"); } } else { ShowMSG("Нямате права за това действие!"); } } return result; }
public static Setting GetSettingByCode(ETEMEnums.AppSettings appSettings) { Setting setting = DictionarySetting.Where(k => k.Key == appSettings.ToString()).FirstOrDefault().Value; return setting; }