Пример #1
0
        public void BindAllCmpInCumboBox()
        {
            try
            {
                cmbCampaigns_cmpFanPageLiker_SelectCampaignForUpdate.Items.Clear();

                CmpFanPageLikerRepository objCmpFanPageLikerRepository = new CmpFanPageLikerRepository();
                ICollection<CmpFanPageLiker> cmpDataCollection = objCmpFanPageLikerRepository.GetAllCampaign();

                foreach (CmpFanPageLiker item in cmpDataCollection)
                {
                    try
                    {
                        cmbCampaigns_cmpFanPageLiker_SelectCampaignForUpdate.Items.Add(item.CampaignName);
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
Пример #2
0
        public List<string> GetAllCampaignAccount()
        {
            List<string> lstAllCmpAccount = new List<string>();
            try
            {
                CmpFanPageLikerRepository objCmpFanPageLikerRepository = new CmpFanPageLikerRepository();
                ICollection<CmpFanPageLiker> cmpData = objCmpFanPageLikerRepository.GetAllCampaign();

                foreach (CmpFanPageLiker item in cmpData)
                {
                    try
                    {
                        string AccountsFile = item.AccountsFile;
                        if (File.Exists(AccountsFile))
                        {
                            List<string> lstAccounts = GlobusFileHelper.ReadFile(AccountsFile);

                            foreach (string account in lstAccounts)
                            {
                                try
                                {
                                    lstAllCmpAccount.Add("CampaignName " + item.CampaignName + " <:> Account " + account + " <:> CampaignProcess " + item.CampaignProcess);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Accounts File Not Exists : " + AccountsFile + " With Campaign Name : " + item.CampaignName);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

            return lstAllCmpAccount;
        }