Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                GetCookie();
                if (!IsPostBack)
                {
                    ViewState["websiteId"] = 0;
                    ViewState["UserID"]    = 0;

                    _bllwebsite  = new BllWebsite();
                    _blltag      = new BllTag();
                    _bllemotions = new BllEmotions();

                    if (Request.QueryString["WebsiteId"] != null)
                    {
                        ViewState["websiteId"] = Convert.ToInt64(Request.QueryString["WebsiteId"]);

                        Dtowebsite  = _bllwebsite.GetWebsiteById(Convert.ToInt64(ViewState["websiteId"]));
                        Lsttag      = _blltag.GetTagByWebsite(Convert.ToInt64(ViewState["websiteId"]));
                        Lstemotions = _bllemotions.GetEmotionByWebsite(Convert.ToInt64(ViewState["websiteId"]));

                        if (Lsttag != null && Lsttag.Count > 0)
                        {
                            foreach (DtoTag t in Lsttag)
                            {
                                Tagstring += t.TagId + ",";
                            }

                            hdntagstring.Value = Tagstring;
                        }
                        if (Lstemotions != null && Lstemotions.Count > 0)
                        {
                            foreach (DtoEmotions E in Lstemotions)
                            {
                                Emostring += E.Emotionid + ",";
                            }

                            hdnemostring.Value = Emostring;
                        }
                    }
                }
                else
                {
                    Response.Redirect("../Default.aspx");
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                IsUser();
                if (!IsPostBack)
                {
                    ViewState["websiteid"] = 0;

                    _bllwebsite   = new BllWebsite();
                    _dtowebsite   = new DtoWebsite();
                    _dtopremalink = new DtoPremalink();
                    _bllpremalink = new BllPremalink();

                    TextBox1.Attributes.Add("onblur", "blurfunction('shortnamespan','" + TextBox1.ClientID + "')");
                    TextBox2.Attributes.Add("onblur", "blurfunction('websitespan','" + TextBox2.ClientID + "')");
                    TxtSearch.Attributes.Add("onblur", "blurfunction('searchsspan','" + TxtSearch.ClientID + "')");

                    if (Request.QueryString["WebsiteID"] != null &
                        Convert.ToInt64(Request.QueryString["WebsiteID"]) != 0)
                    {
                        ViewState["websiteid"] = Convert.ToInt64(Request.QueryString["WebsiteID"]);
                        _dtowebsite            = _bllwebsite.GetWebsiteById(Convert.ToInt64(ViewState["websiteid"]));

                        TextBox1.Text = _dtowebsite.WebSiteName;
                        TextBox2.Text = _dtowebsite.WebsiteUrl;

                        chktag.Checked        = _dtowebsite.Tag;
                        chkemotion.Checked    = _dtowebsite.Emotion;
                        chkaddable.Checked    = _dtowebsite.AddTag;
                        chkrateable.Checked   = _dtowebsite.RateTag;
                        chkemoaddable.Checked = _dtowebsite.AddEmotion;

                        if (!string.IsNullOrEmpty(_dtowebsite.WebsiteLogo))
                        {
                            imgweblogo.ImageUrl = Server.MapPath("~/Images/WebsiteLogo/") + _dtowebsite.WebsiteLogo;
                        }

                        if (_dtowebsite.WebSiteName != "")
                        {
                            Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespand",
                                                                    "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>");
                        }
                        if (_dtowebsite.WebsiteUrl != "")
                        {
                            Page.ClientScript.RegisterStartupScript(GetType(), "websitespand",
                                                                    "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>");
                        }

                        txtcode.InnerText = "<div id='taghead'></div><script type ='text/javascript' language='javascript'>"
                                            + "var Websitename_shortname = '" + _dtowebsite.WebSiteName + "';</script>"
                                            +
                                            "<script src='http://www.glozzary.com/Script/NewJScript.js' type='text/javascript'></script>";

                        BtnDone.Visible     = true;
                        BtnRegister.Visible = false;

                        dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType();
                        dplstwebsitetype.DataBind();

                        dplstwebsitetype.SelectedValue = _dtowebsite.WebsiteType;

                        _dtopremalink.WebsiteId = Convert.ToInt64(ViewState["websiteid"]);
                        _dtopremalink.Link      = TxtSearch.Text;

                        GridPremalink.DataSource = _bllpremalink.GetWebsitePremalink(_dtopremalink);
                        GridPremalink.DataBind();
                    }
                    else
                    {
                        BtnRegister.Visible = true;
                        BtnDone.Visible     = false;

                        dplstwebsitetype.DataSource = _bllwebsite.GetWebsiteType();
                        dplstwebsitetype.DataBind();
                    }
                }
                else
                {
                    if (TextBox1.Text != "")
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "shortnamespan",
                                                                "<script type='text/javascript'>document.getElementById('shortnamespan').style.opacity = 0;</script>");
                    }
                    if (TextBox2.Text != "")
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "websitespans",
                                                                "<script type='text/javascript'>document.getElementById('websitespan').style.opacity = 0;</script>");
                    }
                    if (TxtSearch.Text != "")
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "searchsspans",
                                                                "<script type='text/javascript'>document.getElementById('searchsspan').style.opacity = 0;</script>");
                    }
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }