public void deletemenu(HttpContext context) { global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); string s = ""; s = bo.deletemenu(); context.Response.Write(s); }
public void createmenu(HttpContext context) { global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); string s = ""; if (!string.IsNullOrEmpty(context.Request["comment"])) { s = bo.createmenu(context.Request["comment"]); } context.Response.Write(s); }
public void statusesupdate(HttpContext context) { global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); string s = ""; if (!string.IsNullOrEmpty(context.Request["status"])) { s = bo.statusesupdate(context.Request["status"].ToString().Replace("alert", "Alert"), context.Request["img"]); } context.Response.Write(s); }
public void SendToUIDMessage(HttpContext context) { global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); string msgtype = context.Request["msgtype"]; string displayname = context.Request["displayname"]; string summary = context.Request["summary"]; string image = context.Request["image"]; string url = context.Request["url"]; string content = context.Request["Content"]; string articleId = context.Request["ArticleId"]; string s = bo.SendToUIDMessage(msgtype, displayname, summary, image, url, content, articleId); context.Response.Write(s); }
public void savemenu(HttpContext context) { string comment = "{"; IList <MenuInfo> topMenus = WeiboHelper.GetTopMenus(); if (topMenus.Count > 0) { comment = comment + "\"button\":["; foreach (MenuInfo info in topMenus) { IList <MenuInfo> menusByParentId = WeiboHelper.GetMenusByParentId(info.MenuId); comment = comment + "{\"name\": \"" + Globals.String2Json(info.Name) + "\","; if (menusByParentId.Count > 0) { comment = comment + "\"sub_button\":["; foreach (MenuInfo info2 in menusByParentId) { comment = comment + "{\"type\": \"" + info2.Type + "\","; comment = comment + "\"name\": \"" + Globals.String2Json(info2.Name) + "\","; if (info2.Type == "click") { comment = comment + "\"key\": \"" + Globals.String2Json(info2.Content) + "\"},"; } else { comment = comment + "\"url\": \"" + Globals.String2Json(info2.Content) + "\"},"; } } comment = comment.Substring(0, comment.Length - 1); comment = comment + "]},"; } else { comment = comment + "\"type\": \"" + info.Type + "\","; if (info.Type == "click") { comment = comment + "\"key\": \"" + Globals.String2Json(info.Content) + "\"},"; } else { comment = comment + "\"url\": \"" + Globals.String2Json(info.Content) + "\"},"; } } } comment = comment.Substring(0, comment.Length - 1) + "]" + "}"; comment = new global::ControlPanel.WeiBo.WeiBo().createmenu(comment); context.Response.Write(comment); } }
private void RepMessage_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { string id = DataBinder.Eval(e.Item.DataItem, "Sender_id").ToString(); global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); JObject obj2 = JObject.Parse(bo.userinfo(id)); Literal literal = (Literal)e.Item.FindControl("LitUserName"); if (obj2["id"] != null) { Image image = (Image)e.Item.FindControl("Pic"); image.ImageUrl = obj2["profile_image_url"].ToString(); literal.Text = obj2["screen_name"].ToString(); } if (string.IsNullOrEmpty(literal.Text)) { literal.Text = "您访问太过频繁,微博接口禁止调用。"; } } }
public void sendmessage(HttpContext context) { global::ControlPanel.WeiBo.WeiBo bo = new global::ControlPanel.WeiBo.WeiBo(); string type = context.Request["msgtype"]; string str2 = context.Request["SenderId"]; string s = context.Request["MessageId"]; string msgtype = context.Request["msgtype"]; string displayname = context.Request["displayname"]; string summary = context.Request["summary"]; string image = context.Request["image"]; string url = context.Request["url"]; string content = context.Request["Content"]; string articleId = context.Request["ArticleId"]; string data = this.SendToUIDMessage(msgtype, displayname, summary, image, url, content, articleId); string json = bo.sendmessage(type, str2, data); JObject obj2 = JObject.Parse(json); if ((obj2["result"] != null) && (obj2["result"].ToString() == "true")) { MessageInfo messageInfo = new MessageInfo(); if (!string.IsNullOrEmpty(articleId)) { messageInfo.ArticleId = int.Parse(articleId); } messageInfo.DisplayName = displayname; messageInfo.Summary = summary; messageInfo.SenderMessage = content; messageInfo.Url = url; messageInfo.Image = image; messageInfo.SenderDate = DateTime.Now; messageInfo.MessageId = int.Parse(s); messageInfo.Status = 1; WeiboHelper.UpdateMessage(messageInfo); } context.Response.Write(json); }
public void getfriends(HttpContext context) { string s = new global::ControlPanel.WeiBo.WeiBo().getfriends(); context.Response.Write(s); }
public void friends_timeline(HttpContext context) { string s = new global::ControlPanel.WeiBo.WeiBo().friends_timeline(int.Parse(context.Request["page"])); context.Response.Write(s); }
public void userinfo(HttpContext context) { string s = new global::ControlPanel.WeiBo.WeiBo().userinfo(); context.Response.Write(s); }
public void commentscreate(HttpContext context) { string s = new global::ControlPanel.WeiBo.WeiBo().commentscreate(context.Request["id"], context.Request["comment"]); context.Response.Write(s); }