Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Initialize();
        string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "FileManagerGlobalVariable1", " var FileManagerPath='" + ResolveUrl(modulePath) + "';", true);
        UserModuleID = int.Parse(SageUserModuleID.ToString());
        UserName     = GetUsername;
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.Request.RawUrl.Contains("/Admin/") || HttpContext.Current.Request.RawUrl.Contains("/Super-User/") || HttpContext.Current.Request.RawUrl.Contains("ManageReturnURL="))
        {
            cssClassWrapper = "cssClassAdminFileManager";
        }
        else
        {
            cssClassWrapper = "cssClassClientFileManager";
        }
        string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "FileManagerGlobalVariable1", " var FileManagerPath='" + ResolveUrl(modulePath) + "';", true);
        UserModuleID = int.Parse(SageUserModuleID.ToString());
        UserName     = GetUsername;
    }
Exemple #3
0
    protected void btnAddExtension_Click(object sender, EventArgs e)
    {
        List <FileManagerSettingInfo> lstSettings = new List <FileManagerSettingInfo>();
        FileManagerSettingInfo        objSetting  = new FileManagerSettingInfo();

        objSetting.UserModuleID = int.Parse(SageUserModuleID.ToString());
        objSetting.SettingKey   = "FileManagerExtensions";
        objSetting.SettingValue = txtExtensions.Text;
        objSetting.IsActive     = true;
        objSetting.PortalID     = GetPortalID;
        objSetting.UpdatedBy    = GetUsername;
        objSetting.AddedBy      = GetUsername;
        lstSettings.Add(objSetting);
        try
        {
            FileManagerController.AddUpdateSettings(lstSettings);
            LoadSettings();
            ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("FileManager", "SettingsAddedSuccessfully"), "", SageMessageType.Success);
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
 private void GenrateSageSerchForm()
 {
     try
     {
         if (pnlSearchWord.Controls.Count == 1)
         {
             SageFrameSearch            con = new SageFrameSearch();
             SageFrameSearchSettingInfo objSearchSettingInfo = con.LoadSearchSettings(GetPortalID, GetCurrentCultureName);
             viewPerPage = objSearchSettingInfo.SearchResultPerPage;
             HtmlGenericControl sageUl = new HtmlGenericControl("ul");
             sageUl.Attributes.Add("class", "sfSearchheader");
             HtmlGenericControl sageLi = new HtmlGenericControl("li");
             sageUl.Attributes.Add("class", "sfSearchheader");
             TextBox txtSageSearch = new TextBox();
             txtSageSearch.CssClass  = "sfInputbox";
             txtSageSearch.MaxLength = objSearchSettingInfo.MaxSearchChracterAllowedWithSpace;
             IDOfTxtBox       = "txtSage_" + this.Page.Controls.Count.ToString();
             txtSageSearch.ID = IDOfTxtBox;
             RequiredFieldValidator ReqV = new RequiredFieldValidator();
             ReqV.ControlToValidate = IDOfTxtBox;
             ReqV.ErrorMessage      = "*";
             ReqV.CssClass          = "sfError";
             ReqV.ValidationGroup   = "grp_SageSearch";
             sageLi.Controls.Add(ReqV);
             sageLi.Controls.Add(txtSageSearch);
             HtmlGenericControl sageLiButton          = new HtmlGenericControl("li");
             string             SearchReasultPageName = objSearchSettingInfo.SearchResultPageName;
             if (!SearchReasultPageName.Contains(SageFrameSettingKeys.PageExtension))
             {
                 SearchReasultPageName += SageFrameSettingKeys.PageExtension;
             }
             SageSearchResultPage = SearchReasultPageName;
             if (objSearchSettingInfo.SearchButtonType == 0)
             {
                 Button btnSageSearch = new Button();
                 btnSageSearch.ID              = "btnSageSearchWord";
                 btnSageSearch.Text            = "Search";
                 btnSageSearch.CssClass        = "sfBtn";
                 btnSageSearch.Click          += new EventHandler(btnSageSearch_Click);
                 btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                 sageLiButton.Controls.Add(btnSageSearch);
             }
             else if (objSearchSettingInfo.SearchButtonType == 1)
             {
                 ImageButton btnSageSearch = new ImageButton();
                 btnSageSearch.ID            = "btnSageSearchWord";
                 btnSageSearch.AlternateText = objSearchSettingInfo.SearchButtonText;
                 string SearchButtonImageUrl = objSearchSettingInfo.SearchButtonImage;
                 btnSageSearch.ImageUrl        = GetTemplateImageUrl(SearchButtonImageUrl, true);
                 btnSageSearch.CssClass        = "sfBtn";
                 btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                 btnSageSearch.Click          += new ImageClickEventHandler(btnSageSearch_Click);
                 sageLiButton.Controls.Add(btnSageSearch);
             }
             else if (objSearchSettingInfo.SearchButtonType == 2)
             {
                 LinkButton btnSageSearch = new LinkButton();
                 btnSageSearch.ID   = "btnSageSearchWord";
                 btnSageSearch.Text = "Search";
                 //btnSageSearch.CssClass = "sfBtn";
                 btnSageSearch.Click          += new EventHandler(btnSageSearch_Click);
                 btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                 sageLiButton.Controls.Add(btnSageSearch);
             }
             sageUl.Controls.Add(sageLi);
             sageUl.Controls.Add(sageLiButton);
             pnlSearchWord.Controls.Add(sageUl);
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Exemple #5
0
    private void GenrateSageSerchForm()
    {
        try
        {
            if (pnlSearch.Controls.Count == 1)
            {
                SageFrameSearch            con = new SageFrameSearch();
                SageFrameSearchSettingInfo objSearchSettingInfo = con.LoadSearchSettings(GetPortalID, GetCurrentCultureName);
                HtmlGenericControl         sageUl = new HtmlGenericControl("ul");
                HtmlGenericControl         sageLi = new HtmlGenericControl("li");

                TextBox txtSageSearch = new TextBox();
                txtSageSearch.CssClass  = "cssClassSageSearchBox";
                txtSageSearch.MaxLength = objSearchSettingInfo.MaxSearchChracterAllowedWithSpace;
                IDOfTxtBox       = "txt_" + this.Page.Controls.Count.ToString();
                txtSageSearch.ID = IDOfTxtBox;
                RequiredFieldValidator ReqV = new RequiredFieldValidator();
                ReqV.ControlToValidate = IDOfTxtBox;
                ReqV.ErrorMessage      = "*";
                ReqV.CssClass          = "cssClasssNormalRed";
                ReqV.ValidationGroup   = "grp_SageSearch";
                sageLi.Controls.Add(ReqV);
                sageLi.Controls.Add(txtSageSearch);

                HtmlGenericControl sageLiButton          = new HtmlGenericControl("li");
                string             SearchReasultPageName = objSearchSettingInfo.SearchResultPageName;

                if (!SearchReasultPageName.Contains(".aspx"))
                {
                    SearchReasultPageName += ".aspx";
                }

                SageSearchResultPage = SearchReasultPageName;

                if (objSearchSettingInfo.SearchButtonType == 0)
                {
                    Button btnSageSearch = new Button();
                    btnSageSearch.ID              = "btnSageSearch";
                    btnSageSearch.Text            = objSearchSettingInfo.SearchButtonText;
                    btnSageSearch.CssClass        = "cssClassSageSearchButton";
                    btnSageSearch.Click          += new EventHandler(btnSageSearch_Click);
                    btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                    sageLiButton.Controls.Add(btnSageSearch);
                    //txtSageSearch.Attributes.Add("onkeydown", "ClickButtonOnInputBoxEnter('" + btnSageSearch.ClientID + "');");
                }
                else if (objSearchSettingInfo.SearchButtonType == 1)
                {
                    ImageButton btnSageSearch = new ImageButton();
                    btnSageSearch.ID            = "btnSageSearch";
                    btnSageSearch.AlternateText = objSearchSettingInfo.SearchButtonText;
                    string SearchButtonImageUrl = objSearchSettingInfo.SearchButtonImage;
                    btnSageSearch.ImageUrl        = GetTemplateImageUrl(SearchButtonImageUrl, true);
                    btnSageSearch.CssClass        = "cssClassSageSearchImageButton";
                    btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                    btnSageSearch.Click          += new ImageClickEventHandler(btnSageSearch_Click);
                    sageLiButton.Controls.Add(btnSageSearch);
                    //txtSageSearch.Attributes.Add("onkeydown", "ClickButtonOnInputBoxEnter('" + btnSageSearch.ClientID + "');");
                    //txtSageSearch.Attributes.Add("onkeypress", "return clickButton(event,'" + btnSageSearch.ClientID + "')");
                }
                else if (objSearchSettingInfo.SearchButtonType == 2)
                {
                    LinkButton btnSageSearch = new LinkButton();
                    btnSageSearch.ID              = "btnSageSearch";
                    btnSageSearch.Text            = objSearchSettingInfo.SearchButtonText;
                    btnSageSearch.CssClass        = "cssClassSageSearchLinkButton";
                    btnSageSearch.Click          += new EventHandler(btnSageSearch_Click);
                    btnSageSearch.ValidationGroup = "grp_SageSearch_" + SageUserModuleID.ToString();
                    sageLiButton.Controls.Add(btnSageSearch);
                    //txtSageSearch.Attributes.Add("onkeydown", "ClickButtonOnInputBoxEnter('" + btnSageSearch.ClientID + "');");
                }
                sageUl.Controls.Add(sageLi);
                sageUl.Controls.Add(sageLiButton);
                pnlSearch.Controls.Add(sageUl);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }