Exemple #1
0
    protected void AddButton_Click(object sender, EventArgs e)
    {
        string userid = Request.QueryString["UserId"];
        string list   = ListDropDownList.SelectedValue;

        ListViewBLL.UpdateFriendList(userid, list);
    }
Exemple #2
0
    protected void btnAddListName_Click(object sender, EventArgs e)
    {
        ListViewBO obj = new ListViewBO();

        obj.ListName = txtListName.Text;
        ListViewBLL.insertListName(obj);
        ListViewGrid.DataSource = ListViewBLL.getList(Userid, Global.CONFIRMED);
        ListViewGrid.DataBind();
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Label l = (Label)Page.Master.FindControl("lblTitle");

        l.Text = "View List";

        Userid = SessionClass.getUserId();

        ListViewGrid.DataSource = ListViewBLL.getList(Userid, Global.CONFIRMED);
        ListViewGrid.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Userid = SessionClass.getUserId();

        string listname = Request.QueryString["ListName"];

        ((Label)Page.Master.FindControl("lblTitle")).Text = "Friends in " + listname + " list";
        GridViewFriendsList.DataSource = ListViewBLL.getFreindByList(Userid, Global.CONFIRMED, listname);
        GridViewFriendsList.DataBind();

        Panel1.DefaultButton = "SearchButton";
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //ListDropDownList
        string userid = Request.QueryString[0];

        if (ListDropDownList.Items.Count == 0)
        {
            foreach (ObjectLayer.ListViewBO obj in ListViewBLL.getList(userid, Global.CONFIRMED))
            {
                ListDropDownList.Items.Add(obj.ListName);
            }
        }
    }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Userid = SessionClass.getUserIdOrTempUserId();

        ((Label)Master.FindControl("lblTitle")).Text = "Manage Your Friends";
        if (!IsPostBack)
        {
            LoadFriendsList();
        }

        if (ListDropDownList.Items.Count == 0)
        {
            foreach (ObjectLayer.ListViewBO obj in ListViewBLL.getList(Userid, Global.CONFIRMED))
            {
                ListDropDownList.Items.Add(obj.ListName);
            }
        }

        Panel1.DefaultButton = "SearchButton";
    }
    private static string fid = "";//the person to whom suggestions are being given

    protected void Page_Load(object sender, EventArgs e)
    {
        Userid = SessionClass.getUserId();
        Fname  = QueryString.getQueryStringOnIndex(0);
        Lname  = QueryString.getQueryStringOnIndex(1);
        ((Label)Master.FindControl("lblTitle")).Text = "Suggest Friends to " + Fname + " " + Lname;
        if (!IsPostBack)
        {
            LoadSuggestions("");

            if (ddl_FilterByList.Items.Count == 0)
            {
                ddl_FilterByList.Items.Add("None");
                foreach (ObjectLayer.ListViewBO obj in ListViewBLL.getDefaultListNames())
                {
                    ddl_FilterByList.Items.Add(obj.ListName);
                }
            }
        }
    }
Exemple #8
0
    protected void AddButton_Click(object sender, EventArgs e)
    {
        string userid = Request.QueryString["UserId"];
        string list   = ListDropDownList.SelectedValue;

        //Response.Write(list);

        ArrayList indicesList = new ArrayList();

        for (int i = 0; i < MultiSelectGrid.Rows.Count; i++)
        {
            GridViewRow row = MultiSelectGrid.Rows[i];
            // 0 means the first column if your Select column is not first write it 's correct index
            CheckBox chk = row.Cells[0].FindControl("chkSelect") as CheckBox;
            if (chk != null && chk.Checked)
            {
                string value = MultiSelectGrid.Rows[i].Cells[1].Text;
                ListViewBLL.UpdateFriendListSearch(value, list);
            }
        }
        Response.Redirect("AdvanceOptions.aspx");
        // ListViewBLL.UpdateFriendList(userid, list);
    }
    protected void LoadSuggestions(string FilterByListName)
    {
        list  = new List <UserFriendsBO>();
        list2 = new List <UserFriendsBO>();
        List <UserFriendsBO> userlist = new List <UserFriendsBO>();
        List <UserFriendsBO> reclist  = new List <UserFriendsBO>();

        list = getfriends_list(FilterByListName);

        foreach (UserFriendsBO Useritem in list)
        {
            if (VerifyUserItem(Useritem.FirstName, Useritem.LastName))
            {
                userlist.Add(Useritem);
                fid = Useritem.FriendUserId;
            }
            else
            {
                list2.Add(Useritem);
            }
        }

        List <UserFriendsBO> mutualfriendslist     = FriendsBLL.getMutualFriends(Userid, fid, Global.CONFIRMED);
        IEqualityComparer <UserFriendsBO> comparer = new UserFriendsComparer();
        List <UserFriendsBO> l3     = list2.Except(mutualfriendslist, comparer).ToList();
        List <UserFriendsBO> PSlist = FriendsBLL.getPSFriends(fid);
        List <UserFriendsBO> l4     = l3.Except(PSlist, comparer).ToList();

        AllSuggestionsDataList.DataSource = l4;
        AllSuggestionsDataList.DataBind();
        MutualDataList.DataSource = mutualfriendslist;
        MutualDataList.DataBind();

        string belongsto = ListViewBLL.getListName(Userid, fid);

        foreach (UserFriendsBO Useritem in l4)
        {
            Useritem.Score = 0;
            string belongsto1 = ListViewBLL.getListName(Userid, Useritem.FriendUserId);
            string belongsto2 = ListViewBLL.getListName(Useritem.FriendUserId, Userid);

            if (belongsto1.Equals(belongsto) || belongsto2.Equals(belongsto))//if no value specified by user by default true
            {
                Useritem.Score += 1 * Global.WEIGHT_LIST;
            }
        }
        List <UserFriendsBO> scoredlist = FriendsBLL.RecommendationScoring(l4, fid);

        reclist = scoredlist.Take(6).ToList();
        RecSuggestionsDataList.DataSource = reclist;
        RecSuggestionsDataList.DataBind();

        l4 = l4.Except(reclist, comparer).ToList();

        PagedDataSource objPds = new PagedDataSource();

        objPds.DataSource       = l4;
        objPds.AllowPaging      = true;
        objPds.PageSize         = 6;
        objPds.CurrentPageIndex = CurrentPage;
        lblCurrentPage.Text     = "Page: " + (CurrentPage + 1).ToString() + " of " + objPds.PageCount.ToString();

        cmdPrev.Enabled = !objPds.IsFirstPage;
        cmdNext.Enabled = !objPds.IsLastPage;

        AllSuggestionsDataList.DataSource = objPds;
        AllSuggestionsDataList.DataBind();
    }
Exemple #10
0
 protected void LoadListView()
 {
     ListViewGrid0.DataSource = ListViewBLL.getList(userid, Global.CONFIRMED).Take(5).ToList();
     ListViewGrid0.DataBind();
 }