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;
    }
Exemplo n.º 2
0
    /// <summary>
    /// Method to load themes in the left panel
    /// </summary>
    private void LoadThemes()
    {
        try
        {
            StateManager stateManager = StateManager.Instance;
            MiscellaneousController objMisc = new MiscellaneousController();
            string strPath = "";
            if (Request.RawUrl.Contains("/"))
            {
                strPath = Request.RawUrl.ToString().Substring(0, Request.RawUrl.ToString().LastIndexOf('/'));
                strPath = strPath.Substring(strPath.LastIndexOf('/') + 1);
            }
            if ((strPath != "") && (Request.QueryString["Type"] != null))
            {
                objTribute.TributeUrl = strPath;
                objTribute.TypeDescription = Request.QueryString["Type"].ToString().ToLower().Replace("newbaby", "new baby");
                objTribute = objMisc.GetTributeSessionForUrlAndType(objTribute, WebConfig.ApplicationType.ToString());
            }

            if (objTribute != null)
            {
                if (objTribute.TributeId > 0)
                {
                    _tributeId = objTribute.TributeId;
                    _tributeName = objTribute.TributeName;
                    _tributeType = objTribute.TypeDescription;
                    _tributeUrl = objTribute.TributeUrl;
                }
            }
            Templates objTributeType = new Templates();
            objTributeType.TributeType = _tributeType; // "Wedding";

            int existingTheme = GetExistingTheme().TemplateID;
            MiscellaneousController _controller = new MiscellaneousController();
            List<Templates> lstThemes = _controller.GetThemesFolderList(objTributeType, WebConfig.ApplicationType);

            StringBuilder sbChangeSiteTheme = new StringBuilder();
            foreach (Templates objThemes in lstThemes)
            {
                sbChangeSiteTheme.Append("<div class='yt-Form-Field yt-Form-Field-Radio' id='" + objThemes.ThemeCssClass + "'>"); // + objThemes.TemplateName.Remove(objThemes.TemplateName.IndexOf(" "), 1) + "'>");
                sbChangeSiteTheme.Append("<input name='rdoTheme' type='radio' runat='server' id='rdo" + objThemes.TemplateID + "' onclick='javascript:Themer(\"" + objThemes.ThemeValue + "\");GetSelectedTheme(" + objThemes.TemplateID + ",\"" + objThemes.ThemeValue + "\");' value='" + objThemes.ThemeValue + "'");
                string appPath = string.Empty;
                if (WebConfig.ApplicationMode.ToLower().Equals("local"))
                {
                    appPath = WebConfig.AppBaseDomain;
                }
                else
                {
                    appPath = string.Format("{0}{1}{2}", "http://www.", WebConfig.TopLevelDomain, "/");
                }
                if (hdnSelectedTheme.Value != string.Empty)
                {
                    if (int.Parse(hdnSelectedTheme.Value) == objThemes.TemplateID)
                    {
                        sbChangeSiteTheme.Append(" Checked='Checked' />");
                        idSheet.Href = appPath + "assets/themes/" + objThemes.FolderName + "/theme.css"; //to set the selected theme
                    }
                    else
                        sbChangeSiteTheme.Append("  />");
                }
                else
                {
                    if (existingTheme == objThemes.TemplateID)
                    {
                        sbChangeSiteTheme.Append(" Checked='Checked' />");
                        idSheet.Href = appPath + "assets/themes/" + objThemes.FolderName + "/theme.css"; //to set the selected theme
                    }
                    else
                        sbChangeSiteTheme.Append("  />");
                }
                sbChangeSiteTheme.Append("<label for='rdo" + objThemes.TemplateID + "'>"); //rdo" + objThemes.TemplateName + "'>");
                sbChangeSiteTheme.Append(objThemes.TemplateName + " <span class='yt-ThemeColorPrimary'></span><span class='yt-ThemeColorSecondary'></span></label>");
                sbChangeSiteTheme.Append("</div>");
            }
            litThemes.Text = sbChangeSiteTheme.ToString();

            stateManager.Add("ThemeOnMaster", lstThemes, StateManager.State.Session);
        }
        catch (Exception ex)
        {
            throw ex;
        }


    }
Exemplo n.º 3
0
    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;
        }

    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(Users_log_in));
        //this.Form.Action = Request.RawUrl;
        Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
        Response.Cache.SetNoStore();
        Response.AddHeader("Pragma", "no-cache");
        showFbDialog.Text = "false";
        //Page.Title = "Log In - Your Tribute";
        if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
        {
            signUpYm.Visible = true;
            signUpYt.Visible = false;
            //Page.Title = "Log In - Your Moments";
            ytExamplesBlock.Visible = false;
        }

        if (!this.IsPostBack)
        {
            var fbWebContext = FacebookWebContext.Current;
            if (FacebookWebContext.Current.Session != null)
            {
                if (FacebookWebContext.Current.AccessToken != null)
                {
                    var fbwc = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
                    var me = (IDictionary<string, object>)fbwc.Get("me");   // get own information
                    _FacebookUid = fbWebContext.UserId;                // get own user id
                    try
                    {

                        string fbName = (string)me["first_name"] + " " + (string)me["last_name"]; // get first name and last name
                        if (this._presenter.OnFacebookLogin(fbName))
                        {
                            _showSignUpDialog = "false";
                            showFbDialog.Text = "false";
                            SaveSessionInDB();
                            Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", Session.SessionID));
                            Response.Cookies["ASP.NET_SessionId"].Domain = "." + WebConfig.TopLevelDomain;
                            RedirectPage();
                            return;
                        }
                        else
                        {
                            string notice = string.Format("<h2>Welcome, {0}.</h2>" +
                                "<h3>Login here to connect your Facebook login to your account<br/>" +
                                "Or sign-up to create full account, connected with your Facebook credentials</h3>", fbName);
                            Notice.InnerHtml = notice;
                            Notice.Visible = true;
                            lbtnLogin.Text = "Connect";
                            if (Request.QueryString["ytfblink"] != null)
                            {
                                showFbDialog.Text = "false";
                            }
                            else
                            {
                                showFbDialog.Text = "true";
                            }
                        }
                    }
                    catch (FacebookApiException ex)
                    {
                        _showSignUpDialog = "false";
                        ShowMessage("Something unexpected went wrong. Sorry. Please <a href=\"#\" onclick=\"fb_logout(); return false;\">" +
                              "   <img id=\"fb_logout_image\" src=\"http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif\" alt=\"Connect\"/>" +
                              "</a> and try again." + ex.ToString());
                        doFbLogout.Text = "true";
                    }
                }
            }

            Page.Form.DefaultButton = this.FindControl(lbtnLogin.ClientID).UniqueID;
            Page.Form.DefaultFocus = this.FindControl(txtLoginUsername.ClientID).UniqueID;
            // Page.Form.DefaultButton = this.FindControl(txtLoginUsername.ClientID).UniqueID;
            lbtnLogin.Attributes.Add("onclick", "JavaScript:HideIndecator();");
            txtLoginUsername.Attributes.Add("onkeydown", "JavaScript:if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + lbtnLogin.UniqueID + "').click();return false;}} else {return true}; ");
            txtLoginPassword.Attributes.Add("onkeydown", "JavaScript:if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + lbtnLogin.UniqueID + "').click();return false;}} else {return true}; ");
            this._presenter.OnViewInitialized();
            if (Request.QueryString["PageName"] != null)
            {
                string PageName = Request.QueryString["PageName"].ToString();
                if (PageName == "TributeCreation")
                {
                    //LHK: this is the maessage that appears in the background of Login label.
                    lblMessage.InnerText = "In order to create and contribute, you first need to login to Your Tribute.";
                    lblMessage.Visible = true;
                }
            }
            // Added For Event Handling - Parul
            else if (Request.QueryString["EventID"] != null)
            {
                _EventID = int.Parse(Request.QueryString["EventID"].ToString());
                String TributeUrl = Request.QueryString["TributeUrl"].ToString();
                String TypeDescription = Request.QueryString["TributeType"].ToString();

                _presenter.GetEventName();

                if (_EventName != "")
                {
                    string href = "http://" + TypeDescription.Replace("New Baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/" + TributeUrl + "/event.aspx?EventID=" + EventID;// +"&TributeID=" + TributeID;
                    lblMessage.InnerHtml = "You have been invited to the event " + "<a href='" + href + "'>" + _EventName + "</a>" + ". Please Log in or Sign up to RSVP to the event. <BR>To view the event details and RSVP later, " + "<a href='" + href + "'>" + "Click Here" + "</a>" + ".";
                    lblMessage.Visible = true;
                }
            }
            else if (Request.QueryString["TributeName"] != null)
            {
                string TributeName = Request.QueryString["TributeName"].ToString();
                string TributeId = Request.QueryString["Tributeid"].ToString();
                SetNoticeHeader(TributeName, TributeId);

            }
            else if (Request.QueryString["TributeUrl"] != null)
            {
                Tributes objTribute = new Tributes();
                objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString();
                objTribute.TypeDescription = Request.QueryString["TributeType"].ToString();

                MiscellaneousController objMisc = new MiscellaneousController();
                SetNoticeHeader(objMisc.GetTributeSessionForUrlAndType(objTribute,WebConfig.ApplicationType.ToString()));

            }
            else
            {
                lblMessage.Visible = false;
            }

            if (lblMessage.Visible == false && Session["IsTributeDeleted"] != null && Convert.ToBoolean(Session["IsTributeDeleted"]) == true)
            {
                ShowMessage("<h2>Oops - there is a problem with tribute.</h2> <h3>Please correct the errors below:</h3>", "Tribute has been deleted by administrator.", true);
                Session["IsTributeDeleted"] = null;
                _showSignUpDialog = "false";
            }
        }

        this._presenter.OnViewLoaded();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Notice.Visible = false;
            StateManager stateManager1 = StateManager.Instance;
            SessionValue objSessionvalue = (SessionValue)stateManager1.Get("objSessionvalue", StateManager.State.Session);
            if (objSessionvalue != null)
            {
                // Added by Ashu on Oct 3, 2011 for rewrite URL
                if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                    myprofile.HRef = Session["APP_BASE_DOMAIN"] + "moments.aspx";
                else
                    myprofile.HRef = Session["APP_BASE_DOMAIN"] + "tributes.aspx";
                Usernamelong.Text = objSessionvalue.UserName;
                lbtnSubmit.Attributes.Add("onclick", "Hideheader();");
                TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
                //Tributes objtribute = (Tributes)stateManager.Get("TributeSession", TributesPortal.Utilities.StateManager.State.Session);
                //SetMessageHeader(objtribute.TributeName, objtribute.TributeId.ToString(), objtribute.TributeUrl, objtribute.TypeDescription);
                if ((Request.QueryString["TributeUrl"] != null) && (Request.QueryString["TributeType"] != null))
                {
                    Tributes objTribute = new Tributes();
                    objTribute.TributeUrl = Request.QueryString["TributeUrl"].ToString();
                    objTribute.TypeDescription = Request.QueryString["TributeType"].ToString();

                    MiscellaneousController objMisc = new MiscellaneousController();
                    Tributes objTributeDetail = objMisc.GetTributeSessionForUrlAndType(objTribute, WebConfig.ApplicationType.ToString());

                    stateManager1.Add("TributeSession", objTributeDetail, StateManager.State.Session);
                    SetMessageHeader(objTributeDetail.TributeName, objTributeDetail.TributeId.ToString(), objTributeDetail.TributeUrl, objTributeDetail.TypeDescription);
                }

            }
            else
            {
                Response.Redirect("~/log_in.aspx");
            }

        }
    }