protected void Page_Load(object sender, EventArgs e) { GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); string photoID = Request.Form["p_id"].Trim(); string action = Request.Form["action"].Trim(); //string photoID = "1"; //测试用 //string action = "2"; //测试用 switch (action) { case "0": DataSet ds_photo_client = new DataSet(); ds_photo_client = getPhotoBLL.getClient_Photo(photoID); string json_photoClient = JsonHelper.ToJson(ds_photo_client); Response.Write(json_photoClient); break; case "1": DataSet ds_photo_comment = new DataSet(); ds_photo_comment = getPhotoBLL.getComment_Photo(photoID); string json_photoComment = JsonHelper.ToJson(ds_photo_comment); Response.Write(json_photoComment); break; case "2": DataSet ds_photo_label = new DataSet(); ds_photo_label = getPhotoBLL.getLabel_Photo(photoID); string json_photoLabel = JsonHelper.ToJson(ds_photo_label); Response.Write(json_photoLabel); break; } }
protected void Page_Load(object sender, EventArgs e) { string clientID = Session["CID"].ToString(); //string clientID = "4"; //测试用 GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); string action = Request.Form["action"].Trim(); //string action = "1"; //测试用 /////////////////////////////////////////////////浏览个人中心///////////////////////////////////// string client_id; switch (action) { case "0": //返回用户的相册及照片信息 //用户个人Album的Name及照片的photo_id,pic,like_num,comment_num,album_name,album_id if (Request.Form["c_id"] != "") { client_id = Request.Form["c_id"].ToString(); } else { client_id = clientID; } DataSet ds_albumPhoto_self = new DataSet(); ds_albumPhoto_self = getPhotoBLL.getAlbumPhoto_self(client_id); string json_albumPhotoSelf = JsonHelper.ToJson(ds_albumPhoto_self); Response.Write(json_albumPhotoSelf); break; case "1": //返回用户信息(相册数,照片数,粉丝数,关注数) //用户浏览页个人信息 if (Request.Form["c_id"] != "") { client_id = Request.Form["c_id"].ToString(); } else { client_id = clientID; } DataSet ds_client = new DataSet(); ds_client = getPhotoBLL.getClient(client_id); string json_clientSelf = JsonHelper.ToJson(ds_client); Response.Write(json_clientSelf); break; } /////////////////////////////////////////////////END/////////////////////////////////////////////// }
protected void Page_Load(object sender, EventArgs e) { string clientID = Session["CID"].ToString(); //string clientID = "1"; //测试用 GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); DataSet ds_Ifliked = new DataSet(); ds_Ifliked = getPhotoBLL.getIfLiked(clientID); string json_IfLiked = JsonHelper.ToJson(ds_Ifliked); Response.Write(json_IfLiked); }
protected void Page_Load(object sender, EventArgs e) { string clientID = Session["CID"].ToString(); //string clientID = "2"; //测试用 GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); string action = Request.Form["action"].Trim(); //从前台传来一个调用信号 //string action = "1"; //测试用 ///////////////////////////////////////////////////////首页显示关注的用户及用户发布的照片的信息/////////////////////// switch (action) { case "0": //获取首页我关注的人的信息(followeeID,nickName,pic,photo_id,photo_pic,Photo_time,comment_num,likeNum order by time desc DataSet ds_followee_photo = new DataSet(); ds_followee_photo = getPhotoBLL.getFollowee_Photo(clientID); string json_followee_photo = JsonHelper.ToJson(ds_followee_photo); Response.Write(json_followee_photo); break; case "1": //根据前台传回的PhotoId来获取这张照片的评论内容,按时间的降序排列 string photoID = Request.Form["p_id"].ToString(); //从前台传回某张照片的ID // string photoID = "3"; //测试用 DataSet ds_comment_photo = new DataSet(); ds_comment_photo = getPhotoBLL.getPhoto_Comment_Home(photoID); string json_comment_photo = JsonHelper.ToJson(ds_comment_photo); Response.Write(json_comment_photo); break; case "2": //根据前台传回的PhotoId来获取这张照片的Labelname string photo_ID = Request.Form["pa_id"].ToString(); //从前台传回某张照片的ID // string photo_ID = "3"; //测试用 DataSet ds_photoLabel = new DataSet(); ds_photoLabel = getPhotoBLL.getLabel_Photo(photo_ID); string json_photoLabel = JsonHelper.ToJson(ds_photoLabel); Response.Write(json_photoLabel); break; } //////////////////////////////////////////////////////////END/////////////////////////////////////////////////////////// }
protected void Page_Load(object sender, EventArgs e) { string clientID = Session["CID"].ToString(); //string clientID = "1"; //测试用 GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); //////////////////////////////////////////////////浏览页(推荐用户,推荐照片)/////////////////////////// string action = Request.Form["action"].Trim(); //string action = "0"; //测试用 switch (action) { case "0": //获取推荐的用户的Pic,NickName,ID DataSet ds_clientInfo = new DataSet(); ds_clientInfo = getPhotoBLL.getClientInfo(clientID); string json_clientInfo = JsonHelper.ToJson(ds_clientInfo); Response.Write(json_clientInfo); break; case "1": //获取按Label推荐的照片的Info(pic,LikeNum,CommentNum,ID) DataSet ds_photoLabel = new DataSet(); ds_photoLabel = getPhotoBLL.getPhotoByLabel(clientID); string json_photo = JsonHelper.ToJson(ds_photoLabel); Response.Write(json_photo); break; } ///////////////////////////////////////////////////////END//////////////////////////////////////////////////// }
public GetPhototResponse GetPhoto(GetPhotoRequest request) => GetPhotoBLL.Execute(request);
protected void Page_Load(object sender, EventArgs e) { string clientID = Session["CID"].ToString(); //string clientID = "1"; //测试用 GetPhotoBLL getPhotoBLL = new GetPhotoBLL(); string action = Request.Form["action"].Trim(); //string action = "1"; //测试用 ////////////////////////////////////////获取评论与存入评论//////////////////////////////////////// switch (action) { case "0": //获取某张照片的评论信息 string photoID = Request.Form["p_id"].ToString(); //从前台得到被点击的Photo的ID //string photoID = "3"; //测试用 DataSet ds_getPhoto_comment = new DataSet(); ds_getPhoto_comment = getPhotoBLL.getPhoto_comment(photoID); string json_photoComment = JsonHelper.ToJson(ds_getPhoto_comment); Response.Write(json_photoComment); break; case "1": //将照片的评论存入数据库 Comment myComment = new Comment(); myComment.Time = System.DateTime.Now; myComment.Content = Request.Form["comment_content"].ToString(); myComment.PrintUserID = int.Parse(clientID); myComment.PhotoID = int.Parse(Request.Form["p_id"].ToString()); int ru_id = int.Parse(Request.Form["ru_id"].ToString()); //int ru_id = -2; //测试用 if (ru_id < 0) { myComment.ReceiveUserID = -1; } else { myComment.ReceiveUserID = ru_id; } /////////////////////////////测试所用,等待前台传入数据 //myComment.Time = System.DateTime.Now; //myComment.Content = "测试愚蠢的错误!20"; //myComment.PrintUserID = 1; //myComment.ReceiveUserID = -1; //myComment.PhotoID = 20; ////***************************************************** int comment_signal = getPhotoBLL.addComment(myComment); if (comment_signal == 1) { Response.Write("Succeed"); } else { Response.Write("failed"); } break; case "2": //点赞与取消点赞 string photoId = Request.Form["p_id"].ToString(); //测试所用,等待前台传入PhotoID,ClientID //string photoId = "5"; int like_signal = getPhotoBLL.handleLike(photoId, clientID); if (like_signal == 0) { Response.Write("c_failed"); } else if (like_signal == 1) { Response.Write("c_Succeed"); } else if (like_signal == 2) { Response.Write("a_failed"); } else if (like_signal == 3) { Response.Write("a_Succeed"); } break; } }