Esempio n. 1
0
 private void SageInitPart()
 {
     SetPortalCofig();
     InitializePage();
     LoadModuleControls();
     SageFrameConfig sfConfig = new SageFrameConfig();
     IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
     //LoadControl(phdAdministrativBreadCrumb, "~/Controls/ctl_AdminBreadCrum.ascx");
     LoadControl(phdAdminMenu, "~/Controls/ctl_AdminMenuOnly.ascx");
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowFooter) == "1")
     {
         divFooterWrapper.Attributes.Add("style", "display:block;");
     }
     else
     {
         divFooterWrapper.Attributes.Add("style", "display:none;");
     }
     BindModuleControls();
     HiddenField hdnPageID = new HiddenField();
     hdnPageID.ID = "hdnPageID";
     if (HttpContext.Current.Request.QueryString["pgid"] != null)
     {
         hdnPageID.Value = HttpContext.Current.Request.QueryString["pgid"].ToString();
     }
     HiddenField hdnActiveIndex = new HiddenField();
     hdnActiveIndex.ID = "hdnActiveIndex";
     if (HttpContext.Current.Request.QueryString["ActInd"] != null)
     {
         hdnActiveIndex.Value = HttpContext.Current.Request.QueryString["ActInd"].ToString();
     }
     this.Page.Form.Controls.Add(hdnPageID);
     this.Page.Form.Controls.Add(hdnActiveIndex);
     OverridePageInfo(null);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            if (!IsPostBack)
            {
                IncludeCss("ShoppingBagHeader", "/Templates/" + TemplateName + "/css/PopUp/style.css", "/Templates/" + TemplateName + "/css/MessageBox/style.css");
                IncludeJs("ShoppingBagHeader", "/js/PopUp/custom.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/Session.js",
                    "Modules/AspxCommerce/AspxShoppingBagHeader/js/ShoppingBag.js");
                StoreID = GetStoreID;
                PortalID = GetPortalID;
                CustomerID = GetCustomerID;
                UserName = GetUsername;
                CultureName = GetCurrentCultureName;

                if (HttpContext.Current.Session.SessionID != null)
                {
                    SessionCode = HttpContext.Current.Session.SessionID.ToString();
                }

                StoreSettingConfig ssc = new StoreSettingConfig();
                ShowMiniShopCart = ssc.GetStoreSettingsByKey(StoreSetting.ShowMiniShoppingCart, StoreID, PortalID, CultureName);
                AllowMultipleAddChkOut = ssc.GetStoreSettingsByKey(StoreSetting.AllowMultipleShippingAddress, StoreID, PortalID, CultureName);
                MinOrderAmount = ssc.GetStoreSettingsByKey(StoreSetting.MinimumOrderAmount, StoreID, PortalID, CultureName);
                AllowAnonymousCheckOut = ssc.GetStoreSettingsByKey(StoreSetting.AllowAnonymousCheckOut, StoreID, PortalID, CultureName);
                ShoppingCartURL = ssc.GetStoreSettingsByKey(StoreSetting.ShoppingCartURL, StoreID, PortalID, CultureName);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
      protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
            AspxAdminNotificationModulePath = ResolveUrl(modulePath);

            if (!IsPostBack)
            {

                IncludeJs("AspxAdminNotificationView",
                      "/Modules/AspxCommerce/AspxAdminNotification/js/AspxAdminNotificationView.js"
                      );

                IncludeCss("AspxAdminNotificationView",
                     "/Modules/AspxCommerce/AspxAdminNotification/css/AdminNotification.css",
                     "/Modules/AspxCommerce/AspxAdminNotification/css/style.css"
                    );
              
            }

            IncludeLanguageJS();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }

    }
Esempio n. 4
0
 protected void Application_Start(object sender, EventArgs e)
 {
     try
     {
         string IsInstalled = Config.GetSetting("IsInstalled").ToString();
         string InstallationDate = Config.GetSetting("InstallationDate").ToString();
         if ((IsInstalled != "" && IsInstalled != "false") && InstallationDate != "")
         {
             SageFrameConfig pagebase = new SageFrameConfig();
             RolesManagementDataContext db = new RolesManagementDataContext(SystemSetting.SageFrameConnectionString);
             sp_GetRoleIDByRoleNameResult res = (sp_GetRoleIDByRoleNameResult)db.sp_GetRoleIDByRoleName(SystemSetting.AnonymousUsername).SingleOrDefault();
             if (res != null)
             {
                 SystemSetting.ANONYMOUS_ROLEID = res.RoleId.ToString();
             }
             bool IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
             if (IsUseFriendlyUrls)
             {
                 RegisterRoutes(RouteTable.Routes);
             }
         }
     }
     catch
     {
     }
     
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     templateFavicon = SetFavIcon(GetActiveTemplate);
     imgLogo.ImageUrl = ResolveUrl("~/") + "images/sageframe.png";
     Extension = SageFrameSettingKeys.PageExtension;
     SageFrameConfig sfConfig = new SageFrameConfig();
     appPath = GetAppPath();
     string pagePath = ResolveUrl(GetParentURL) + GetReduceApplicationName;
     ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "BreadCrumGlobal1", " var BreadCrumPagePath='" + pagePath + "';", true);
     pagePath = IsParent ? pagePath : pagePath + "portal/" + GetPortalSEOName;
     PortalID = GetPortalID;
     if (!IsParent)
     {
         fallBackPath = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + Extension;
     }
     else
     {
         fallBackPath = GetParentURL + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + Extension;
     }
     if (Session[SessionKeys.TemplateError] != null)
     {
         Exception ex = Session[SessionKeys.TemplateError] as Exception;
         StringBuilder sb = new StringBuilder();
         sb.Append(string.Format("<h3>{0}</h3>", ex.Message));
         sb.Append(string.Format("<p>{0}</p>", ex.ToString()));
         ltrErrorMessage.Text = sb.ToString();
     }
 }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            storeID = GetStoreID;
            portalID = GetPortalID;
            userName = GetUsername;
            customerID = GetCustomerID;
            cultureName = GetCurrentCultureName;
            if (HttpContext.Current.Session.SessionID != null)
            {
                sessionCode = HttpContext.Current.Session.SessionID.ToString();
            }

            userIP = HttpContext.Current.Request.UserHostAddress;
            IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver();
            ipToCountry.GetCountry(userIP, out countryName);
            noImageWishList = StoreSetting.GetStoreSettingValueByKey(StoreSetting.DefaultProductImageURL, storeID, portalID, cultureName);
            enableWishList = StoreSetting.GetStoreSettingValueByKey(StoreSetting.EnableWishList, storeID, portalID, cultureName);
            showImageInWishlist = StoreSetting.GetStoreSettingValueByKey(StoreSetting.ShowItemImagesInWishList, storeID, portalID, cultureName);
            allowOutStockPurchase = StoreSetting.GetStoreSettingValueByKey(StoreSetting.AllowOutStockPurchase, storeID, portalID, cultureName);
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         SageFrameConfig pagebase = new SageFrameConfig();
         IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
         if (!IsPostBack)
         {
             storeID = GetStoreID;
             portalID = GetPortalID;
             userName = GetUsername;
             customerID = GetCustomerID;
             cultureName = GetCurrentCultureName;
             if (HttpContext.Current.Session.SessionID != null)
             {
                 sessionCode = HttpContext.Current.Session.SessionID.ToString();
             }
             noImageMyCartPath = StoreSetting.GetStoreSettingValueByKey(StoreSetting.DefaultProductImageURL, storeID, portalID, cultureName);
             allowMultipleAddShipping = StoreSetting.GetStoreSettingValueByKey(StoreSetting.AllowMultipleShippingAddress, storeID, portalID, cultureName);
             showItemImagesOnCart = StoreSetting.GetStoreSettingValueByKey(StoreSetting.ShowItemImagesInCart, storeID, portalID, cultureName);
             minOrderAmount = StoreSetting.GetStoreSettingValueByKey(StoreSetting.MinimumOrderAmount, storeID, portalID, cultureName);
             minimumItemQuantity = Convert.ToInt32(StoreSetting.GetStoreSettingValueByKey(StoreSetting.MinimumItemQuantity, storeID, portalID, cultureName));
             maximumItemQuantity = Convert.ToInt32(StoreSetting.GetStoreSettingValueByKey(StoreSetting.MaximumItemQuantity, storeID, portalID, cultureName));
             allowOutStockPurchase = StoreSetting.GetStoreSettingValueByKey(StoreSetting.AllowOutStockPurchase, storeID, portalID, cultureName);
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Esempio n. 8
0
        public bool LogPageMethodException(Exception exc)
        {
            string strIPaddress = string.Empty;
            string strPageUrl   = string.Empty;

            if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.UserHostAddress != string.Empty)
            {
                strIPaddress = HttpContext.Current.Request.UserHostAddress;
            }

            if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.RawUrl != string.Empty)
            {
                strPageUrl = HttpContext.Current.Request.RawUrl;
            }

            int                inID          = 0;
            SageFrameConfig    sfConfig      = new SageFrameConfig();
            ErrorLogController objController = new ErrorLogController();

            inID = objController.InsertLog((int)SageFrame.Web.SageFrameEnums.ErrorType.AdministrationArea, 11, exc.Message, exc.ToString(),
                                           strIPaddress, strPageUrl, true, sfConfig.GetPortalID, sfConfig.GetUsername);


            return(sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseCustomErrorMessages));
        }
 public void BindValues()
 {
     PresetInfo preset = GetPresetDetails;
     if (preset.ActiveTheme == string.Empty)
     {
         preset.ActiveTheme = "default";
     }
     ddlThemes.Items.FindByText(preset.ActiveTheme.ToLower()).Selected = true;
     if (preset.ActiveWidth == string.Empty)
     {
         preset.ActiveWidth = "Wide";
     }
     ddlScreen.Items.FindByText(preset.ActiveWidth.ToLower()).Selected = true;
     string activeLayout = string.Empty;
     string pageName = Request.Url.ToString();
     SageFrameConfig sfConfig = new SageFrameConfig();
     pageName = Path.GetFileNameWithoutExtension(pageName);
     pageName = pageName.ToLower().Equals("default") ? sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) : pageName;
     foreach (KeyValue kvp in preset.lstLayouts)
     {
         string[] arrLayouts = kvp.Value.Split(',');
         if (arrLayouts.Contains(pageName))
         {
             activeLayout = kvp.Key;
         }
     }
     if (activeLayout != null && activeLayout != string.Empty)
     {
         if (ddlLayout.Items.FindByText(string.Format("{0}.ascx", activeLayout)) != null)
         {
             ddlLayout.Items.FindByText(string.Format("{0}.ascx", activeLayout)).Selected = true;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     IncludeLanguageJS();
     appPath = GetApplicationName;
     userName = SecurityPolicy.GetUser(GetPortalID);
     Extension = SageFrameSettingKeys.PageExtension;
     if (!IsPostBack)
     {
         // BindThemes();
         //BindLayouts();
         //BindValues();
         hlnkDashboard.Visible = false;
         SageFrameConfig conf = new SageFrameConfig();
         string ExistingPortalShowProfileLink = conf.GetSettingsByKey(SageFrameSettingKeys.PortalShowProfileLink);
         lnkAccount.NavigateUrl = GetProfileLink();
         if (ExistingPortalShowProfileLink == "1")
         {
         }
         else
         {
         }
     }
     RoleController _role = new RoleController();
     string[] roles = _role.GetRoleNames(GetUsername, GetPortalID).ToLower().Split(',');
     if (roles.Contains(SystemSetting.SUPER_ROLE[0].ToLower()) || roles.Contains(SystemSetting.SITEADMIN.ToLower()))
     {
         hlnkDashboard.Visible = true;
         hlnkDashboard.NavigateUrl = GetPortalAdminPage();
         cpanel.Visible = true;
     }
     else
     {
         cpanel.Visible = false;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         SageFrameConfig pagebase = new SageFrameConfig();
         GetPortalCommonInfo(out  StoreID, out  PortalID, out  CustomerID, out  UserName, out  CultureName);
         if (!IsPostBack)
         {
             IncludeCss("ShoppingBagHeader", "/Templates/" + TemplateName + "/css/PopUp/style.css", 
                 "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                 "/Modules/AspxCommerce/AspxShoppingBagHeader/css/module.css");
             IncludeJs("ShoppingBagHeader", "/js/PopUp/custom.js", "/js/MessageBox/jquery.easing.1.3.js", 
                 "/js/MessageBox/alertbox.js",
                 "/Modules/AspxCommerce/AspxShoppingBagHeader/js/ShoppingBag.js", "/js/Session.js");   
             UserModuleID = SageUserModuleID;
             if (HttpContext.Current.Session.SessionID != null)
             {
                 SessionCode = HttpContext.Current.Session.SessionID.ToString();
             }
             StoreSettingConfig ssc = new StoreSettingConfig();
             ssc.GetStoreSettingParamEight(StoreSetting.ShowMiniShoppingCart, StoreSetting.ShowAddToCartButton,
                 StoreSetting.AllowMultipleShippingAddress, StoreSetting.MinimumCartSubTotalAmount, StoreSetting.AllowAnonymousCheckOut, 
                 StoreSetting.ShoppingCartURL,StoreSetting.SingleCheckOutURL, StoreSetting.AllowRealTimeNotifications,
                 out ShowMiniShopCart, out AllowAddToCart, out AllowMultipleAddChkOut, out MinCartSubTotalAmount, out AllowAnonymousCheckOut,
                 out ShoppingCartURL, out SingleAddressChkOutURL, out AllowRealTimeNotifications, StoreID, PortalID, CultureName);
             AspxCommonInfo aspxCommonObj = new AspxCommonInfo(StoreID, PortalID,CultureName);
             BagType = AspxShoppingBagController.GetShoppingBagSetting(aspxCommonObj);
         }
         IncludeLanguageJS();
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Esempio n. 12
0
    public void CheckAccess()
    {
        string preFix = string.Empty;
        string paneName = string.Empty;
        string ControlSrc = string.Empty;
        string phdContainer = string.Empty;
        string PageSEOName = string.Empty;
        string redirecPath = string.Empty;
        SageFrameConfig sfConfig = new SageFrameConfig();
        IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
        StoreAccessDetailsInfo storeAccessTracker = new StoreAccessDetailsInfo();
        storeAccessTracker.PortalID = GetPortalID.ToString();
        storeAccessTracker.StoreID = GetStoreID.ToString();
        storeAccessTracker.Username = GetUsername;
        if (Membership.GetUser() != null)
        {
            MembershipUser userDetail = Membership.GetUser(GetUsername);
            storeAccessTracker.UserEmail = userDetail.Email;
        }
        else
        {
            storeAccessTracker.UserEmail = "";
        }
        StoreAccessResultInfo saResults = (StoreAccessResultInfo)GetStoreAccessByCurrentData(storeAccessTracker);
        bool storeClosed = (bool)saResults.StoreClosed;
        bool storeAccessible = (bool)saResults.IsAccess;

        if (storeAccessible)
        {
            DataSet dsPageSettings = new DataSet();

            dsPageSettings = sfConfig.GetPageSettingsByPageSEOName("1", "Home", GetUsername);
            if (bool.Parse(dsPageSettings.Tables[0].Rows[0][0].ToString()) == true)
            {
                //if (bool.Parse(dsPageSettings.Tables[0].Rows[0][2].ToString()) != true)
                //{
                if (bool.Parse(dsPageSettings.Tables[0].Rows[0][1].ToString()) == true)
                {
                    //from session previous url will retrive and redirect to id
                    string returnURL = HttpContext.Current.Session["StoreClosed"].ToString();
                    HttpContext.Current.Session.Remove("StoreClosed");
                    Response.Redirect(returnURL);
                }
                else
                {

                }

            }
            else
            {
                //portal no found
            }
        }
        else
        {
        }


    }
    private void StartProccess()
    {
        try
        {

            var sfConfig = new SageFrameConfig();
           bool _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            string sageRedirectPath;
            if (_isUseFriendlyUrls)
            {
                if (!IsParent)
                {
                    sageRedirectPath = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + "Cash-On-Delivery-Success.aspx");
                }
                else
                {
                    sageRedirectPath = ResolveUrl("~/" + "Cash-On-Delivery-Success.aspx");
                 }
            }
            else
            {
                sageRedirectPath = ResolveUrl("{~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + "Cash-On-Delivery-Success");
            }

                                 Response.Redirect(sageRedirectPath);



        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoStore();
        Response.Cache.SetExpires(DateTime.Now);
        Response.Cache.SetValidUntilExpires(true);

        GetPortalCommonInfo(out StoreID, out PortalID, out CustomerID, out UserName, out CultureName, out SessionCode);
        aspxCommonObj = new AspxCommonInfo(StoreID, PortalID, UserName, CultureName, CustomerID, SessionCode);

        UserModuleIDCart = int.Parse(SageUserModuleID);

        try
        {
            CartModulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
            SageFrameConfig pagebase = new SageFrameConfig();            

            string template = TemplateName;
            StoreSettingConfig ssc = new StoreSettingConfig();
            ssc.GetStoreSettingParamNine(StoreSetting.DefaultProductImageURL,
                                        StoreSetting.AllowMultipleShippingAddress,
                                        StoreSetting.ShowItemImagesInCart,
                                        StoreSetting.MinimumCartSubTotalAmount,
                                        StoreSetting.AllowOutStockPurchase,
                                        StoreSetting.MultiCheckOutURL,
                                        StoreSetting.AllowShippingRateEstimate,
                                        StoreSetting.AllowCouponDiscount,
                                        StoreSetting.AllowRealTimeNotifications,
                                        out NoImageMyCartPath,
                                        out AllowMultipleAddShipping,
                                        out ShowItemImagesOnCart,
                                        out MinCartSubTotalAmount,
                                        out AllowOutStockPurchase,
                                        out MultipleAddressChkOutURL,
                                        out AllowShippingRateEstimate,
                                        out AllowCouponDiscount,
                                        out AllowRealTimeNotifications,
                                        StoreID,
                                        PortalID,
                                        CultureName
                                        );

            if (!IsPostBack)
            {
                IncludeCss("MyCart", "/Templates/" + template + "/css/GridView/tablesort.css",
                           "/Templates/" + template + "/css/MessageBox/style.css",
                           "/Templates/", template, "/css/ToolTip/tooltip.css",
                           "/Modules/AspxCommerce/AspxCart/css/module.css");
                IncludeJs("MyCart","/Modules/AspxCommerce/AspxCart/js/MyCart.js", "/js/encoder.js", "/js/MessageBox/alertbox.js", "/js/jquery.easing.1.3.js", "/js/jquery.tipsy.js", "/js/Session.js");
            }
            DisplayCartItems(template);
            IncludeLanguageJS();
            CouponInfo();
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 15
0
 protected void Page_Init(object sender, EventArgs e)
 {
     SageFrameConfig sfConfig = new SageFrameConfig();
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowFooterLink) == "1")
     {
         LoadControl(phdFooterMenu, "~/Controls/ctl_FooterMenu.ascx");
         divFooterLink.Attributes.Add("style", "display:block;");
     }
     else
     {
         phdFooterMenu.Controls.Clear();
         divFooterLink.Attributes.Add("style", "display:none;");
     }
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowCopyRight) == "1")
     {
         divCopyWrite.InnerHtml = Server.HtmlDecode(sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalCopyright));
         divCopyWrite.Attributes.Add("style", "display:block;");
     }
     else
     {
         divCopyWrite.InnerHtml = "";
         divCopyWrite.Attributes.Add("style", "display:none;");
     }
     
 }
Esempio n. 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         SageFrameConfig sfConfig = new SageFrameConfig();
         IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
         if (HttpContext.Current.User != null)
         {
             if (Membership.GetUser() != null)
             {
                 lnkloginStatus.Text = SageLogOutText;
                 lnkloginStatus.CommandName = "LOGOUT";
             }
             else
             {
                 lnkloginStatus.Text = SageLogInText;
                 lnkloginStatus.CommandName = "LOGIN";
             }
         }
         else
         {
             lnkloginStatus.Text = SageLogInText;
             lnkloginStatus.CommandName = "LOGIN";
         }
     }
     catch
     {
     }
 }
        protected void Application_Start(object sender, EventArgs e)
        {
            try
            {
                ApplicationController objAppController = new ApplicationController();
                if (objAppController.IsInstalled())
                {
                    SageFrameConfig pagebase = new SageFrameConfig();
                    RolesManagementController objController = new RolesManagementController();
                    RolesManagementInfo res = objController.GetRoleIDByRoleName(SystemSetting.AnonymousUsername);
                    if (res != null)
                    {
                        SystemSetting.ANONYMOUS_ROLEID = res.RoleId.ToString();
                    }
                    bool IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                    SageFrameSettingKeys.PageExtension = pagebase.GetSettingsByKey(SageFrameSettingKeys.SettingPageExtension);
                    bool isSchedulerOn = pagebase.GetSettingBollByKey(SageFrameSettingKeys.Scheduler);
                    if (IsUseFriendlyUrls)
                    {
                        RegisterRoutes(RouteTable.Routes);
                    }
                    if (isSchedulerOn)
                    {
                        RunSchedule();
                    }
                }
            }
            catch
            {
            }

        }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SageFrameConfig pagebase = new SageFrameConfig();
            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
            if (!IsPostBack)
            {
                storeID = GetStoreID;
                portalID = GetPortalID;
                customerID = GetCustomerID;
                userName = GetUsername;
                cultureName = GetCurrentCultureName;

                if (HttpContext.Current.Session.SessionID != null)
                {
                    sessionCode = HttpContext.Current.Session.SessionID.ToString();
                }
                myAccountURL = StoreSetting.GetStoreSettingValueByKey(StoreSetting.MyAccountURL, storeID, portalID, cultureName);
                shoppingCartURL = StoreSetting.GetStoreSettingValueByKey(StoreSetting.ShoppingCartURL, storeID, portalID, cultureName);
                wishListURL = StoreSetting.GetStoreSettingValueByKey(StoreSetting.WishListURL, storeID, portalID, cultureName);
                allowAnonymousCheckOut = StoreSetting.GetStoreSettingValueByKey(StoreSetting.AllowAnonymousCheckOut, storeID, portalID, cultureName);
                allowMultipleShipping = StoreSetting.GetStoreSettingValueByKey(StoreSetting.AllowMultipleShippingAddress, storeID, portalID, cultureName);
                minOrderAmount = StoreSetting.GetStoreSettingValueByKey(StoreSetting.MinimumOrderAmount, storeID, portalID, cultureName);
                allowWishList = StoreSetting.GetStoreSettingValueByKey(StoreSetting.EnableWishList,storeID,portalID,cultureName);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                var sfConfig = new SageFrameConfig();
                _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);

                if (_isUseFriendlyUrls)
                {
                    if (!IsParent)
                    {
                        AddressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/";

                    }
                    else
                    {
                        AddressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
                    }
                }
                StoreSettingConfig ssc = new StoreSettingConfig();               
                MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetPortalID, GetPortalID, GetCurrentCultureName);  

            }
            IncludeLanguageJS();
        }
        catch
        {
        }    
    }
Esempio n. 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             AddImageUrls();
             BinDDls();
             BindData();
             SageFrameConfig sfConf = new SageFrameConfig();
             ViewState["SelectedLanguageCulture"] = sfConf.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultLanguage);
             GetLanguageList();
             GetFlagImage();
           
             //imbSave.Attributes.Add("onclick", string.Format("sageHtmlEncoder('{0}')", txtLogoTemplate.ClientID + "," + txtCopyright.ClientID));
             //txtPortalUserProfileMaxImageSize.Attributes.Add("OnKeydown", "return NumberKeyWithDecimal(event)");
             //txtPortalUserProfileMediumImageSize.Attributes.Add("OnKeydown", "return NumberKey(event)");
             //txtPortalUserProfileSmallImageSize.Attributes.Add("OnKeydown", "return NumberKey(event)");
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageExtension = SageFrameSettingKeys.PageExtension;
        SageUserControl suc = new SageUserControl();
        SageFrameConfig sfConfig = new SageFrameConfig();
        
        StartupPage = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage);
        ActiveTemplateName = TemplateName;

        InitializeCssJs();
        appPath = Request.ApplicationPath != "/" ? Request.ApplicationPath : "";     
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SageMenuAdminGlobal1", " var ServicePath='" + appPath + "';", true); 
        if (!IsPostBack)
        {
            BuildAccessControlledSelection();
            AddImageUrls();
            UserModuleID = int.Parse(SageUserModuleID);
            PortalID = GetPortalID;
            UserName = GetUsername;
            CultureCode = GetCurrentCulture();
            PageName = Path.GetFileNameWithoutExtension(PagePath);
            string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SageMenuGlobal", " var Path='" + ResolveUrl(modulePath) + "';", true);
            string pagePath = Request.ApplicationPath != "/" ? Request.ApplicationPath : "";
            pagePath = GetPortalID == 1 ? pagePath : pagePath + "/portal/" + GetPortalSEOName;
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SageMenuGlobal1", " var PagePath='" + pagePath + "';", true);

        }

    }
Esempio n. 22
0
 protected void Page_Init(object sender, EventArgs e)
 {
     SageFrameConfig sfConfig = new SageFrameConfig();
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowLogo) == "1")
     {
         LoadControl(phdLogo, "~/Controls/ctl_Logo.ascx");
         divLogo.Attributes.Add("style", "display:block;");
     }
     else
     {
         phdLogo.Controls.Clear();
         divLogo.Attributes.Add("style", "display:none;");
     }
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowSubscribe) == "1")
     {
         LoadControl(phdSubscribe, "~/Controls/ctl_Subscribe.ascx");
         divSubscribe.Attributes.Add("style", "display:block;");
     }
     else
     {
         phdSubscribe.Controls.Clear();
         divSubscribe.Attributes.Add("style", "display:none;");
     }
     if (sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalShowLoginStatus) == "1")
     {
         LoadControl(phdLoginStatus, "~/Controls/ctl_LoginStatus.ascx");
         divTopMenu.Attributes.Add("style", "display:block;");
     }
     else
     {
         phdLoginStatus.Controls.Clear();
         divTopMenu.Attributes.Add("style", "display:none;");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         IncludeCss("PortalSettings", "/Modules/Admin/PortalSettings/css/popup.css");
         if (!IsPostBack)
         {
             AddImageUrls();
             BinDDls();
             BindData();
             SageFrameConfig sfConf = new SageFrameConfig();
             ViewState["SelectedLanguageCulture"] = sfConf.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalDefaultLanguage);
             GetLanguageList();
             GetFlagImage();
         }
         RoleController _role = new RoleController();
         string[] roles = _role.GetRoleNames(GetUsername, GetPortalID).ToLower().Split(',');
         if (!roles.Contains(SystemSetting.SUPER_ROLE[0].ToLower()))
         {
             TabContainer.Tabs[2].Visible = false;
             TabContainer.Tabs[1].Visible = false;
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
Esempio n. 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             MessageTemplateDataContext dbMessageTemplate = new MessageTemplateDataContext(SystemSetting.SageFrameConnectionString);
             SageFrameConfig pb = new SageFrameConfig();
             hypGotoLogin.NavigateUrl = "~/" + pb.GetSettingsByKey(SageFrameSettingKeys.PlortalLoginpage) + ".aspx";
             hypGotoLogin.Text = GetSageMessage("UserRegistration", "GoToLogin");
             string ActivationCode = string.Empty;
             if (Request.QueryString["ActivationCode"] != null)
             {
                 ActivationCode = Request.QueryString["ActivationCode"].ToString();
                 try
                 {
                     ActivationCode = EncryptionMD5.Decrypt(ActivationCode);
                 }
                 catch
                 {
                     ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("UserRegistration", "InvalidActivationCode"), "", SageMessageType.Alert);
                 }
                 string UserName = _member.ActivateUser(ActivationCode, GetPortalID, GetStoreID);
                 if (!String.IsNullOrEmpty(UserName))
                 {
                     UserInfo user = _member.GetUserDetails(GetPortalID, UserName);
                     var messageTemplates = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_SUCCESSFUL_EMAIL, GetPortalID);
                     foreach (var messageTemplate in messageTemplates)
                     {
                         var linqActivationTokenValues = messageTokenDB.sp_GetActivationSuccessfulTokenValue(user.UserName, GetPortalID);
                         CommonFunction comm = new CommonFunction();
                         DataTable dtActivationSuccessfulTokenValues = comm.LINQToDataTable(linqActivationTokenValues);
                         string replaceMessageSubject = MessageToken.ReplaceAllMessageToken(messageTemplate.Subject, dtActivationSuccessfulTokenValues);
                         string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, dtActivationSuccessfulTokenValues);
                         MailHelper.SendMailNoAttachment(messageTemplate.MailFrom, user.Email, replaceMessageSubject, replacedMessageTemplate, string.Empty, string.Empty);
                     }
                     var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_SUCCESSFUL_INFORMATION, GetPortalID).SingleOrDefault();
                     if (template != null)
                     {
                         ACTIVATION_INFORMATION.Text = template.Body;
                     };
                     LogInPublicModeRegistration(user);
                 }
                 else
                 {
                     var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_FAIL_INFORMATION, GetPortalID).SingleOrDefault();
                     if (template != null)
                     {
                         ACTIVATION_INFORMATION.Text = template.Body;
                     };
                 }
             }
         }
         catch (Exception ex)
         {
             ProcessException(ex);
         }
     }
 }
Esempio n. 25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SageFrameConfig sfConfig = new SageFrameConfig();
         litCopyWrite.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalCopyright);
     }
 }
Esempio n. 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SageFrameConfig sfConfig = new SageFrameConfig();                
         litPortalLogoTemplate.Text = Server.HtmlDecode(sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalLogoTemplate));
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     appPath = GetApplicationName;
     SageFrameConfig pagebase = new SageFrameConfig();
     LoadLiveFeed = bool.Parse(pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.EnableLiveFeeds));
     IncludeJs("SageFrameInfo", "/js/jquery.jgfeed-min.js");
     IncludeCss("SageFrameInfo", "/Modules/Admin/SageFrameInfo/module.css");
 }
Esempio n. 28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SageFrameConfig sfConfig = new SageFrameConfig();
         litCopyWrite.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalCopyright);
     }
 }
        public static void SendMultipleEmail(string From, string sendTo, string Subject, string Body)
        {
            SageFrameConfig sfConfig = new SageFrameConfig();
            string ServerPort = sfConfig.GetSettingsByKey(SageFrameSettingKeys.SMTPServer);
            string SMTPAuthentication = sfConfig.GetSettingsByKey(SageFrameSettingKeys.SMTPAuthentication);
            string SMTPEnableSSL = sfConfig.GetSettingsByKey(SageFrameSettingKeys.SMTPEnableSSL);
            string SMTPPassword = sfConfig.GetSettingsByKey(SageFrameSettingKeys.SMTPPassword);
            string SMTPUsername = sfConfig.GetSettingsByKey(SageFrameSettingKeys.SMTPUsername);
            string[] SMTPServer = ServerPort.Split(':');
            try
            {
                MailMessage myMessage = new MailMessage();
                foreach (string emailTo in sendTo.Split(','))
                {
                    myMessage.To.Add(new MailAddress(emailTo));
                }
                myMessage.From = new MailAddress(From);
                myMessage.Subject = Subject;
                myMessage.Body = Body;
                myMessage.IsBodyHtml = true;

                SmtpClient smtp = new SmtpClient();
                if (SMTPAuthentication == "1")
                {
                    if (SMTPUsername.Length > 0 && SMTPPassword.Length > 0)
                    {
                        smtp.Credentials = new System.Net.NetworkCredential(SMTPUsername, SMTPPassword);
                    }
                }
                smtp.EnableSsl = bool.Parse(SMTPEnableSSL.ToString());
                if (SMTPServer.Length > 0)
                {
                    if (SMTPServer[0].Length != 0)
                    {
                        smtp.Host = SMTPServer[0];
                        if (SMTPServer.Length == 2)
                        {
                            smtp.Port = int.Parse(SMTPServer[1]);
                        }
                        else
                        {
                            smtp.Port = 25;
                        }
                        smtp.Send(myMessage);
                    }
                    else
                    {
                        throw new Exception("SMTP Host must be provided");
                    }
                }

            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            try
            {
                if (Session["OrderID"] != null)
                {
                    orderID = int.Parse(Session["OrderID"].ToString());
                }

                var sfConfig = new SageFrameConfig();
                _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
                PageExtension = SageFrameSettingKeys.PageExtension;
                string sageRedirectPath;
                if (_isUseFriendlyUrls)
                {
                    if (!IsParent)
                    {
                        sageRedirectPath = ResolveUrl(GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/";
                    }
                    else
                    {
                        sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + PageExtension);
                        _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";
                    }
                }
                else
                {
                    sageRedirectPath = ResolveUrl("{~/Default" + PageExtension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
                }

                var imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true);
                }
                hlnkHomePage.NavigateUrl = sageRedirectPath;

                 
                IncludeLanguageJS();
                if (Session["mb_IsCheckoutFromMobile"] != null)
                {
                    MobileSuccess(sageRedirectPath);
                }else
                {
                    WebSuccess(sageRedirectPath);
                }
            }
            catch (Exception ex)
            {

                ProcessException(ex);
            }
        }
    }
Esempio n. 31
0
 public void SendEmail(string senderEmail, string receiverEmail, string subject, string message)
 {
     string emailSuperAdmin;
     string emailSiteAdmin;
     SageFrameConfig pagebase = new SageFrameConfig();
     emailSuperAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail);
     emailSiteAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress);
     MailHelper.SendMailNoAttachment(senderEmail, receiverEmail, subject, message, emailSiteAdmin, emailSuperAdmin);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                IncludeCss("messagecss", "/Templates/" + TemplateName + "/css/MessageBox/style.css",
                    "/Modules/AspxCommerce/AspxServiceItems/css/ServiceItems.css");
                IncludeJs("messagejs", "/js/MessageBox/alertbox.js");
                var sfConfig = new SageFrameConfig();
                _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);

                if (_isUseFriendlyUrls)
                {
                    if (GetPortalID > 1)
                    {
                        _sageRedirectPath =
                            ResolveUrl("~/portal/" + GetPortalSEOName + "/" +sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + SageFrameSettingKeys.PageExtension);
                        _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" +GetPortalSEOName + "/";

                    }
                    else
                    {
                        _sageRedirectPath =
                            ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) +
                                       SageFrameSettingKeys.PageExtension);
                        _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";

                    }
                }
                else
                {
                    _sageRedirectPath =
                        ResolveUrl("{~/Default" + SageFrameSettingKeys.PageExtension + "?ptlid=" + GetPortalID +
                                   "&ptSEO=" + GetPortalSEOName + "&pgnm=" +
                                   sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
                }

                var imgProgress = (Image) UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true);
                }
                hlnkHomePage.NavigateUrl = _sageRedirectPath;

                StoreSettingConfig ssc = new StoreSettingConfig();
                                            
                StoreLogoUrl = ssc.GetStoreSettingsByKey(StoreSetting.StoreLogoURL, GetStoreID, GetPortalID, GetCurrentCultureName);
                SendConfrimMessage();
            }
            IncludeLanguageJS();
        }
        catch(Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 33
0
        protected void ProcessException(Exception exc)
        {
            ErrorLogDataContext db = new ErrorLogDataContext(SystemSetting.SageFrameConnectionString);

            System.Nullable <int> inID = 0;
            db.sp_LogInsert(ref inID, (int)SageFrame.Web.SageFrameEnums.ErrorType.CommonError, 11, exc.Message, exc.ToString(),
                            HttpContext.Current.Request.UserHostAddress, Request.RawUrl, true, GetPortalID, GetUsername);
            SageFrameConfig pagebase = new SageFrameConfig();

            if (pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseCustomErrorMessages))
            {
                ShowMessage(SageMessageTitle.Exception.ToString(), exc.Message, exc.ToString(), SageMessageType.Error);
            }
        }
        public void SetSessionTrackerValues(string portalID, string userName)
        {
            SessionTracker sessionTracker = (SessionTracker)HttpContext.Current.Session[SessionKeys.Tracker];

            if (string.IsNullOrEmpty(sessionTracker.PortalID))
            {
                sessionTracker.PortalID = portalID;
                sessionTracker.Username = userName;
                SageFrameConfig sfConfig = new SageFrameConfig();
                sessionTracker.InsertSessionTrackerPages = sfConfig.GetSettingsByKey(SageFrameSettingKeys.InsertSessionTrackingPages);
                SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog();
                SLog.SessionTrackerUpdateUsername(sessionTracker, userName, portalID);
                HttpContext.Current.Session[SessionKeys.Tracker] = sessionTracker;
            }
        }
        /// <summary>
        /// Handles the exception and records in the log
        /// </summary>
        /// <param name="exc">exception</param>
        protected void ProcessException(Exception exc)
        {
            int inID = 0;
            ErrorLogController objController = new ErrorLogController();

            inID = objController.InsertLog((int)SageFrame.Web.SageFrameEnums.ErrorType.AdministrationArea, 11, exc.Message, exc.ToString(),
                                           HttpContext.Current.Request.UserHostAddress, Request.RawUrl, true, GetPortalID, GetUsername);

            SageFrameConfig pagebase = new SageFrameConfig();

            if (pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseCustomErrorMessages))
            {
                ShowMessage(SageMessageTitle.Exception.ToString(), exc.Message, exc.ToString(), SageMessageType.Error);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="RedirectUrl"></param>
        /// <param name="IsSupress"></param>
        /// <param name="ExtensionMessage"></param>
        public void ProcessCancelRequestBase(string RedirectUrl, bool IsSupress, string ExtensionMessage)
        {
            string          strURL            = string.Empty;
            SageFrameConfig pagebase          = new SageFrameConfig();
            bool            IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);

            if (!IsUseFriendlyUrls)
            {
                string[] arrUrl;
                arrUrl = Request.RawUrl.Split('&');
                if (arrUrl.Length > 0)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        strURL += arrUrl[i] + "&";
                    }
                    strURL = strURL.Remove(strURL.LastIndexOf('&'));
                }
            }
            else
            {
                if (RedirectUrl.Contains("?"))
                {
                    string[] d = RedirectUrl.Split('?');
                    strURL = d[0];
                }
            }
            if (strURL.Contains("?"))
            {
                strURL += "&ExtensionMessage=" + ExtensionMessage;
            }
            else if (strURL.Contains("&"))
            {
                strURL += "&ExtensionMessage=" + ExtensionMessage;
            }
            else
            {
                strURL += "?ExtensionMessage=" + ExtensionMessage;
            }

            HttpContext.Current.Response.Redirect(strURL, IsSupress);
        }
Esempio n. 37
0
        /// <summary>
        /// Get Page SEO Name By Page Path
        /// </summary>
        /// <param name="pagePath">Page Path</param>
        /// <returns>Page SEO Name</returns>
        public string GetPageSEOName(string pagePath)
        {
            string SEOName = string.Empty;

            if (string.IsNullOrEmpty(pagePath))
            {
                SageFrameConfig sfConfig = new SageFrameConfig();
                SEOName = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage);
            }
            else
            {
                string[] pagePaths = pagePath.Split('/');
                SEOName = pagePaths[pagePaths.Length - 1];
                if (string.IsNullOrEmpty(SEOName))
                {
                    SEOName = pagePaths[pagePaths.Length - 2];
                }
                SEOName = SEOName.Replace(SageFrameSettingKeys.PageExtension, string.Empty);
            }
            return(SEOName);
        }
        public bool LogWCFException(Exception exc)
        {
            string strIPaddress = string.Empty;
            string strPageUrl   = string.Empty;

            if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.UserHostAddress != string.Empty)
            {
                strIPaddress = HttpContext.Current.Request.UserHostAddress;
            }

            if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.RawUrl != string.Empty)
            {
                strPageUrl = HttpContext.Current.Request.RawUrl;
            }
            ErrorLogDataContext db = new ErrorLogDataContext(SystemSetting.SageFrameConnectionString);

            System.Nullable <int> inID     = 0;
            SageFrameConfig       sfConfig = new SageFrameConfig();

            db.sp_LogInsert(ref inID, (int)SageFrameEnums.ErrorType.WCF, 11, exc.Message, exc.ToString(),
                            strIPaddress, strPageUrl, true, sfConfig.GetPortalID, sfConfig.GetUsername);
            return(sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseCustomErrorMessages));
        }
Esempio n. 39
0
        /// <summary>
        /// Checks if the requested request  is from handheld device.
        /// </summary>
        /// <returns>Returns "True" if the device is handheld</returns>
        public bool IsHandheld()
        {
            SageFrameConfig sfConf  = new SageFrameConfig();
            string          GetMode = sfConf.GetSettingValueByIndividualKey(SageFrameSettingKeys.UserAgentMode);
            bool            status  = false;

            if (GetMode == "3")
            {
                string strUserAgent = Request.UserAgent.ToString().ToLower();
                if (strUserAgent != null)
                {
                    if (Request.Browser.IsMobileDevice == true ||
                        strUserAgent.Contains("mobile"))
                    //if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") ||
                    //    strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") ||
                    //    strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") ||
                    //    strUserAgent.Contains("palm"))
                    {
                        status = true;
                    }
                }
            }
            else
            {
                int Mode = 0;
                Mode = int.Parse(GetMode);
                if (Mode == 2)
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
            }
            return(status);
        }