private void SagePageLoadPart() { if (!IsPostBack) { string sageNavigateUrl = string.Empty; SageFrameConfig sfConfig = new SageFrameConfig(); if (!IsParent) { sageNavigateUrl = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-"); } else { sageNavigateUrl = GetParentURL + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-"); } hypPreview.NavigateUrl = sageNavigateUrl; Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true); } } ////SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker]; //if (string.IsNullOrEmpty(sessionTracker.PortalID)) //{ // //sessionTracker.PortalID = GetPortalID.ToString(); // //sessionTracker.Username = GetUsername; // SageFrameConfig sfConfig = new SageFrameConfig(); // //sessionTracker.InsertSessionTrackerPages = sfConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.InsertSessionTrackingPages); // SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog(); // SLog.SessionTrackerUpdateUsername(sessionTracker, GetUsername, GetPortalID.ToString()); // //Session[SessionKeys.Tracker] = sessionTracker; //} }
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); } } }
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; } }
protected void Page_Load(object sender, EventArgs e) { try { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.UserName = GetUsername; aspxCommonObj.CultureName = GetCurrentCultureName; if (!IsPostBack) { if (Session["OrderID"] != null) { orderID = int.Parse(Session["OrderID"].ToString()); } var sfConfig = new SageFrameConfig(); _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); if (_isUseFriendlyUrls) { if (!IsParent) { _sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); } else { _sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); } } else { _sageRedirectPath = ResolveUrl("{~/Default.aspx?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; SendEmailFrom = StoreSetting.GetStoreSettingValueByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName); SendOrderNotice = StoreSetting.GetStoreSettingValueByKey(StoreSetting.SendOrderNotification, GetStoreID, GetPortalID, GetCurrentCultureName); SendConfrimMessage(); } IncludeLanguageJS(); } catch (Exception ex) { ProcessException(ex); } }
private void SagePageLoadPart() { LoadGlobalVariables(); if (!IsPostBack) { hypHome.NavigateUrl = sageNavigateUrl; hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); hypHome.ImageUrl = GetTemplateImageUrl("home.png", true); hypPreview.NavigateUrl = hypHome.NavigateUrl; Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true); } bool IsAdmin = false; if (HttpContext.Current.User != null) { MembershipUser user = Membership.GetUser(); if (user != null) { string[] sysRoles = SystemSetting.SYSTEM_SUPER_ROLES; foreach (string role in sysRoles) { if (Roles.IsUserInRole(user.UserName, role)) { IsAdmin = true; break; } } } } if (IsAdmin) { divAdminControlPanel.Attributes.Add("style", "display:block"); } else { divAdminControlPanel.Attributes.Add("style", "display:none"); } Session["payMentGateWayRefresh"] = Server.UrlEncode(System.DateTime.Now.ToString()); } SessionTracker sessionTracker = (SessionTracker)Session["Tracker"]; if (string.IsNullOrEmpty(sessionTracker.PortalID)) { sessionTracker.PortalID = GetPortalID.ToString(); sessionTracker.Username = GetUsername; SageFrameConfig sfConfig = new SageFrameConfig(); sessionTracker.InsertSessionTrackerPages = sfConfig.GetSettingsByKey(SageFrameSettingKeys.InsertSessionTrackingPages); SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog(); SLog.SessionTrackerUpdateUsername(sessionTracker, GetUsername, GetPortalID.ToString()); Session["Tracker"] = sessionTracker; } }
private void DeleteTopic(int topicid) { var lbl = UpdateProgress1.FindControl("lblProgress"); if (lbl != null) { ((Label)lbl).Text = "Deleting Topic"; } Topics.Delete(topicid); InvalidateCache(); ForumTable.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { var sfConfig = new SageFrameConfig(); _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); if (_isUseFriendlyUrls) { if (GetPortalID > 1) { _sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/"; } else { _sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); _addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/"; } } else { _sageRedirectPath = ResolveUrl("{~/Default.aspx?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; var ssc = new StoreSettingConfig(); SendEmailFrom = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName); SendOrderNotice = ssc.GetStoreSettingsByKey(StoreSetting.SendOrderNotification, GetStoreID, GetPortalID, GetCurrentCultureName); SendConfrimMessage(); } IncludeLanguageJS(); } catch { } }
private void SagePageLoadPart() { try { CreateGlobalVariables(); if (!IsPostBack) { hypHome.NavigateUrl = sageNavigateUrl; hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); hypHome.ImageUrl = GetTemplateImageUrl("home.png", true); hypPreview.NavigateUrl = hypHome.NavigateUrl; Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true); } } if ((SessionTracker)Session["Tracker"] != null) { SessionTracker sessionTracker = (SessionTracker)Session["Tracker"]; if (string.IsNullOrEmpty(sessionTracker.PortalID)) { sessionTracker.PortalID = GetPortalID.ToString(); sessionTracker.Username = GetUsername; SageFrameConfig sfConfig = new SageFrameConfig(); sessionTracker.InsertSessionTrackerPages = sfConfig.GetSettingsByKey(SageFrameSettingKeys.InsertSessionTrackingPages); SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog(); SLog.SessionTrackerUpdateUsername(sessionTracker, GetUsername, GetPortalID.ToString()); SLog.StoreSessionTrackerAdd(sessionTracker, GetStoreID, GetPortalID); Session["Tracker"] = sessionTracker; } } //if ((StoreSettingInfo)Session["DefaultStoreSettings"] == null) //{ // AspxCommerceWebService AspxCommerceWebService = new AspxCommerceWebService(); // StoreSettingInfo DefaultStoreSettings = AspxCommerceWebService.GetAllStoreSettings(GetStoreID, GetPortalID, GetCurrentCultureName); // Session["DefaultStoreSettings"] = DefaultStoreSettings; //} } catch { } }
private void SagePageLoadPart() { SetGlobalVariables(); if (!IsPostBack) { hypHome.NavigateUrl = sageNavigateUrl; hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); hypHome.ImageUrl = GetTemplateImageUrl("home.png", true); hypPreview.NavigateUrl = hypHome.NavigateUrl; Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true); } if (HttpContext.Current.Request.QueryString["ManageReturnUrl"] != null) { if (IsUseFriendlyUrls) { btnBack.PostBackUrl = HttpContext.Current.Request.QueryString["ManageReturnUrl"].ToString(); } else { string strURL = string.Empty; string[] keys = Request.QueryString.AllKeys; for (int i = 0; i < Request.QueryString.Count; i++) { string[] values = Request.QueryString.GetValues(i); if (keys[i] != "ActInd" && keys[i] != "pgid" && keys[i] != "ManageReturnUrl" && keys[i] != "CtlType" && keys[i] != "ActInd" && keys[i] != "umid") { strURL += keys[i] + '=' + values[0] + '&'; } } if (strURL.Length > 0) { strURL = strURL.Remove(strURL.LastIndexOf('&')); } btnBack.PostBackUrl = HttpContext.Current.Request.QueryString["ManageReturnUrl"].ToString() + "?" + strURL; } btnBackTop.PostBackUrl = btnBack.PostBackUrl; } } }
private void SagePageLoadPart() { if (!IsPostBack) { string sageNavigateUrl = string.Empty; SageFrameConfig sfConfig = new SageFrameConfig(); if (IsUseFriendlyUrls) { if (GetPortalID > 1) { sageNavigateUrl = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + Extension); } else { sageNavigateUrl = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + Extension); } } else { sageNavigateUrl = ResolveUrl("~/Default" + Extension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-")); } hypPreview.NavigateUrl = sageNavigateUrl; Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true); } } SessionTracker sessionTracker = (SessionTracker)Session[SessionKeys.Tracker]; if (string.IsNullOrEmpty(sessionTracker.PortalID)) { sessionTracker.PortalID = GetPortalID.ToString(); sessionTracker.Username = GetUsername; SageFrameConfig sfConfig = new SageFrameConfig(); sessionTracker.InsertSessionTrackerPages = sfConfig.GetSettingsByKey(SageFrameSettingKeys.InsertSessionTrackingPages); SageFrame.Web.SessionLog SLog = new SageFrame.Web.SessionLog(); SLog.SessionTrackerUpdateUsername(sessionTracker, GetUsername, GetPortalID.ToString()); Session[SessionKeys.Tracker] = sessionTracker; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { SageFrameConfig sfConfig = new SageFrameConfig(); IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); string sageRedirectPath = string.Empty; if (IsUseFriendlyUrls) { if (GetPortalID > 1) { sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/"; } else { sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/"; } } else { sageRedirectPath = ResolveUrl("{~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage)); } Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true); } hlnkHomePage.NavigateUrl = sageRedirectPath; OrderDetailsCollection orderdata = new OrderDetailsCollection(); AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.CustomerID = GetCustomerID; aspxCommonObj.SessionCode = HttpContext.Current.Session.SessionID; aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.CultureName = GetCurrentCultureName; aspxCommonObj.UserName = GetUsername; if (Session["OrderID"] != null) { orderID = int.Parse(Session["OrderID"].ToString()); int storeID = int.Parse(GetStoreID.ToString()); int portalID = int.Parse(GetPortalID.ToString()); string userName = GetUsername.ToString(); int customerID = int.Parse(GetCustomerID.ToString()); transID = GetTransactionDetailById(int.Parse(Session["OrderID"].ToString())); if (HttpContext.Current.Session["OrderCollection"] != null) { orderdata = (OrderDetailsCollection)HttpContext.Current.Session["OrderCollection"]; AspxGiftCardController.IssueGiftCard(orderdata.LstOrderItemsInfo, false, aspxCommonObj); if (orderdata.GiftCardDetail != null && HttpContext.Current.Session["UsedGiftCard"] != null) { //updating giftcard used in chekout AspxGiftCardController.UpdateGiftCardUsage(orderdata.GiftCardDetail, orderdata.ObjCommonInfo.StoreID, orderdata.ObjCommonInfo.PortalID, orderdata.ObjOrderDetails.OrderID, orderdata.ObjCommonInfo.AddedBy, orderdata.ObjCommonInfo.CultureName); HttpContext.Current.Session.Remove("UsedGiftCard"); } invoice = orderdata.ObjOrderDetails.InvoiceNumber; orderdata.ObjOrderDetails.OrderStatus = "Successful"; EmailTemplate.SendEmailForOrder(portalID, orderdata, addressPath, TemplateName, transID); } lblTransaction.Text = transID; lblPaymentMethod.Text = "GoogleCheckOut"; lblDateTime.Text = DateTime.Now.ToString("dddd, dd MMMM yyyy "); lblInvoice.Text = invoice; ClearAllSession(); } else { Response.Redirect(sageRedirectPath, false); } IncludeLanguageJS(); } catch (Exception ex) { ProcessException(ex); } } }
private void SagePageLoadPart() { if (!IsPostBack) { string sageNavigateUrl = string.Empty; SageFrameConfig sfConfig = new SageFrameConfig(); if (!IsParent) { sageNavigateUrl = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension; } else { sageNavigateUrl = GetParentURL + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension; } hypHome.NavigateUrl = sageNavigateUrl;//GetHostURL + "/Admin/Admin" + Extension; // hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); //hypHome.ImageUrl = GetAdminImageUrl("home.png", true); hypPreview.NavigateUrl = sageNavigateUrl; lnkAccount.NavigateUrl = GetProfileLink(sfConfig); Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true); } // bool IsAdmin = false; SecurityPolicy objSecurity = new SecurityPolicy(); FormsAuthenticationTicket ticket = objSecurity.GetUserTicket(GetPortalID); if (ticket != null) { int LoggedInPortalID = int.Parse(ticket.UserData.ToString()); if (ticket.Name != ApplicationKeys.anonymousUser) { string[] sysRoles = SystemSetting.SYSTEM_SUPER_ROLES; this.hypUpgrade.Visible = IsParent ? (Roles.IsUserInRole(ticket.Name, sysRoles[1]) ? true : false) : false; if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(ticket.Name, sysRoles[0])) { RoleController _role = new RoleController(); string userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID); if (userinroles != "" || userinroles != null) { bool isDashboardAccessible = _role.IsDashboardAccesible(GetUsername, GetPortalID); foreach (string role in sysRoles) { if (userinroles.ToLower() == role) { isDashboardAccessible = true; } } if (!isDashboardAccessible) { divAdminControlPanel.Visible = false; } } else { divAdminControlPanel.Visible = false; } } else { divAdminControlPanel.Visible = false; } } else { divAdminControlPanel.Visible = false; } } if (IsHandheld()) { divAdminControlPanel.Visible = false; } } //SessionTrackerController sTracController = new SessionTrackerController(); //sTracController.SetSessionTrackerValues(GetPortalID.ToString(), GetUsername); }
//public string ControlIDPopup //{ // set { this.mpeLoading.TargetControlID = value; } //} #endregion #region MEDOTO SHOW POPUP //public void ShowPopup() //{ // this.mpeLoading.Show(); //} #endregion #region MEDOTO HIDE POPUP //public void HidePopup() //{ // this.mpeLoading.Hide(); //} #endregion #region PAGE LOAD DEL CONTROL protected void Page_Load(object sender, EventArgs e) { AjaxControlToolkit.ModalPopupExtender mpe = (AjaxControlToolkit.ModalPopupExtender)UpdateProgress1.FindControl("pnlLoading_ModalPopupExtender"); mpe.Enabled = true; mpe.Show(); }
protected void Page_Load(object sender, EventArgs e) { try { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.UserName = GetUsername; aspxCommonObj.CultureName = GetCurrentCultureName; if (!IsPostBack) { if (Session["OrderID"] != null) { orderID = int.Parse(Session["OrderID"].ToString()); } StoreSettingConfig ssc = new StoreSettingConfig(); AspxCoreController acc = new AspxCoreController(); MainCurrency = ssc.GetStoreSettingsByKey(StoreSetting.MainCurrency, GetPortalID, GetPortalID, GetCurrentCultureName); if (Session["CurrencyCode"] != null && Session["CurrencyCode"] != "") { SelectedCurrency = Session["CurrencyCode"].ToString(); } else { SelectedCurrency = MainCurrency; } if (Session["Region"] != null && Session["Region"] != "") { Region = Session["Region"].ToString(); } else { Region = StoreSetting.GetRegionFromCurrencyCode(SelectedCurrency, GetStoreID, GetPortalID); } currencyRate = Convert.ToDecimal(acc.GetCurrencyRateOnChange(aspxCommonObj, MainCurrency, SelectedCurrency, Region)); var sfConfig = new SageFrameConfig(); _isUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); PageExtension = SageFrameSettingKeys.PageExtension; 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; SendEmailFrom = ssc.GetStoreSettingsByKey(StoreSetting.SendEcommerceEmailsFrom, GetStoreID, GetPortalID, GetCurrentCultureName); SendOrderNotice = ssc.GetStoreSettingsByKey(StoreSetting.SendOrderNotification, GetStoreID, GetPortalID, GetCurrentCultureName); if (Session["mb_IsCheckoutFromMobile"] != null) { MobileSuccess(_sageRedirectPath); } else { SendConfrimMessage(_sageRedirectPath); } } IncludeLanguageJS(); } catch (Exception ex) { ProcessException(ex); } }
private void SagePageLoadPart() { if (!IsPostBack) { string sageNavigateUrl = string.Empty; SageFrameConfig sfConfig = new SageFrameConfig(); if (IsUseFriendlyUrls) { if (GetPortalID > 1) { sageNavigateUrl = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension); } else { sageNavigateUrl = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension); } } else { sageNavigateUrl = ResolveUrl("~/Default" + Extension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-")); } hypHome.NavigateUrl = sageNavigateUrl; hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); hypHome.ImageUrl = GetAdminImageUrl("home.png", true); hypPreview.NavigateUrl = sageNavigateUrl; lnkAccount.NavigateUrl = GetProfileLink(sfConfig); Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true); } // bool IsAdmin = false; FormsAuthenticationTicket ticket = SecurityPolicy.GetUserTicket(GetPortalID); if (ticket != null) { int LoggedInPortalID = int.Parse(ticket.UserData.ToString()); if (ticket.Name != ApplicationKeys.anonymousUser) { string[] sysRoles = SystemSetting.SUPER_ROLE; this.hypUpgrade.Visible = Roles.IsUserInRole(ticket.Name, sysRoles[0]) ? true : false; if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(ticket.Name, sysRoles[0])) { RoleController _role = new RoleController(); string userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID); if (userinroles != "" || userinroles != null) { divAdminControlPanel.Attributes.Add("style", "display:block"); ////foreach (string role in sysRoles) ////{ //// if (Roles.IsUserInRole(user.UserName, role)) //// { //// IsAdmin = true; //// break; //// } ////} } else { divAdminControlPanel.Attributes.Add("style", "display:none"); } } else { divAdminControlPanel.Attributes.Add("style", "display:none"); } } else { divAdminControlPanel.Attributes.Add("style", "display:none"); } } if (IsHandheld()) { divAdminControlPanel.Attributes.Add("style", "display:none"); } } SessionTrackerController sTracController = new SessionTrackerController(); sTracController.SetSessionTrackerValues(GetPortalID.ToString(), GetUsername); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { SageFrameConfig sfConfig = new SageFrameConfig(); IsUseFriendlyUrls = sfConfig.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); string sageRedirectPath = string.Empty; if (IsUseFriendlyUrls) { if (GetPortalID > 1) { sageRedirectPath = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/portal/" + GetPortalSEOName + "/"; } else { sageRedirectPath = ResolveUrl("~/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx"); addressPath = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/"; } } else { sageRedirectPath = ResolveUrl("{~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage)); } Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress"); if (imgProgress != null) { imgProgress.ImageUrl = GetTemplateImageUrl("ajax-loader.gif", true); } hlnkHomePage.NavigateUrl = sageRedirectPath; if (Session["OrderID"] != null) { int storeID = int.Parse(GetStoreID.ToString()); int portalID = int.Parse(GetPortalID.ToString()); string userName = GetUsername.ToString(); int customerID = int.Parse(GetCustomerID.ToString()); OrderDetailsCollection orderdata = new OrderDetailsCollection(); List <PayPalSettingInfo> setting; if (HttpContext.Current.Session["OrderCollection"] != null) { orderdata = (OrderDetailsCollection)HttpContext.Current.Session["OrderCollection"]; invoice = orderdata.ObjOrderDetails.InvoiceNumber.ToString(); PayPalWCFService pw = new PayPalWCFService(); int i = int.Parse(orderdata.ObjOrderDetails.PaymentGatewayTypeID.ToString()); setting = pw.GetAllPayPalSetting(i, storeID, portalID); authToken = setting[0].AuthToken.ToString(); } // authToken = "QMtOC54_YHYUkoggkMZ81ivNWSxPXduIqS5oMynafeUGRL1Rv5OTtUd4rvq"; //read in txn token from querystring txToken = Request.QueryString.Get("tx"); query = string.Format("cmd=_notify-synch&tx={0}&at={1}", txToken, authToken); // Create the request back // string url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strSandbox = "https://www.sandbox.paypal.com/cgi-bin/webscr"; string strLive = "https://www.paypal.com/cgi-bin/webscr"; string test = string.Empty; if (Session["IsTestPayPal"] != null) { if (bool.Parse(Session["IsTestPayPal"].ToString())) { test = strSandbox; } else { test = strLive; } } HttpWebRequest req = (HttpWebRequest)WebRequest.Create(test); // Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = query.Length; // Write the request back IPN strings StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); stOut.Write(query); stOut.Close(); // Do the request to PayPal and get the response StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream()); strResponse = stIn.ReadToEnd(); stIn.Close(); // If response was SUCCESS, parse response string and output details if (strResponse.StartsWith("SUCCESS")) { string sessionCode = HttpContext.Current.Session.SessionID.ToString(); //for localhost // PayPalHandler pdt = PayPalHandler.Parse(strResponse, storeID, portalID, userName, customerID, sessionCode); //for live site try { PayPalHandler pdtt = PayPalHandler.ParseAfterIPN(strResponse, storeID, portalID, userName, customerID, sessionCode, TemplateName, addressPath); } catch (Exception) { lblerror.Text = GetSageMessage("Payment", "PaymentParsingIPNError"); } AspxCommerceWebService clSes = new AspxCommerceWebService(); String sKey, sValue; String[] StringArray = strResponse.Split('\n'); int i; string status = string.Empty; for (i = 1; i < StringArray.Length - 1; i++) { String[] StringArray1 = StringArray[i].Split('='); sKey = StringArray1[0]; sValue = HttpUtility.UrlDecode(StringArray1[1]); // set string vars to hold variable names using a switch switch (sKey) { case "txn_id": transID = Convert.ToString(sValue); break; case "payment_status": status = Convert.ToString(sValue); break; } } lblTransaction.Text = transID; lblInvoice.Text = invoice; lblPaymentMethod.Text = "Paypal"; lblDateTime.Text = DateTime.Now.ToString("dddd, dd MMMM yyyy "); if (status.ToLower().Trim() == "completed") { lblerror.Text = GetSageMessage("Payment", "PaymentProcessed"); } else if (status.ToLower().Trim() == "pending") { lblerror.Text = GetSageMessage("Payment", "PaymentPending"); } if (Session["IsFreeShipping"] != null) { clSes.ClearSessionVariable("IsFreeShipping"); } if (Session["DiscountAmount"] != null) { clSes.ClearSessionVariable("DiscountAmount"); } if (Session["CouponCode"] != null) { clSes.ClearSessionVariable("CouponCode"); } if (Session["CouponApplied"] != null) { HttpContext.Current.Session.Remove("CouponApplied"); } Session.Remove("IsTestPayPal"); if (Session["DiscountAll"] != null) { HttpContext.Current.Session.Remove("DiscountAll"); } if (Session["TaxAll"] != null) { HttpContext.Current.Session.Remove("TaxAll"); } if (Session["ShippingCostAll"] != null) { HttpContext.Current.Session.Remove("ShippingCostAll"); } if (Session["GrandTotalAll"] != null) { HttpContext.Current.Session.Remove("GrandTotalAll"); } if (Session["Gateway"] != null) { HttpContext.Current.Session.Remove("Gateway"); } } else { lblerror.Text = GetSageMessage("Payment", "PaymentError"); } } else { Response.Redirect(sageRedirectPath, false); } } catch (Exception ex) { ProcessException(ex); } } }