Ejemplo n.º 1
0
 public Permission[] GetUserPermissions(string categoryCode, string userCode)
 {
     try
     {
         User user = TheUserMgr.LoadUser(userCode);
         return(ThePermissionMgr.GetALlPermissionsByCategory(categoryCode, user).ToArray());
     }
     catch (BusinessErrorException ex)
     {
         string exMessage = RenderingLanguage(ex.Message, userCode, ex.MessageParams);
         throw new SoapException(exMessage, SoapException.ServerFaultCode, string.Empty);
     }
 }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tempThemePage  = this.DDL_ThemePage.SelectedValue;
        tempThemeFrame = this.DDL_ThemeFrame.SelectedValue;

        if (TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE) != null)
        {
            this.DDL_ThemePage.SelectedValue = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE).Value;
        }
        else
        {
            this.DDL_ThemePage.SelectedValue = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE).Value;
        }

        if (TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME) != null)
        {
            this.DDL_ThemeFrame.SelectedValue = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME).Value;
        }
        else
        {
            this.DDL_ThemeFrame.SelectedValue = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME).Value;
        }

        this.DDL_ThemeFrame.DataSource = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEFRAME);
        this.DDL_ThemeFrame.DataBind();

        this.DDL_ThemePage.DataSource = TheCodeMasterMgr.GetCachedCodeMaster(BusinessConstants.CODE_MASTER_USER_PREFERENCE_VALUE_THEMEPAGE);
        this.DDL_ThemePage.DataBind();

        //CSModule
        upCS = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.PERMISSION_CATEGORY_TERMINAL);
        if (!IsPostBack)
        {
            this.ddlCSModule.DataSource = ThePermissionMgr.GetALlPermissionsByCategory(BusinessConstants.PERMISSION_CATEGORY_TERMINAL, this.CurrentUser);
            this.ddlCSModule.DataBind();
            if (upCS != null)
            {
                this.ddlCSModule.Text = upCS.Value == null ? string.Empty : upCS.Value;
            }
        }

        //Language
        up           = TheUserPreferenceMgr.LoadUserPreference(this.CurrentUser.Code, BusinessConstants.CODE_MASTER_LANGUAGE);
        tempLanguage = this.ddlLanguage.SelectedValue;
        if (up != null)
        {
            this.ddlLanguage.Text = up.Value == null ? string.Empty : up.Value;
        }
        else
        {
            this.ddlLanguage.Text = TheCodeMasterMgr.GetDefaultCodeMaster(BusinessConstants.CODE_MASTER_LANGUAGE).Value;
        }

        //清除Tab状态
        if (Request.Cookies["TabStatus"] != null && Request.Cookies["TabStatus"].Value == "Theme")
        {
            this.divRefresh.Visible = true;
            Response.Cookies["TabStatus"].Values.Remove("Theme");
            ShowSuccessMessage("Security.UserPreference.Update.Successfully");
        }
        else
        {
            this.divRefresh.Visible = false;
        }
    }