public ActionResult DeleteConfirmed(int id) { FollowerList followerList = db.FollowerLists.Find(id); db.FollowerLists.Remove(followerList); db.SaveChanges(); return(RedirectToAction("Index")); }
public List <FollowerList> GetFollower(string userid, int count, string format, string apiToken, string apiTokenSecret) { SinaApiService myApi = new SinaApiService(); string myResult = myApi.get_followers(userid, count, format, consumerKey, consumerKeySecret, apiToken, apiTokenSecret); XDocument doc = XDocument.Parse(myResult); return(FollowerList.Parse(doc.Root)); }
public ActionResult Edit([Bind(Include = "Id,PersonaName,FollowerName")] FollowerList followerList) { if (ModelState.IsValid) { db.Entry(followerList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(followerList)); }
public ActionResult Create([Bind(Include = "Id,PersonaName,FollowerName")] FollowerList followerList) { if (ModelState.IsValid) { db.FollowerLists.Add(followerList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(followerList)); }
// GET: FollowerLists/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FollowerList followerList = db.FollowerLists.Find(id); if (followerList == null) { return(HttpNotFound()); } return(View(followerList)); }
public string FollowedByUser(FollowerList check, int userProfileId) { string isFollowing = "no"; if (check == null) { isFollowing = "no"; } else if (check.FollowerId == userProfileId) { isFollowing = "yes"; } return(isFollowing); }
public async Task <IActionResult> Follow1(int idBeingFollowed, [Bind("Id,ProfileId,FollowerId")] FollowerList follower, string returnUrl) { var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = await _userManager.FindByIdAsync(userId); var profileBeingFollowed = await _context.Profile.FindAsync(idBeingFollowed); if (ModelState.IsValid) { profileBeingFollowed.Followers++; follower.ProfileId = idBeingFollowed; follower.FollowerId = user.GetProfileId(); _context.Add(follower); await _context.SaveChangesAsync(); } return(Redirect(returnUrl)); }
public override void Read(NetBuffer im) { base.Read(im); int c = im.ReadInt32(); for (int i = 0; i < c; ++i) { var objid = im.ReadInt32(); var followerid = im.ReadInt32(); FollowerList.Add(new KeyValuePair <int, int>(objid, followerid)); } c = im.ReadInt32(); for (int i = 0; i < c; ++i) { var follower = im.ReadInt32(); FightFollowerList.Add(follower); } }