コード例 #1
0
        public ActionResult FollowUser(PersonVM collection)
        {
            try
            {
                Following f = new Following()
                {
                    UserId         = collection.UserId,
                    FollowerUserId = Session["UserId"].ToString()
                };
                obj.AddFollowers(f);

                Person objPerson = new Person();
                objPerson = obj.GetUser(Session["SerchText"].ToString());

                PersonVM personVM = new PersonVM()
                {
                    UserId       = objPerson.UserId,
                    Name         = objPerson.Name,
                    Pwd          = Decrypt(objPerson.Pwd).ToString(),
                    Email        = objPerson.Email,
                    ProfileImage = objPerson.ProfileImage,
                    Joined       = objPerson.Joined,
                    Active       = objPerson.Active,
                    status       = ""
                };
                return(RedirectToAction("Index", "Home"));
            }
            catch (Exception Ex)
            {
                Logger.WriteError(Ex, "FollowUser", "User");
                return(View("Error"));
            }
        }