protected void Page_Load(object sender, EventArgs e) { ((Label)Master.FindControl("lblTitle")).Text = "View Video"; Photoid = QueryString.getQueryStringOnIndex(0); Userid = SessionClass.getUserId(); LoadFollow(); LoadDataListComments(); YouLikes(); string videotag = ""; MediaBO objMedia = new MediaBO(); objMedia = MediaBLL.getMediaByMediaId(Photoid); videotag += " <script type= 'text/javascript' >"; videotag += " jwplayer('container').setup({"; videotag += " file: src='" + Global.USER_VIDEO + objMedia.Id + ".mp4' ,"; videotag += " flashplayer: '../../Resources/jwplayer/player.swf',"; videotag += " width: 520"; videotag += " }); "; videotag += "</script> "; this.LiteralVideo.Text = videotag; imgBtnComments.ImageUrl = Global.PROFILE_PICTURE + Userid + ".jpg"; Session["SpamPhoto"] = null; Session["AbusePhoto"] = null; }
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); }
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)); }
public string SavePhotos() { 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)); }
public void GetPhotoDesc() { MediaBO mediaobj = new MediaBO(); mediaobj = MediaBLL.getMediaByMediaId(Photoid); LabelGetCaption.Text = mediaobj.Caption; LabelGetDesc.Text = mediaobj.Description; LabelGetLocation.Text = mediaobj.Location; imgBack.PostBackUrl = "ViewPhotoAlbum.aspx?" + mediaobj.AlbumId; }
public static void updateFollow(MediaBO objClass) { MongoCollection <Media> objCollection = db.GetCollection <Media>("c_Media"); var query = Query.EQ("_id", ObjectId.Parse(objClass.Id)); var sortBy = SortBy.Descending("_id"); var update = Update.Set("isFollow", objClass.isFollow) ; var result = objCollection.FindAndModify(query, sortBy, update, true); }
public static void updateEditMedia(MediaBO objClass) { MongoCollection <Media> objCollection = db.GetCollection <Media>("c_Media"); var query = Query.EQ("_id", ObjectId.Parse(objClass.Id)); var sortBy = SortBy.Descending("_id"); var update = Update .Set("Caption", objClass.Caption) .Set("Location", objClass.Location) .Set("AddedDate", objClass.AddedDate) ; var result = objCollection.FindAndModify(query, sortBy, update, true); }
protected void LoadFollow() { MediaBO obj = new MediaBO(); obj = MediaBLL.getMediaByMediaId(Photoid); Isfollow = obj.isFollow; if (Isfollow) { lbtnFollow.Text = "UnFollow"; } else { lbtnFollow.Text = "Follow"; } }
protected void lbtnFollow_Click(object sender, EventArgs e) { if (lbtnFollow.Text.Equals("Follow")) { MediaBO obj = new MediaBO(); obj.Id = Photoid; obj.isFollow = true; MediaBLL.updateFollow(obj); } else if (lbtnFollow.Text.Equals("UnFollow")) { MediaBO obj = new MediaBO(); obj.Id = Photoid; obj.isFollow = false; MediaBLL.updateFollow(obj); } LoadFollow(); }
protected void btnSave_Click(object sender, EventArgs e) { TextBox captionText = new TextBox(); TextBox locationText = new TextBox(); TextBox despText = new TextBox(); TextBox titleText = new TextBox(); GMDatePicker datep = new GMDatePicker(); string caption = null; string location = null; string desp = null; string title = null; string id = null; DateTime adddate; foreach (DataListItem dataItem in DataList1.Items) { captionText = (TextBox)dataItem.FindControl("txtCaption"); locationText = (TextBox)dataItem.FindControl("txtLocation"); despText = (TextBox)dataItem.FindControl("txtDescription"); titleText = (TextBox)dataItem.FindControl("txtName"); datep = (GMDatePicker)dataItem.FindControl("GMDatePicker1"); caption = captionText.Text.ToString().Trim(); location = locationText.Text.ToString().Trim(); desp = despText.Text.ToString().Trim(); title = titleText.Text.ToString().Trim(); adddate = datep.Date; string Id = ((HiddenField)dataItem.FindControl("HiddenField1")).Value; MediaBO objClass = new MediaBO(); objClass.Id = Id; objClass.Location = location; objClass.Caption = caption; objClass.Name = title; objClass.Description = desp; objClass.AddedDate = adddate; objClass.Type= Global.VIDEO; MediaBLL.updateEditVideoMedia(objClass); } LoadDataListMedia(); }
public static void updateMedia(MediaBO objClass) { MongoCollection <Media> objCollection = db.GetCollection <Media>("c_Media"); var query = Query.EQ("_id", ObjectId.Parse(objClass.Id)); var sortBy = SortBy.Descending("_id"); var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId)) .Set("AlbumId", ObjectId.Parse(objClass.AlbumId)) .Set("Name", objClass.Name) .Set("Caption", objClass.Caption) .Set("Location", objClass.Location) .Set("Description", objClass.Description) .Set("AddedDate", objClass.AddedDate) .Set("Type", objClass.Type) .Set("isFollow", objClass.isFollow) ; var result = objCollection.FindAndModify(query, sortBy, update, true); }
protected void btnSave_Click(object sender, EventArgs e) { TextBox captionText = new TextBox(); TextBox locationText = new TextBox(); TextBox despText = new TextBox(); TextBox titleText = new TextBox(); GMDatePicker datep = new GMDatePicker(); string caption = null; string location = null; string desp = null; string title = null; string id = null; DateTime adddate; foreach (DataListItem dataItem in DataList1.Items) { captionText = (TextBox)dataItem.FindControl("txtCaption"); locationText = (TextBox)dataItem.FindControl("txtLocation"); despText = (TextBox)dataItem.FindControl("txtDescription"); titleText = (TextBox)dataItem.FindControl("txtName"); datep = (GMDatePicker)dataItem.FindControl("GMDatePicker1"); caption = captionText.Text.ToString().Trim(); location = locationText.Text.ToString().Trim(); desp = despText.Text.ToString().Trim(); title = titleText.Text.ToString().Trim(); adddate = datep.Date; string Id = ((HiddenField)dataItem.FindControl("HiddenField1")).Value; MediaBO objClass = new MediaBO(); objClass.Id = Id; objClass.Location = location; objClass.Caption = caption; objClass.Name = title; objClass.Description = desp; objClass.AddedDate = adddate; objClass.Type = Global.VIDEO; MediaBLL.updateEditVideoMedia(objClass); } LoadDataListMedia(); }
public static string insertMedia(MediaBO objClass) { MongoCollection <BsonDocument> objCollection = db.GetCollection <BsonDocument>("c_Media"); BsonDocument doc = new BsonDocument { { "UserId", ObjectId.Parse(objClass.UserId) }, { "AlbumId", ObjectId.Parse(objClass.AlbumId) }, { "Name", objClass.Name }, { "Caption", objClass.Caption }, { "Description", objClass.Description }, { "AddedDate", objClass.AddedDate }, { "Location", objClass.Location }, { "Type", objClass.Type }, { "isFollow", objClass.isFollow }, }; var rt = objCollection.Insert(doc); return(doc["_id"].ToString()); }
public static MediaBO getMediaByMediaId(string Id) { MongoCollection <Media> objCollection = db.GetCollection <Media>("c_Media"); MediaBO objClass = new MediaBO(); foreach (Media item in objCollection.Find(Query.EQ("_id", ObjectId.Parse(Id)))) { objClass.Id = item._id.ToString(); objClass.UserId = item.UserId.ToString(); objClass.AlbumId = item.AlbumId.ToString(); objClass.Name = item.Name; objClass.Caption = item.Caption; objClass.Location = item.Location; objClass.Description = item.Description; objClass.AddedDate = item.AddedDate; objClass.Type = item.Type; objClass.isFollow = item.isFollow; break; } return(objClass); }
public static string insertMedia(MediaBO objMedia) { return MediaDAL.insertMedia(objMedia); }
public static void updateEditVideoMedia(MediaBO objClass) { MediaDAL.updateEditVideoMedia(objClass); }
protected void Page_Load(object sender, EventArgs e) { ((Label)Master.FindControl("lblTitle")).Text = "View Video"; Photoid = QueryString.getQueryStringOnIndex(0); Userid = SessionClass.getUserId(); LoadFollow(); LoadDataListComments(); YouLikes(); string videotag=""; MediaBO objMedia=new MediaBO(); objMedia=MediaBLL.getMediaByMediaId(Photoid); videotag += " <script type= 'text/javascript' >"; videotag +=" jwplayer('container').setup({"; videotag += " file: src='" + Global.USER_VIDEO + objMedia.Id + ".mp4' ,"; videotag += " flashplayer: '../../Resources/jwplayer/player.swf',"; videotag +=" width: 520"; videotag +=" }); "; videotag +="</script> "; this.LiteralVideo.Text = videotag ; imgBtnComments.ImageUrl = Global.PROFILE_PICTURE + Userid + ".jpg"; Session["SpamPhoto"] = null; Session["AbusePhoto"] = null; }
public static void updateFollow(MediaBO objClass) { MediaDAL.updateFollow(objClass); }
public void GetPhotoDesc() { MediaBO mediaobj = new MediaBO(); mediaobj = MediaBLL.getMediaByMediaId(Photoid); LabelGetCaption.Text = mediaobj.Caption; LabelGetDesc.Text = mediaobj.Description; LabelGetLocation.Text = mediaobj.Location; imgBack.PostBackUrl="ViewPhotoAlbum.aspx?" + mediaobj.AlbumId; }
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); }
public static void updateMedia(MediaBO objMedia) { MediaDAL.updateMedia(objMedia); }
public static string insertMedia(MediaBO objMedia) { return(MediaDAL.insertMedia(objMedia)); }