Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SqlTask.conn.State != System.Data.ConnectionState.Closed)
            {
                SqlTask.conn.Close();
            }
            if (!IsPostBack)
            {
                User user = new User();
                if (Session["loginuser"] != null)
                {
                    user = SqlTask.GetUserInfo(Session["loginuser"].ToString());

                    lblLikes.Text    = user.totalLike.ToString();
                    lblPhotos.Text   = user.totalPhoto.ToString();
                    lblProjects.Text = user.totalProject.ToString();
                }
                else
                {
                    Response.Redirect("~/Default.aspx");
                }
                //---get photos---
                List <Photo> photolist = SqlTask.GetPhotographerPhotos(user.ID);
                lstPhoto.DataSource = photolist;
                lstPhoto.DataBind();

                List <Project> projectlist = SqlTask.GetPhotographerProjects(user.ID);
                lstProject.DataSource = projectlist;
                lstProject.DataBind();

                List <PhotoInfo> likedlist = SqlTask.GetLikedPhotosForPhotographer(user.ID);
                lstLikes.DataSource = likedlist;
                lstLikes.DataBind();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SqlTask.conn.State == System.Data.ConnectionState.Open || SqlTask.conn.State == System.Data.ConnectionState.Connecting)
            {
                SqlTask.conn.Close();
            }
            if (!IsPostBack)
            {
                User user = new User();
                if (this.Page.RouteData.Values["userUrl"] != null)
                {
                    string userid = SqlTask.GetUserIdByUrl(this.Page.RouteData.Values["userUrl"].ToString());
                    if (string.IsNullOrEmpty(userid))
                    {
                        Response.Redirect("/Error.aspx");
                    }

                    user             = SqlTask.GetUserInfo(userid);
                    lblName.Text     = user.FName;
                    imgUser.ImageUrl = user.ImgPath;
                    lblDesc.Text     = user.Desc;
                    lblEmail.Text    = user.Email;
                    lblLikes.Text    = user.totalLike.ToString();
                    lblPhotos.Text   = user.totalPhoto.ToString();
                    lblProjects.Text = user.totalProject.ToString();
                    if (Session["loginuser"] == null || Session["loginuser"].ToString() != user.ID)
                    {
                        btnUpdate.Visible = false;
                    }
                }
                else if (Session["loginuser"] != null)
                {
                    user             = SqlTask.GetUserInfo(Session["loginuser"].ToString());
                    lblName.Text     = user.FName;
                    imgUser.ImageUrl = user.ImgPath;
                    lblDesc.Text     = user.Desc;
                    lblEmail.Text    = user.Email;
                    lblLikes.Text    = user.totalLike.ToString();
                    lblPhotos.Text   = user.totalPhoto.ToString();
                    lblProjects.Text = user.totalProject.ToString();
                }
                else
                {
                    Response.Redirect("~/Default.aspx");
                }
                //---get photos---
                List <Photo> photolist = SqlTask.GetUserPhotos(user.ID);
                lstPhoto.DataSource = photolist;
                lstPhoto.DataBind();

                List <Project> projectlist = SqlTask.GetUserProjects(user.ID);
                lstProject.DataSource = projectlist;
                lstProject.DataBind();

                List <PhotoInfo> likedlist = SqlTask.GetLikedPhotos(user.ID);
                lstLikes.DataSource = likedlist;
                lstLikes.DataBind();
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["loginuser"] != null)
            {
                try
                {
                    User user = SqlTask.GetUserInfo(Session["loginuser"].ToString());

                    txtProfileEmail.Text = user.Email;
                    imgUser.ImageUrl     = user.ImgPath;
                    txtID.Text           = user.ID;
                }
                catch (Exception ex)
                {
                    alertprofilepage.Attributes["class"] = "alert alert-warning alert-dismissable";
                    alertchangepassword = "******" + ex.Message;
                }
            }
            else
            {
                Response.Redirect("/Default.aspx");
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SqlTask.conn.Close();
                if (Session["loginuser"] != null)
                {
                    try
                    {
                        User user = SqlTask.GetUserInfo(Session["loginuser"].ToString());

                        txtFName.Text        = user.FName;
                        txtSName.Text        = user.SName;
                        txtProfileEmail.Text = user.Email;
                        txtDesc.Text         = user.Desc;
                        imgUser.ImageUrl     = user.ImgPath;
                        txtID.Text           = user.ID;
                        txtURL.Text          = user.URL;

                        if (char.IsDigit(user.ID[0]) == true)
                        {
                            chgPass.Visible = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        alertprofilepage.Attributes["class"] = "alert alert-warning alert-dismissable";
                        alertprofile = "The following error is occured: " + ex.Message;
                    }
                }
                else
                {
                    Response.Redirect("/Default.aspx");
                }
            }
        }