Exemple #1
0
 protected void GetFriends_Click(object sender, EventArgs e)
 {
     //this launches the modal thing
     //get new info on friends...
     if (myfriends.Tables["AllFriendRequests"].Rows.Count > 0)
     {
         AddFriendRepeater.DataSource = myfriends;
         AddFriendRepeater.DataMember = "AllFriendRequests";
         AddFriendRepeater.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     UserId    = NaitBook.NaitBookController.LookupUserByName(User.Identity.Name);
     myfriends = NaitBook.NaitBookController.getFriendRequest(UserId);
     if (myfriends.Tables["AllFriendRequests"].Rows.Count > 0)
     {
         FriendRequest.Text = "You have friend requests.";
         //uxModalPopupExtender.Show();
         AddFriendRepeater.DataSource = myfriends;
         AddFriendRepeater.DataMember = "AllFriendRequests";
         AddFriendRepeater.DataBind();
     }
 }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //uxModalPopupExtender.Show();
            UserId      = int.Parse(Request.QueryString["UserId"]);
            ProfileUser = NaitBook.NaitBookController.LookupUser(UserId);
            conUserId   = NaitBook.NaitBookController.LookupUserByName(User.Identity.Name);
            Username    = ProfileUser.Tables[0].Rows[0]["Username"].ToString();

            uxProfileImage.ImageUrl = System.Configuration.ConfigurationManager.
                                      AppSettings["RelativeImagesDirectoryLocation"].ToString()
                                      + ProfileUser.Tables[0].Rows[0]["imageloc"].ToString();

            uxName.Text = ProfileUser.Tables[0].Rows[0]["F_Name"].ToString()
                          + " " + ProfileUser.Tables[0].Rows[0]["L_Name"].ToString();
            if ((conUserId == UserId) && (statflag == false))
            {
                UserStatus = NaitBook.NaitBookController.GetLastStatusById(conUserId);
                if (UserStatus.Tables[0].Rows.Count > 0)
                {
                    NewStatus.Text = UserStatus.Tables[0].Rows[0]["myStatus"].ToString();
                }
            }
            if (!(Page.IsPostBack))
            {
                myfriends = NaitBook.NaitBookController.getFriendRequest(UserId);

                if (myfriends.Tables["AllFriendRequests"].Rows.Count > 0)
                {
                    FriendRequest.Text = "You have friend requests.";
                    //uxModalPopupExtender.Show();
                    AddFriendRepeater.DataSource = myfriends;

                    //AddFriendRepeat.DataSource = myfriends;
                    AddFriendRepeater.DataMember = "AllFriendRequests";
                    AddFriendRepeater.DataBind();
                }
            }
            try
            {//check for no posts
                AllPosts = NaitBook.NaitBookController.GetPostsById(UserId);
                if (AllPosts.Tables[0].Rows.Count > 0)
                {
                    uxPostRepeater.DataSource = AllPosts;
                    uxPostRepeater.DataMember = "myPosts";
                    uxPostRepeater.DataBind();
                    postImgLoc = System.Configuration.ConfigurationManager.
                                 AppSettings["RelativeImagesDirectoryLocation"].ToString()
                                 + AllPosts.Tables[0].Rows[0]["ImageLoc"].ToString();
                }
                AllUsers = NaitBook.NaitBookController.GetMemberFriends(UserId);
                //.LookupAllUsers();//this will soon be look up all friends
                //.GetUserStatus(conUserId);//this will soon be look up all friends
                //.LookupAllUsers();//this will soon be look up all friends
                if (AllUsers.Tables["Users"].Rows.Count > 0)
                {
                    System.Web.UI.WebControls.Image grdImage = new System.Web.UI.WebControls.Image();
                    //grdImage = e.Item.FindControl("imag");
                    // grdImage.ImageUrl = Strings.Trim(e.Item.Cells(1).Text);
                    //MembersFriends =AjaxClass.lesson2Construct.GetMemberFriends(Request.QueryString["UserLogonId"]);
                    uxFriendDatalist.DataSource = AllUsers.Tables["Users"];
                    uxFriendDatalist.DataMember = "Users";
                    uxFriendDatalist.DataBind();
                    //uxFriendGridView1.DataSource = AllUsers.Tables["Users"];
                    //uxFriendGridView1.DataMember = "Users";
                    //uxFriendGridView1.DataBind();
                }
                AllUsersStats = NaitBook.NaitBookController.GetAllUserStatus();
                //if (AllUserStats.Tables["UserStatus"].Rows.Count > 0)
                //{
                uxFriendStatusRepeater.DataSource = AllUsersStats.Tables["UserStatus"];
                uxFriendStatusRepeater.DataMember = "UserStatus";
                uxFriendStatusRepeater.DataBind();
                //}
            }catch (Exception ex) { Label1.Text = "Posts ERROR: " + ex.Message.ToString(); }
        }