예제 #1
0
        private void cmbGroupUser_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <string> allacount = new List <string>();
            string        GetUserID = string.Empty;

            chkUpdateCollection.Items.Clear();
            GroupStatus.GroupUrl.Clear();
            try
            {
                GetUserID    = cmbGroupUser.SelectedItem.ToString();
                label47.Text = cmbGroupUser.SelectedItem.ToString();


                foreach (KeyValuePair <string, Dictionary <string, string> > item in GrpMess)
                {
                    if (GetUserID.Contains(item.Key))
                    {
                        List <string> GmUserIDs = new List <string>();
                        foreach (KeyValuePair <string, string> item1 in item.Value)
                        {
                            string   group  = item1.Key;
                            string[] group1 = group.Split('#');

                            if (GetUserID == group1[1].ToString())
                            {
                                chkUpdateCollection.Items.Add(group1[1] + '#' + group1[0].ToString());
                                GroupStatus.GroupUrl.Add(item1.Value);
                            }
                        }
                    }

                    if (GetUserID == "Select All Account")
                    {
                        foreach (string Users in cmbGroupUser.Items)
                        {
                            string grpUser = Users;
                            foreach (KeyValuePair <string, string> item2 in item.Value)
                            {
                                string   group1 = item2.Key;
                                string[] group2 = group1.Split('#');



                                //#x2019;s

                                try
                                {
                                    //if (grpUser == group2[1].ToString())
                                    //{
                                    GroupStatus.GroupUrl.Add(item2.Value);
                                    allacount.Add(group2[1] + ':' + group2[0].ToString());
                                    GroupStatus.GroupUrl = GroupStatus.GroupUrl.Distinct().ToList();
                                    allacount            = allacount.Distinct().ToList();
                                    //}
                                }
                                catch { }
                            }
                        }
                    }
                }
                //x2019;s
                //x2018;
                foreach (var AllGroups in allacount)
                {
                    var _AllGroups = AllGroups.Replace("x2018", string.Empty).Replace("x2019;s", "").Trim();
                    chkUpdateCollection.Items.Add(_AllGroups);
                    //AddLoggerScrapeUsers(DateTime.Now + " [ " + GroupStatus.GroupUrl.Count() + " Groups List of :" + "" + GetUserID + " ]");
                    //AddLoggerScrapeUsers(DateTime.Now + " [ Finished Adding Groups of Usernames ]");
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
        }