public ActionResult DeleteConfirmed(int id) { DiscussionInfo discussionInfo = db.DiscussionInfoes.Find(id); db.DiscussionInfoes.Remove(discussionInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DiscussionInfoId,Message,DiscussionId,User")] DiscussionInfo discussionInfo) { if (ModelState.IsValid) { db.Entry(discussionInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DiscussionId = new SelectList(db.Discussions, "DiscussionId", "Name", discussionInfo.DiscussionId); return(View(discussionInfo)); }
public ActionResult Create([Bind(Include = "DiscussionInfoId,Message,DiscussionId,User")] DiscussionInfo discussionInfo) { if (ModelState.IsValid) { db.DiscussionInfoes.Add(discussionInfo); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DiscussionId = new SelectList(db.Discussions, "DiscussionId", "Name", discussionInfo.DiscussionId); return(View(discussionInfo)); }
// GET: DiscussionInfoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DiscussionInfo discussionInfo = db.DiscussionInfoes.Find(id); if (discussionInfo == null) { return(HttpNotFound()); } return(View(discussionInfo)); }
internal Node CreateDiscussion(int parentID, string name, int createdBy) { DiscussionInfo info = new DiscussionInfo(); info.Name = name; info.CreatedBy = createdBy; info.ParentID = parentID; ReAuthenticateIfRequired(); Node node = fCollaborationService.CreateDiscussion(ref fCollaborationAuthentication, info); UpdateAuthenticationTokens(fCollaborationAuthentication.AuthenticationToken); return(node); }
// GET: DiscussionInfoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DiscussionInfo discussionInfo = db.DiscussionInfoes.Find(id); if (discussionInfo == null) { return(HttpNotFound()); } ViewBag.DiscussionId = new SelectList(db.Discussions, "DiscussionId", "Name", discussionInfo.DiscussionId); return(View(discussionInfo)); }
/// <summary> /// Get the QQ discussion group member profile /// </summary> /// <param name="discussionAccount"></param> private void LoadDiscussionAccountDetailedInfo(DiscussionAccount discussionAccount) { string url = "http://d1.web2.qq.com/channel/get_discu_info?did=#{discuss_id}&psessionid=#{psessionid}&vfwebqq=#{vfwebqq}&clientid=53999199&t=#{t}".Replace("#{t}", HTTP.AID_TimeStamp()); url = url.Replace("#{discuss_id}", discussionAccount.Did).Replace("#{psessionid}", smartQQ.PSessionId).Replace("#{vfwebqq}", smartQQ.VFWebQQ); string dat = HTTP.Get(url, "http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2"); DiscussionInfo discussionInfo = (DiscussionInfo)JsonConvert.DeserializeObject(dat, typeof(DiscussionInfo)); Dictionary <string, string> MemberList = new Dictionary <string, string>(); if (discussionInfo.result.mem_info != null) { foreach (var memberInfo in discussionInfo.result.mem_info) { MemberList.Add(memberInfo.uin, memberInfo.nick); } } Dictionary <string, string> MemberStatusList = new Dictionary <string, string>(); if (discussionInfo.result.mem_status != null) { foreach (var status in discussionInfo.result.mem_status) { MemberStatusList.Add(status.uin, status.status); } } if (discussionInfo.result.info.mem_list != null) { discussionAccount.Members = new List <DiscussionMember>(); foreach (var member in discussionInfo.result.info.mem_list) { DiscussionMember discussionMember = new DiscussionMember(); discussionMember.Ruin = member.ruin; discussionMember.Uin = member.mem_uin; discussionMember.Name = MemberList.ContainsKey(discussionMember.Uin) ? MemberList[discussionMember.Uin] : ""; discussionMember.Status = MemberStatusList.ContainsKey(discussionMember.Uin) ? MemberStatusList[discussionMember.Uin] : ""; discussionAccount.Members.Add(discussionMember); } } }
public JsonResult FetchDiscussions(int ideaId, int page, int pagelength) { DiscussionInfo info = ProcessFactory.GetDiscussionProcess().GetDiscussion(ideaId, page, pagelength); return(Json(info)); }