Exemplo n.º 1
0
    public string SaveAlbumPhoto()
    {
        string albumId;
        if (Session["PhotoAlbumId"] == null)
        {
            MediaAlbumBO objAClass = new MediaAlbumBO();
            objAClass.UserId = Userid;
            objAClass.Name = "My Pictures";
            objAClass.Type = Global.PHOTO;
            objAClass.isFollow = true;
            albumId = MediaAlbumBLL.insertDefaultAlbum(objAClass);

        }
        else
        {
            albumId = Session["PhotoAlbumId"].ToString();
        }
        MediaBO objClass = new MediaBO();

        objClass.UserId = Userid;

        objClass.AlbumId = albumId;
        objClass.Caption = "";
        objClass.Name = "";
        objClass.Description = "";
        objClass.AddedDate = DateTime.Now;
        objClass.Location = "";
        objClass.Type = Global.PHOTO;
        objClass.isFollow = true;
        return MediaBLL.insertMedia(objClass);
    }
Exemplo n.º 2
0
    protected void SetCoverPictureButton_Click(object sender, EventArgs e)
    {
        string albumid="";
        try
        {

                albumid=Session["PhotoAlbumId"].ToString() ;

        MediaAlbumBO obj = new MediaAlbumBO();
        obj.Id = albumid;
        obj.CoverPictureId = Photoid;

        MediaAlbumBLL.UpdateCoverPicture(obj);
        }

        catch (Exception ex) { Response.Redirect("Photos.aspx"); }
    }
Exemplo n.º 3
0
    protected void UpdateStatus()
    {
        string status = txtUpdatePost.Text;
        bool isVideoLink = false;
        UserBLL userbll = new UserBLL();

        if(lblFriendsWith.Text!="")
            status += " <font color='#838181'> -- with <font/>" + lblFriendsWith.Text.Remove(lblFriendsWith.Text.LastIndexOf(","));
        if (lblLocation.Text != "")
            status += lblLocation.Text;

        UserBO objUser = new UserBO();
        objUser = UserBLL.getUserByUserId(Session["UserId"].ToString());

        WallBO objWall = new WallBO();
        objWall.PostedByUserId = Session["UserId"].ToString();
        objWall.WallOwnerUserId = userid;
        objWall.FirstName = objUser.FirstName;
        objWall.LastName = objUser.LastName;
        objWall.Post = ConvertUrlsToLinks(status);
        objWall.AddedDate = DateTime.UtcNow;
        objWall.Type = Global.TEXT_POST;

        if (ConvertUrlsToLinks(status).IndexOf("http") > 0)
        {
            objWall.Type = Global.LINK;
            status = "post a link";
        }

        string imagesrc="";

        if (!GetYouTubeURL(txtUpdatePost.Text).Equals(""))
        {
            string url = GetYouTubeURL(txtUpdatePost.Text);
            objWall.Post = "<br/><br/><a href='" + url + "'>" + url + "</a><br/><br/>";

        }
        if (pnlVideoLink.Visible == true)
        {

            string url = GetYouTubeURL(txtUpdatePost.Text);
            string id = GetYouTubeID(txtUpdatePost.Text);
            string embedsrc = "http://www.youtube.com/embed/" + id + "?rel=0";
            objWall.Type = Global.POST_VIDEOLINK;
            objWall.Post = "<br/><br/><a href='" + url + "'>" + url + "</a><br/><br/>";
            if (!chkThumbnail.Checked)
            {
                imagesrc = getCurrentSelectedVideoThumbnail(id);
                vidthumbdisp = true;
                objWall.EmbedPost = imagesrc;
            }
            objWall.Type = Global.POST_VIDEOLINK;
            txtUpdatePost.Text = "";
            isVideoLink = true;
            status = " added a new video";
        }
        if (videofileuploaded)
        {
            objWall.Type = Global.VIDEO;
            string wallpost = objWall.Post;
            objWall.EmbedPost = Global.PATH_COMPRESSED_USER_VIDEO + "Thumb/" + uploadedvideothumbname;
            uploadedvideoembedliteral = Video.getUploadedVideoEmbedLiteral(wallpost, uploadedvideoname);
            LiteralUploadVideo.Text = "";
            status = " added a new video";
        }
        if (photofileuploaded)
        {
            objWall.Type = Global.PHOTO;
            LiteralUploadPhoto .Text= "";
            uploadedPhotoliteral = "";
            objWall.EmbedPost = photoid;
            status = " added a new photo";
        }

        if (Session["WebCamPhotoId"] != null)
        {

            objWall.Type = Global.PHOTO;
            objWall.EmbedPost = Session["WebCamPhotoId"].ToString();
            status = " added a new photo";
        }
        if (isphotoalbum)
        {
            MediaAlbumBO objAClass = new MediaAlbumBO();
            objAClass.UserId = userid;
            objAClass.Name = txtName.Text;
            objAClass.Description = txtDescription.Text;
            objAClass.CoverPictureId = "0000000000000b0000000900";
            objAClass.Type = Global.PHOTO;
            objAClass.isFollow = true;
            string aid=MediaAlbumBLL.insertMediaAlbum(objAClass);
            objWall.Post = objWall.Post + " add new <a  href=\"ViewPhotoAlbum.aspx?AlbumId=" + aid + "\">photo album</a>.";
            objWall.Type = Global.PHOTO_ALBUM;
            status = " added a new photo album";
        }
        //////////////////////////////////////////////////////////////////////
        foreach (string item in lstTag)
        {
            string tagstatus;
            if (photofileuploaded || videofileuploaded || Session["WebCamPhotoId"] != null || isVideoLink || isphotoalbum)
            {
            WallBO objWall2 = new WallBO();
            string tagpost = objWall.Post + "<br/> <font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
            UserBO objUser2 = new UserBO();
            objUser2 = UserBLL.getUserByUserId(item);
            objWall2.PostedByUserId = item;
            objWall2.WallOwnerUserId = item;
            objWall2.FirstName = objUser2.FirstName;
            objWall2.LastName = objUser2.LastName;
            objWall2.Post = tagpost;
            tagstatus = "tagged a post";
            objWall2.AddedDate = DateTime.Now;

            if (isphotoalbum)
            {
                objWall2.Type = Global.TAG_PHOTO_ALBUM;
                objWall2.Post = objWall.Post + " <font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a photo album";
            }

            if (videofileuploaded)
            {
                objWall2.Type = Global.TAG_VIDEO;
                objWall2.EmbedPost = Global.PATH_COMPRESSED_USER_VIDEO + "Thumb/" + uploadedvideothumbname;
                objWall2.Post = objWall.Post + "<font color='#838181'> was tagged by <font/><a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a video";
            }
           if (isVideoLink)
            {
                objWall2.Type = Global.TAG_VIDEOLINK;
                objWall2.EmbedPost = imagesrc;
                objWall2.Post = objWall.Post + "<font color='#838181'> was tagged by <font/> <a  href=\"ViewProfile.aspx?UserId=" + Session["UserId"].ToString() + "\">" + objUser.FirstName + " " + objUser.LastName + "</a>.";
                notify_Tag(item, userid);
                tagstatus = "tagged a video";

           }
            if (photofileuploaded)
            {
                TagsBO objTags = new TagsBO();
                objTags.AtId = photoid;
                objTags.Type = Global.PHOTO;
                objTags.UserId = Session["UserId"].ToString();
                objTags.FirstName = objUser.FirstName;
                objTags.LastName = objUser.LastName;
                objTags.FriendId = item;
                objTags.FriendFName = objUser2.FirstName;
                objTags.FriendLName = objUser2.LastName;
                notify_Tag(item, photoid);
                TagsBLL.insertTags(objTags);
                objWall2.Type = Global.TAG_PHOTO;
                objWall2.EmbedPost = photoid;
                tagstatus = "tagged a photo";
            }
            if (Session["WebCamPhotoId"] != null)
            {
                TagsBO objTags = new TagsBO();
                objTags.AtId = Session["WebCamPhotoId"].ToString();
                objTags.Type = Global.PHOTO;
                objTags.UserId = Session["UserId"].ToString();
                objTags.FirstName = objUser.FirstName;
                objTags.LastName = objUser.LastName;
                objTags.FriendId = item;
                objTags.FriendFName = objUser2.FirstName;
                objTags.FriendLName = objUser2.LastName;
                TagsBLL.insertTags(objTags);
                objWall2.Type = Global.TAG_PHOTO;
                objWall2.EmbedPost = Session["WebCamPhotoId"].ToString();
                notify_Tag(item, Session["WebCamPhotoId"].ToString());
                tagstatus = "tagged a photo";
            }

            RWallPost(" tag post to <a  href=\"ViewProfile.aspx?UserId=" + item + "\">" + objUser2.FirstName + " " + objUser2.LastName + "</a>");
            string twid= WallBLL.insertWall(objWall2);

            userbll.notify_subscribers(Session["UserId"].ToString(), objWall2, ConvertUrlsToLinks(tagstatus), twid);
        }
        }
        string wid= WallBLL.insertWall(objWall);
        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "myScript", "document.getElementById('" + txtUpdatePost.ClientID + "').value = '';", true);
        lblLocation.Text = "";
        lblFriendsWith.Text = "";
        lblFriendsTag.Text = "";
        LiteralUploadPhoto.Text = "";
        LiteralUploadVideo.Text = "";
        uploadedPhotoliteral = "";
        Session["WebCamPhotoId"] = null;
        videofileuploaded = false;
        photofileuploaded = false;
        isVideoLink = false;
        isphotoalbum = false;
        lstTag.Clear();
        userbll.notify_subscribers(Session["UserId"].ToString(), objWall, ConvertUrlsToLinks(ConvertUrlsToLinks(status)), wid);
        LoadWall(100);
    }
Exemplo n.º 4
0
    protected void LoadDataAlbum()
    {
        MediaAlbumBO obj = new MediaAlbumBO();

        obj=MediaAlbumBLL.getMediaAlbumByMediaAlbumId(Albumid);
        lblDescription.Text = obj.Description;
        lblTitle.Text = obj.Name;

        if (obj.Name.Equals("My Pictures")||obj.Name.Equals("Profile Pictures"))
            lnkDelete.Visible = false;

         Isfollow = obj.isFollow;
        if (Isfollow)
        {
            lbtnFollow.Text = "UnFollow Post";
        }

        else
        {
            lbtnFollow.Text = "Follow Post";
        }
    }
Exemplo n.º 5
0
    public string SavePhotos()
    {
        string albumId;

            MediaAlbumBO objAClass = new MediaAlbumBO();
            objAClass.UserId = Userid;
            objAClass.Name = "Profile Pictures";
            objAClass.Type = Global.PHOTO;
            objAClass.isFollow = true;
            albumId = MediaAlbumBLL.insertDefaultAlbum(objAClass);

        MediaBO objClass = new MediaBO();

        objClass.UserId = Userid;

        objClass.AlbumId = albumId;
        objClass.Caption = "";
        objClass.Name = "";
        objClass.Description = "";
        objClass.AddedDate = DateTime.Now;
        objClass.Location = "";
        objClass.Type = Global.PHOTO;
        objClass.isFollow = true;
        return MediaBLL.insertMedia(objClass);
    }
Exemplo n.º 6
0
 public static void updateMediaAlbum(MediaAlbumBO objMediaAlbum)
 {
     MediaAlbumDAL.updateMediaAlbum(objMediaAlbum);
 }
Exemplo n.º 7
0
 protected void lbtnFollow_Click(object sender, EventArgs e)
 {
     if (lbtnFollow.Text == "Follow Post")
     {
         MediaAlbumBO obj=new MediaAlbumBO();
         obj.isFollow=true;
         obj.Id = Albumid;
         MediaAlbumBLL.EditFollowAlbum(obj);
         lbtnFollow.Text = "UnFollow Post";
     }
     else
     {
         MediaAlbumBO obj = new MediaAlbumBO();
         obj.isFollow = false;
         obj.Id = Albumid;
         MediaAlbumBLL.EditFollowAlbum(obj);
         lbtnFollow.Text = "Follow Post";
     }
 }
Exemplo n.º 8
0
 public static void UpdateCoverPicture(MediaAlbumBO objClass)
 {
     MediaAlbumDAL.UpdateCoverPicture(objClass);
 }
Exemplo n.º 9
0
 public static string insertMediaAlbum(MediaAlbumBO objMediaAlbum)
 {
     return MediaAlbumDAL.insertMediaAlbum(objMediaAlbum);
 }
Exemplo n.º 10
0
 public static string insertDefaultAlbum(MediaAlbumBO objClass)
 {
     return MediaAlbumDAL.insertDefaultAlbum(objClass);
 }
Exemplo n.º 11
0
 public static void EditFollowAlbum(MediaAlbumBO objClass)
 {
     MediaAlbumDAL.EditFollowAlbum(objClass);
 }
Exemplo n.º 12
0
 public static void EditAlbum(MediaAlbumBO objMediaAlbum)
 {
     MediaAlbumDAL.EditAlbum(objMediaAlbum);
 }