Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                IsUser();

                if (!IsPostBack)
                {
                    ViewState["Id"]       = 0;
                    ViewState["flow"]     = "";
                    ViewState["imageurl"] = "";

                    if (Request.QueryString["Id"] != null)
                    {
                        ViewState["Id"] = Convert.ToInt64(Request.QueryString["Id"]);
                    }
                    else
                    {
                        ViewState["Id"] = UserId;
                    }

                    _blluser = new BllUser();

                    if (Request.QueryString["flow"] != null)
                    {
                        ViewState["flow"] = Request.QueryString["flow"];
                    }

                    var s = Request.QueryString["flow"];
                    if (s != null && s.ToLower() == "coverphoto".ToLower())
                    {
                        ViewState["imageurl"] = _blluser.GetCoverImage(UserId);
                        if (ViewState["imageurl"].ToString() != "")
                        {
                            ImgPic.ImageUrl = "/Uploads/" + ViewState["imageurl"] + ".jpg";
                        }
                        //BtnDelete.Visible = true;
                    }
                    else
                    {
                        var s1 = Request.QueryString["flow"];
                        if (s1 != null && s1.ToLower() == "profilephoto".ToLower())
                        {
                            ViewState["imageurl"] = _blluser.GetUserImage(UserId);
                            if (ViewState["imageurl"].ToString() != "")
                            {
                                ImgPic.ImageUrl = "/Uploads/" + ViewState["imageurl"] + ".jpg";
                            }
                            //BtnDelete.Visible = true;
                        }
                        else
                        {
                            ImgPic.ImageUrl = "~/Images/no_photo.jpg";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }