protected void Page_Init(object sender, EventArgs e) { //Page.RegisterStartupScript("ScriptDescription", "<script type=\"text/javascript\"> alert('" + Request.Url.ToString() + "');</script>"); try { StateManager stateManager = StateManager.Instance; MiscellaneousController objMisc = new MiscellaneousController(); //-- Ashu(June2,2011) : Changes for jquery conflict issues & Javascript exception if (!(Request.Url.AbsolutePath.ToLower().EndsWith("managephotoalbum.aspx"))) { DivScript.Visible = true; divModalboxscript.Visible = true; } else { DivScript.Visible = false; divModalboxscript.Visible = false; } app_domin = WebConfig.AppBaseDomain; // to avoid redirection for create photo album page if (!(Request.Url.AbsolutePath.ToLower().EndsWith("managephotoalbum.aspx"))) { //if Tribute Type and Tribute Url are in querystring #region LHK:Redirection to upgradedUrl if (!this.IsPostBack) { Tributes objTrb = new Tributes(); //GetUpgradedUrl if ((Request.QueryString["TributeUrl"] != null)) { _tributeUrl = Request.QueryString["TributeUrl"].ToString(); objTrb.TributeUrl = _tributeUrl = Request.QueryString["TributeUrl"].ToString(); if (Request.QueryString["TributeType"] != null) { objTrb.TypeDescription = Request.QueryString["TributeType"].ToString(); } else if (Session["PhotoAlbumTributeSession"] != null) { objTrb = Session["PhotoAlbumTributeSession"] as Tributes; if (objTrb != null) if (string.IsNullOrEmpty(objTrb.TypeDescription)) Session["TributeType"] = objTrb.TypeDescription; } objTrb = objMisc.GetTributeUrlOnOldTributeUrl(objTrb, WebConfig.ApplicationType.ToString()); if (Request.QueryString["TributeType"] != null) { objTrb.TypeDescription = Request.QueryString["TributeType"].ToString(); } if (objTrb != null) { if (objTrb.TributeUrl != null) { if (!(string.IsNullOrEmpty(objTrb.TributeUrl.ToString())) && (!(_tributeUrl.Equals(objTrb.TributeUrl.ToString())))) { url = GetRedirectUrl(); Response.Redirect(url, true); } } } } } #endregion #region For Image uploader redirection //LHK: redirection from main domain to subdomain- for image uploader if (!(WebConfig.ApplicationMode.Equals("local"))) { if (Request.QueryString["Type"] != null && Request.QueryString["TributeUrl"] != null) { RediectUsingQueryString(); } else { RedirectUsingSession(); } } if (WebConfig.ApplicationMode.Equals("local")) { if (Request.QueryString["mode"] != null && Request.QueryString["TributeUrl"] != null) { if (Request.QueryString["mode"].ToString() == "Create") { if (FacebookWebContext.Current.Session != null) { url = WebConfig.AppBaseDomain + Request.QueryString["TributeUrl"].ToString() + "/photos.aspx?post_on_facebook=True"; } else { url = WebConfig.AppBaseDomain + Request.QueryString["TributeUrl"].ToString() + "/photos.aspx"; } } else if (Request.QueryString["mode"].ToString() == "AddPhotos") { url = WebConfig.AppBaseDomain + Request.QueryString["TributeUrl"].ToString() + "/photoalbum.aspx?photoAlbumId=" + Request.QueryString["AlbumId"].ToString(); } if (!string.IsNullOrEmpty(url)) Response.Redirect(url, false); } } #endregion } Tributes objTribute = new Tributes(); if ((Request.QueryString["TributeUrl"] != null) && (Request.QueryString["TributeType"] != null)) { objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString(); objTribute.TypeDescription = Request.QueryString["TributeType"].ToString(); stateManager.Add("TributeSession", objMisc.GetTributeSessionForUrlAndType(objTribute, WebConfig.ApplicationType.ToString()), TributesPortal.Utilities.StateManager.State.Session); } else if (Request.QueryString["TributeUrl"] != null) { objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString(); if (Session["TributeType"] != null) objTribute.TypeDescription = Session["TributeType"].ToString(); else objTribute.TypeDescription = null; stateManager.Add("TributeSession", objMisc.GetTributeSessionForUrlAndType(objTribute, WebConfig.ApplicationType.ToString()), TributesPortal.Utilities.StateManager.State.Session); } Tributes objTrib = (Tributes)stateManager.Get("TributeSession", StateManager.State.Session); if (objTrib != null) { if (objTrib.CreatedDate != null) Session["TributeCreatedDate"] = objTrib.CreatedDate; if (objTrib.TributeUrl != null) Session["TributeURL"] = objTrib.TributeUrl; } TributePackage objpackage = new TributePackage(); objpackage.UserTributeId = objTribute.TributeId; object[] param = { objpackage }; objMisc.TriputePackageInfo(param); if (objpackage.CustomError == null) { _packageId = objpackage.PackageId; if (_packageId != 1 && objpackage.EndDate != null) { _endDate = (DateTime)objpackage.EndDate; Session["tributeEndDate"] = _endDate; } } } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(Photo_PhotoView)); this.Form.Action = Request.RawUrl; try { //LHK: 3:59 PM 9/5/2011 - Wordpress topURL if (Request.QueryString["topurl"] != null) { _TopUrl = Request.QueryString["topurl"].ToString(); Response.Cookies["topurl"].Value = _TopUrl; Response.Cookies["topurl"].Domain = _TopUrl; Response.Cookies["topurl"].Expires = DateTime.Now.AddHours(4); } lbtnPost.Attributes.Add("onclick", "setIsInTopurl();"); GetValuesFromSession(); //to get values of logged in user and selected tribute from session. UserIsAdmin(); SetValuesToControls(); SetControlsVisibility(); //Start - Modification on 9-Dec-09 for the enhancement 3 of the Phase 1 if (_tributeName != null) Page.Title = _tributeName + " | Photo"; //End if (!this.IsPostBack) { this._presenter.GetPhotoDetails(); //Page.SetFocus(txtPhotoComment); } if (Request.QueryString["PhotoId"] != null) { if (int.TryParse(Request.QueryString["PhotoId"], out _photoId)) Session["PhotoId"] = _photoId.ToString(); } MiscellaneousController objMisc = new MiscellaneousController(); bool isAllowedPhotoCheck = false; string tributeEndDate = objMisc.GetTributeEndDate(_tributeId); DateTime date2 = new DateTime(); //MG:Expiry Notice DateTime dt = new DateTime(); if (!tributeEndDate.Equals("Never")) { if (tributeEndDate.Contains("/")) { string[] date = tributeEndDate.Split('/'); date2 = new DateTime(int.Parse(date[2]), int.Parse(date[0]), int.Parse(date[1])); } } isAllowedPhotoCheck = objMisc.IsAllowedPhotoCheckonPhotoId(PhotoId); _packageId = objMisc.GetPackIdonPhotoId(PhotoId); StateManager objStateManager = StateManager.Instance; IsCustomHeaderOn = _presenter.GetCustomHeaderDetail(_tributeId); //to get user id from session as user is logged in user objSessionValue = (SessionValue)objStateManager.Get("objSessionvalue", StateManager.State.Session); if (((_packageId == 5) && !isAllowedPhotoCheck && (date2 < DateTime.Now))) { if (Equals(objSessionValue, null))//when not logged in { if (IsCustomHeaderOn) topHeight = 198; else topHeight = 88; } else { if (IsCustomHeaderOn) topHeight = 261; else topHeight = 133; } if (WebConfig.ApplicationMode.Equals("local")) { appDomian = WebConfig.AppBaseDomain.ToString(); } else { StateManager stateManager = StateManager.Instance; Tributes objTrib = (Tributes)stateManager.Get("TributeSession", StateManager.State.Session); appDomian = "http://" + objTrib.TypeDescription.ToString().ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/"; } ScriptManager.RegisterStartupScript(Page, this.GetType(), "awe", "fnReachLimitExpiryPopup('location.href','document.title','UpgradePhoto','" + _tributeUrl + "','" + _tributeId + "','" + appDomian + "','" + topHeight + "');", true); } if (Request.QueryString["View"] != null) { TributePackage objpackage = new TributePackage(); Tributes objTributes = objTribute = (Tributes)objStateManager.Get(PortalEnums.SessionValueEnum.TributeSession.ToString(), StateManager.State.Session); if (objTributes != null) { if (string.IsNullOrEmpty(objTributes.TributePackageType)) { _packageId = _presenter.GetTributePackageId(_tributeId); } else { if (objTributes.TributePackageType.Equals("Tribute (Never)")) _packageId = 4; else if (objTributes.TributePackageType.StartsWith("Tribute (")) _packageId = 5; } } if (!this.IsPostBack) { if (WebConfig.ApplicationMode.Equals("local")) { appDomian = WebConfig.AppBaseDomain.ToString(); } else { appDomian = "http://" + _tributeType.ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/"; } IsCustomHeaderOn = _presenter.GetCustomHeaderDetail(_tributeId); if ((_packageId == 6) || (_packageId == 7) || (_packageId == 8)) { if (Equals(objSessionValue, null))//when not logged in { if (IsCustomHeaderOn) topHeight = 198; else topHeight = 81; } else { if (IsCustomHeaderOn) topHeight = 261; else topHeight = 133; } if (Request.QueryString["PhotoId"] != null) { if (int.TryParse(Request.QueryString["PhotoId"], out _photoId)) Session["PhotoId"] = _photoId.ToString(); } if (WebConfig.ApplicationMode.Equals("local")) { appDomian = WebConfig.AppBaseDomain.ToString(); } else { StateManager stateManager = StateManager.Instance; Tributes objTrib = (Tributes)stateManager.Get("TributeSession", StateManager.State.Session); appDomian = "http://" + objTrib.TypeDescription.ToString().ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/"; } ScriptManager.RegisterStartupScript(Page, this.GetType(), "awe", "fnReachLimitExpiryPopup('location.href','document.title','UpgradePhoto','" + _tributeUrl + "','" + _tributeId + "','" + appDomian + "','" + topHeight + "');", true); } else if ((objTributes.TributePackageType.Equals("Tribute (Never)")) || (objTributes.TributePackageType.StartsWith("Tribute ("))) { if (objTributes != null) { if (Request.QueryString["TributeUrl"] != null) _tributeUrl = Request.QueryString["TributeUrl"].ToString(); if (!File.Exists(strBigImage)) { //show big image string redirectScript = "<script>window.open('" + strBigImage + "');</script>"; Response.Write(redirectScript); } else if (!File.Exists(SmallImage)) { //show small image string redirectScript = "<script>window.open('" + SmallImage + "');</script>"; Response.Write(redirectScript); } } } } } } catch (Exception ex) { Response.Redirect(WebConfig.AppBaseDomain.ToString() + "Errors/Error404.aspx"); } }
public object SendSponsorEmailOnFreeUpgrade(object[] objValue) { StringBuilder sb = new StringBuilder(); UserRegistration objUserReg = new UserRegistration(); BillingResource objBillingResource = new BillingResource(); BillingHistory objBilling = new BillingHistory(); EmailManager objEmailManager = new EmailManager(); TributePackage objpackage = new TributePackage(); // return objBillingResource.InsertRecord(objValue); UserCreditcardDetails objCCdetail = new UserCreditcardDetails(); SessionValue objUser = new SessionValue(); Tributes objTribute = new Tributes(); String[] SponsorNameandMsgForEmail; object identity = new object(); //using (TransactionScope trans = new TransactionScope()) //{ // identity = objBillingResource.InsertRecord(objValue); // //Transaction Commited // trans.Complete(); //} objUserReg = (UserRegistration)objValue[0]; if (objValue.Length > 1) { objUser = (SessionValue)objValue[1]; objTribute = (Tributes)objValue[2]; objpackage = (TributePackage)objValue[3]; SponsorNameandMsgForEmail = (String[])objValue[4]; // Send the email to all the adminstrator if (objpackage.IsSponserHide) { if (SponsorNameandMsgForEmail[0] != string.Empty) { objEmailManager.SendSponsorMailsWithMessage(SponsorNameandMsgForEmail[0], SponsorNameandMsgForEmail[1], objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId); } /* commented by Mohit else if (objpackage.IsSponsor) { objEmailManager.SendSponsorMails(objUser.UserType == 1 ? objUser.UserName : objUser.FirstName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId); } */ else { objEmailManager.SendSponsorMails("An anonymous person has", "Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId); } //objEmailManager.SendSponsorMails(objUser.UserName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objUserReg.UserCreditcardDetails.ExpirationDate.ToString("MMMM dd, yyyy"), objpackage.PackageId); } } return identity; }
protected void Page_Init(object sender, EventArgs e) { StateManager objStateManager = StateManager.Instance; MiscellaneousController objMisc = new MiscellaneousController(); objTribute = new Tributes(); if ((Request.QueryString["TributeUrl"] != null) && (Request.QueryString["TributeType"] != null)) { objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString(); objTribute.TypeDescription = Request.QueryString["TributeType"].ToString(); objStateManager.Add("TributeSession", objMisc.GetTributeSessionForUrlAndType(objTribute,WebConfig.ApplicationType.ToString()), TributesPortal.Utilities.StateManager.State.Session); } else if (Request.QueryString["TributeUrl"] != null) { objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString(); objTribute.TypeDescription = null; objStateManager.Add("TributeSession", objMisc.GetTributeSessionForUrlAndType(objTribute,WebConfig.ApplicationType.ToString()), TributesPortal.Utilities.StateManager.State.Session); } TributePackage objpackage = new TributePackage(); objpackage.UserTributeId = objTribute.TributeId; object[] param = { objpackage }; objMisc.TriputePackageInfo(param); if (objpackage.CustomError == null) _packageId = objpackage.PackageId; }
public object InsertCreditPointCCDetails(object[] objValue) { StringBuilder sb = new StringBuilder(); UserRegistration objUserReg = new UserRegistration(); BillingResource objBillingResource = new BillingResource(); BillingHistory objBilling = new BillingHistory(); EmailManager objEmailManager = new EmailManager(); TributePackage objpackage = new TributePackage(); // return objBillingResource.InsertRecord(objValue); UserCreditcardDetails objCCdetail = new UserCreditcardDetails(); SessionValue objUser = new SessionValue(); Tributes objTribute = new Tributes(); object identity = new object(); using (TransactionScope trans = new TransactionScope()) { identity = objBillingResource.InsertRecord(objValue); //Transaction Commited trans.Complete(); } return identity; }