Ejemplo n.º 1
0
        protected void imgPhoto_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton b  = sender as ImageButton;
            string      Id = b.Attributes["imgid"];

            PhotoInfo photo = SqlTask.GetPhotoInfo(Id);

            switch (photo.rate)
            {
            case "1":
                s1.ImageUrl = "/Images/cstar.png";
                break;

            case "2":
                s1.ImageUrl = "/Images/cstar.png";
                s2.ImageUrl = "/Images/cstar.png";
                break;

            case "3":
                s1.ImageUrl = "/Images/cstar.png";
                s2.ImageUrl = "/Images/cstar.png";
                s3.ImageUrl = "/Images/cstar.png";
                break;

            case "4":
                s1.ImageUrl = "/Images/cstar.png";
                s2.ImageUrl = "/Images/cstar.png";
                s3.ImageUrl = "/Images/cstar.png";
                s4.ImageUrl = "/Images/cstar.png";
                break;

            case "5":
                s1.ImageUrl = "/Images/cstar.png";
                s2.ImageUrl = "/Images/cstar.png";
                s3.ImageUrl = "/Images/cstar.png";
                s4.ImageUrl = "/Images/cstar.png";
                s5.ImageUrl = "/Images/cstar.png";
                break;

            default:
                break;
            }
            imgW.ImageUrl       = photo.imgUrl;
            userImg.ImageUrl    = photo.userImg;
            phtProjectName.Text = photo.projectname;
            phtNameSurname.Text = photo.userFName + " " + photo.userSName;
            lblLikeCount.Text   = photo.tLike.ToString();
            lblPhotoDesc.Text   = photo.Disc;
            btnLike.Attributes.Add("imgId", photo.PID);
            btnExifPopUp.CommandName = photo.PID;

            if (Session["loginuser"] != null)
            {
                photo = SqlTask.GetLikedPhoto(photo, Session["loginuser"].ToString());
            }
            btnLike.ImageUrl = photo.Liked;
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
            //uptImgModal.Update();
        }
Ejemplo n.º 2
0
        protected void imgPhoto_Click(object sender, ImageClickEventArgs e)
        {
            txt_comment_edit.Visible = true;
            ImageButton b = sender as ImageButton;

            if (b.Attributes != null)
            {
                photoID     = b.Attributes["imgID"];
                deneme.Text = photoID.ToString();



                PhotoInfo photo = SqlTask.GetPhotoInfo(photoID);
                switch (photo.rate)
                {
                case "1":
                    s1.ImageUrl = "/Images/cstar.png";
                    s2.ImageUrl = "/Images/ucstar.png";
                    s3.ImageUrl = "/Images/ucstar.png";
                    s4.ImageUrl = "/Images/ucstar.png";
                    s5.ImageUrl = "/Images/ucstar.png";
                    break;

                case "2":
                    s1.ImageUrl = "/Images/cstar.png";
                    s2.ImageUrl = "/Images/cstar.png";
                    s3.ImageUrl = "/Images/ucstar.png";
                    s4.ImageUrl = "/Images/ucstar.png";
                    s5.ImageUrl = "/Images/ucstar.png";
                    break;

                case "3":
                    s1.ImageUrl = "/Images/cstar.png";
                    s2.ImageUrl = "/Images/cstar.png";
                    s3.ImageUrl = "/Images/cstar.png";
                    s4.ImageUrl = "/Images/ucstar.png";
                    s5.ImageUrl = "/Images/ucstar.png";
                    break;

                case "4":
                    s1.ImageUrl = "/Images/cstar.png";
                    s2.ImageUrl = "/Images/cstar.png";
                    s3.ImageUrl = "/Images/cstar.png";
                    s4.ImageUrl = "/Images/cstar.png";
                    s5.ImageUrl = "/Images/ucstar.png";
                    break;

                case "5":
                    s1.ImageUrl = "/Images/cstar.png";
                    s2.ImageUrl = "/Images/cstar.png";
                    s3.ImageUrl = "/Images/cstar.png";
                    s4.ImageUrl = "/Images/cstar.png";
                    s5.ImageUrl = "/Images/cstar.png";
                    break;

                default:
                    break;
                }

                deneme2.Text        = photo.rate.ToString();
                imgW.ImageUrl       = photo.imgUrl;
                userImg.ImageUrl    = photo.userImg;
                phtProjectName.Text = photo.projectname;
                phtNameSurname.Text = photo.userFName + " " + photo.userSName;
                lblRate.Text        = photo.rate;
                lbl_comment.Text    = photo.Disc;
                if (photo.publish == "1")
                {
                    Chck_publish.Checked = true;
                }
                else
                {
                    Chck_publish.Checked = false;
                }

                txt_comment_edit.Visible = true;
                txt_comment_edit.Text    = photo.Disc;
                lbl_comment.Visible      = false;

                if (Session["loginuser"] != null)
                {
                    photo = SqlTask.GetLikedPhoto(photo, Session["loginuser"].ToString());
                }

                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
                uptImgModal.Update();
            }
        }