protected void postButton_ServerClick(object sender, EventArgs e)
        {
            string statusToPost = newStatus.Value.ToString();

            string user = Application["UserName"].ToString();

            ADOMethods.Status_Add(user, statusToPost);
            PostArea.Controls.Clear();
            getStatusList();
            //setAPost(user, statusToPost, 0, 0);
        }
        public void getStatusList()
        {
            //string user = Application["UserName"].ToString();
            string user = userInBar;

            string[] status = ADOMethods.Status_Display(user);

            for (int i = 0; i < status.Length - 1; i++)
            {
                int nol = ADOMethods.Likes_Display(user, status[i]);
                setAPost(user, status[i], nol);
            }
        }
        protected void SignUp_Click(object sender, EventArgs e)
        {
            string username        = UserName.Text;
            string password        = Password.Text;
            string confirmPassword = ConfirmPassword.Text;

            if (String.Compare(password, confirmPassword) == 0)
            {
                ADOMethods.LoginAdd(username, password);
                Response.Redirect("Index.aspx");
            }
            else
            {
                FailureText.Text = "Password and Confirm Password doesn't match.";
            }
        }
        public static string cProcessDisLike(string data)
        {
            char[]   a     = { '*' };
            string[] dat   = data.Split(a);
            string   data1 = dat[0];

            for (int i = 1; i < dat.Length; i++)
            {
                data1 += " " + dat[i];
            }
            ADOMethods.Dec_Comment(data1);
            int    likes = ADOMethods.Likes_Comments(data1);
            string ret   = likes + "$" + data;

            setConsole(ret);
            return(ret);
        }
        public static string ProcessDisLike(string data)
        {
            string[] newD     = data.Split('_');
            string   username = newD[0];

            string[] statusr = newD[1].Split(':');
            string   status  = statusr[0];

            for (int i = 1; i < statusr.Length; i++)
            {
                status += " " + statusr[i];
            }
            ADOMethods.Likes_Decrement(username, status);
            int likes = ADOMethods.Likes_Display(username, status);

            return(data + "=" + likes);
        }
        protected void setPendingList()
        {
            //Get Pending User data
            pendingList.Items.Clear();
            string[] pendingFriends = ADOMethods.Friend_List_Pending(currentUser);

            for (int i = 0; i < pendingFriends.Length - 1; i++)
            {
                pendingList.Items.Add(new ListItem(pendingFriends[i]));
            }

            //Drop Down List of pending
            if (pendingFriends.Length == 1)
            {
                Accept.Visible      = false;
                Reject.Visible      = false;
                pendingList.Visible = false;
            }
        }
        protected void setFriendList()
        {
            friendList.Controls.Clear();

            string[]       friends = ADOMethods.Friend_List(currentUser);
            LiteralControl list    = new LiteralControl();
            // <li><a href='~/TimeLine.aspx?uid=name'></a></li>
            string inText = "<ul>";

            for (int i = 0; i < friends.Length - 1; i++)
            {
                inText += "<li><a href='TimeLine.aspx' onclick='getUser(this)'>" + "<b><i><h3>" + friends[i] + "</h3>" + "</a></li>";
            }

            inText += "</ul>";

            list.Text = inText;
            friendList.Controls.Add(list);
        }
        public static void AddCmt(string data)
        {
            char[]   b     = { '%' };
            string[] temp1 = data.Split(b);
            string   cmt   = temp1[0];

            data = temp1[1];

            char[]   a    = { '~' };
            string[] temp = data.Split(a);
            data = temp[1];
            string[] newD     = data.Split('_');
            string   username = newD[0];

            string[] statusr = newD[1].Split(':');
            string   status  = statusr[0];

            for (int i = 1; i < statusr.Length; i++)
            {
                status += " " + statusr[i];
            }

            ADOMethods.Add_Comment(cmt, status);
        }
        public static string[] ProcessCmts(string data)
        {
            string[] newD     = data.Split('_');
            string   username = newD[0];

            string[] statusr = newD[1].Split(':');
            string   status  = statusr[0];

            for (int i = 1; i < statusr.Length; i++)
            {
                status += " " + statusr[i];
            }
            string[] cmts = ADOMethods.Status_Comments(status);
            for (int i = 0; i < cmts.Length; i++)
            {
                int x = ADOMethods.Likes_Comments(cmts[i]);
                cmts[i] = x + "$" + cmts[i];
            }
            if (cmts.Length == 1)
            {
                cmts[0] = "H";
            }
            return(cmts);
        }
        public string[] GetCompletionList(string prefixText, int count)
        {
            string[] cs = ADOMethods.UsersList(prefixText);

            return(cs);
        }
 protected void Reject_Click(object sender, EventArgs e)
 {
     ADOMethods.Request_Reject(currentUser, pendingList.SelectedItem.Text);
     setPendingList();
     setFriendList();
 }
 protected void AddFriend_Click(object sender, EventArgs e)
 {
     userInBar = TextBox2.Text;
     ADOMethods.Request_Sent(currentUser, userInBar);
 }