Пример #1
0
        public TweetListVM()
        {
            BirdUsers    = new List <BirdUser>();
            BirdComments = new List <BirdComment>();
            BirdLikes    = new List <BirdLike>();
            BirdTweets   = new List <BirdTweet>();
            //BirdUser = new BirdUserDTO();

            BirdTweet = new BirdTweet();
            BirdUser  = new BirdUser();
        }
Пример #2
0
        public ActionResult Add(BirdTweet data)
        {
            //System.Security.Principal.WindowsIdentity.GetCurrent().Name;(windows ismini)
            //if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated == true)
            //{
            //    AuthPrincipals auth_users = (AuthPrincipals)System.Web.HttpContext.Current.User;
            //    if (auth_users != null)
            //    {
            //        userid = Convert.ToInt32(auth_users.UserId);
            //    }
            //}

            string   isim     = Session["MemberFullName"].ToString();
            BirdUser birdUser = _birdUserService.GetByDefault(x => x.UserName == isim);

            //BirdTweet newTweet = new BirdTweet();
            //newTweet.TweetContent = data.TweetContent;
            data.Status     = MyBird.Core.Enum.Status.Active;
            data.BirdUserID = birdUser.ID;
            _birdTweetService.Add(data);
            return(Redirect("/AppUser/Home/Index"));
        }