Beispiel #1
0
        private void btnScheduleForLater_Tweeter_Click(object sender, EventArgs e)
        {
            //InsertUpdateSchedulerModule(strModule(Module.Tweet), dateTimePicker_Follower.Value.ToString());
            MessageBox.Show("Please Upload All Data To Start Tweeting");

            if (CheckTweeting())
            {
                string IsScheduledDaily = "0";
                if (chkScheduleDaily_Follow.Checked)
                {
                    IsScheduledDaily = "1";
                }
                clsDBQueryManager queryManager = new clsDBQueryManager();
                queryManager.InsertUpdateTBScheduler("", "Tweet_", dateTimePicker_tweeterStart.Value.ToString(), IsScheduledDaily);

                if (scheduler != null && scheduler.IsDisposed == false)
                {
                    scheduler.LoadDataGrid();
                }

                if (!string.IsNullOrEmpty(txtNoOfTweets.Text) && Globals.IdCheck.IsMatch(txtNoOfTweets.Text))
                {
                    TweetAccountManager.NoOfTweets = int.Parse(txtNoOfTweets.Text);
                }

                listTweetMessages = listTweetMessages.Distinct().ToList();

                foreach (string item in listTweetMessages)
                {
                    TweetAccountManager.que_TweetMessages.Enqueue(item);
                }

                GlobusFileHelper.WriteStringToTextfile(txtTweetMessageFile.Text, Globals.Path_TweetSettings);

                MessageBox.Show("Task Scheduled");
                AddToGeneralLogs("Task Scheduled");
                IsTweetScheduled = true;
            }
            else
            {
                AddToLog_Tweet("Please Add All Data");
            }



        }
Beispiel #2
0
        private void btnScheduleForLater_Follower_Click(object sender, EventArgs e)
        {
            //ReadFollowSettings();

            MessageBox.Show("Please upload all Relevant Data used for running Follow Module. These Data will be used when scheduled task is run");

            if (FollowValidations())
            {

                try
                {
                    string IsScheduledDaily = "0";
                    if (chkScheduleDaily_Follow.Checked)
                    {
                        IsScheduledDaily = "1";
                    }
                    clsDBQueryManager queryManager = new clsDBQueryManager();
                    queryManager.InsertUpdateTBScheduler("", "Follow", dateTimePicker_Follow.Value.ToString(), IsScheduledDaily);

                    if (scheduler != null && scheduler.IsDisposed == false)
                    {
                        scheduler.LoadDataGrid();
                    }

                    //Save Settings in Text File
                    string strOtherUser = "******";
                    if (!string.IsNullOrEmpty(txtOtherfollow.Text) && !string.IsNullOrEmpty(txtUserOtherNumber.Text))
                    {
                        strOtherUser = "******";
                    }

                    string strChkFollowers = "0";
                    if (chkFollowers.Checked)
                    {
                        strChkFollowers = "1";
                    }
                    string strChkFollowings = "0";
                    if (chkFollowings.Checked)
                    {
                        strChkFollowings = "1";
                    }
                    string strchkUseDivide = "0";
                    if (chkUseDivide.Checked)
                    {
                        strchkUseDivide = "1";
                    }
                    string strrdBtnDivideEqually = "0";
                    if (rdBtnDivideEqually.Checked)
                    {
                        strrdBtnDivideEqually = "1";
                    }
                    string strrdBtnDivideByGivenNo = "0";
                    if (rdBtnDivideByGivenNo.Checked)
                    {
                        strrdBtnDivideByGivenNo = "1";
                    }

                    GlobusFileHelper.WriteStringToTextfile(txtUserIDtoFollow.Text + "<:>" + txtPathUserIDs.Text + "<:>" + txtOtherfollow.Text + "<:>" + txtUserOtherNumber.Text + "<:>" + strChkFollowers + "<:>" + strChkFollowings + "<:>" + strchkUseDivide + "<:>" + strrdBtnDivideEqually + "<:>" + strrdBtnDivideByGivenNo + "<:>" + txtScrapeNoOfUsers.Text + "<:>" + txtFollowMinDelay.Text + "<:>" + txtFollowMaxDelay.Text + "<:>" + txtNoOfFollowThreads.Text, Globals.Path_FollowSettings);

                    MessageBox.Show("Task Scheduled");
                    AddToGeneralLogs("Task Scheduled");
                    /////Updates new Paths in tb_Setting
                    //if (!string.IsNullOrEmpty(txtNames.Text) && !string.IsNullOrEmpty(txtUsernames.Text) && !string.IsNullOrEmpty(txtEmails.Text))
                    //{
                    //    objclsSettingDB.InsertOrUpdateSetting("Follow", "Name", StringEncoderDecoder.Encode(txtNames.Text));
                    //    objclsSettingDB.InsertOrUpdateSetting("Follow", "Username", StringEncoderDecoder.Encode(txtUsernames.Text));
                    //    objclsSettingDB.InsertOrUpdateSetting("Follow", "Email", StringEncoderDecoder.Encode(txtEmails.Text));
                    //}
                }
                catch (Exception ex)
                {
                    AddToLog_Follower("Error in Task Scheduling : " + ex.Message);
                    GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> btnScheduleForLater_Follower_Click() --> " + ex.Message, Globals.Path_FollowerErroLog);
                    GlobusFileHelper.AppendStringToTextfileNewLine("Error --> btnScheduleForLater_Follower_Click() --> " + ex.Message, Globals.Path_TwtErrorLogs);
                }
            }
        }
Beispiel #3
0
        private void btnScheduleForLater_Tweeter_Click(object sender, EventArgs e)
        {
            //InsertUpdateSchedulerModule(strModule(Module.Tweet), dateTimePicker_Follower.Value.ToString());

            if (dateTimePicker_tweeterStart.Value < DateTime.Now)
            {
                AddToGeneralLogs("[ " + DateTime.Now + " ] => [ Time Already Over. Please Select Time After The Present Time ]");
                return;
            }
            if (dateTimePicker_TwetterEnd.Value < DateTime.Now && (dateTimePicker_TwetterEnd.Value - dateTimePicker_tweeterStart.Value).TotalMinutes < 0)
            {
                AddToGeneralLogs("[ " + DateTime.Now + " ] => [ Time Already Over. Please Select Time After The Present Time ]");
                return;
            }
            try
            {
                if (CheckTweeting())
                {
                    string IsScheduledDaily = "0";
                    if (chkboxTweetScheduledDaily.Checked)
                    {
                        IsScheduledDaily = "1";
                    }
                    clsDBQueryManager queryManager = new clsDBQueryManager();
                    queryManager.InsertUpdateTBScheduler("", "Tweet_", dateTimePicker_tweeterStart.Value.ToString(), IsScheduledDaily);

                    if (scheduler != null && scheduler.IsDisposed == false)
                    {
                        scheduler.LoadDataGrid();
                    }

                    if (!string.IsNullOrEmpty(txtNoOfTweets.Text) && Globals.IdCheck.IsMatch(txtNoOfTweets.Text))
                    {
                        TweetAccountManager.NoOfTweets = int.Parse(txtNoOfTweets.Text);
                    }

                    listTweetMessages = listTweetMessages.Distinct().ToList();

                    foreach (string item in listTweetMessages)
                    {
                        TweetAccountManager.que_TweetMessages.Enqueue(item);
                    }

                    // GlobusFileHelper.WriteStringToTextfile(txtTweetMessageFile.Text, Globals.Path_TweetSettings);

                    MessageBox.Show("Task Scheduled");
                    AddToGeneralLogs("[ " + DateTime.Now + " ] => [ Task Scheduled ]");
                    IsTweetScheduled = true;
                }
                else
                {
                    AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Please Add All Data ]");
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> StartFollowing() -- foreach loop Foreach Dictiinoary --> " + ex.Message, Globals.Path_TweetingErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> btnScheduleForLater_Tweeter_Click --> " + ex.Message, Globals.Path_TwtErrorLogs);
            }
        }
Beispiel #4
0
        private void btn_waitandreplyscheduler_Click(object sender, EventArgs e)
        {
            try
            {
                //InsertUpdateSchedulerModule(strModule(Module.Tweet), dateTimePicker_Follower.Value.ToString());
                //MessageBox.Show("Please Upload All Data To Start Wait And Reply");

                if (CheckWaitAndReply())
                {
                    string IsScheduledDaily = "0";
                    if (chkScheduleDaily_waitandreply.Checked)
                    {
                        IsScheduledDaily = "1";
                    }
                    clsDBQueryManager queryManager = new clsDBQueryManager();
                    queryManager.InsertUpdateTBScheduler("", "WaitAndReply_", dateTimePicker_WaitandreplyStart.Value.ToString(), IsScheduledDaily);

                    if (scheduler != null && scheduler.IsDisposed == false)
                    {
                        scheduler.LoadDataGrid();
                    }

                  
                   
                    string wait_replyFilename =txtReplyMsgFile.Text;
                    string wait_replytweetfilename =txtTweetMsgFile.Text;
                    string wait_replyKeyword=txtKeyword.Text;
                    string wait_replyKeywordFile=txtKeywordFile.Text;


                    string strchkUseSpinnedMessages = "0";
                    if (chkUseSpinnedMessages.Checked)
                    {
                        strchkUseSpinnedMessages = "1";
                    }

                    string strtweetsperreply = "4";
                    if (txtNoOfTweetsperReply.Text!=strtweetsperreply)
                    {
                        strtweetsperreply = txtNoOfTweetsperReply.Text;
                    }


                    string strNoOfRepliesPerKeyword = "10";
                    if (txtNoOfRepliesPerKeyword.Text!=strNoOfRepliesPerKeyword && int.Parse(txtNoOfRepliesPerKeyword.Text)!=0)
                    {
                        strNoOfRepliesPerKeyword = txtNoOfRepliesPerKeyword.Text;
                    }

                    string strInterval_WaitReply = "10";
                    if (txtInterval_WaitReply.Text!=strInterval_WaitReply && int.Parse(txtInterval_WaitReply.Text)!=0)
                    {
                        strInterval_WaitReply = txtInterval_WaitReply.Text;
                    }

                    string strWaitReplyThreads= "7";
                    if (txtWaitReplyThreads.Text!=txtWaitReplyThreads.Text&& int.Parse(txtWaitReplyThreads.Text)!=0)
                    {
                        strWaitReplyThreads = txtWaitReplyThreads.Text;
                    }

                    GlobusFileHelper.WriteStringToTextfile(wait_replyFilename + "<:>"
                        + wait_replytweetfilename + "<:>" + wait_replyKeyword + "<:>" + wait_replyKeywordFile + "<:>" + chkUseSpinnedMessages + "<:>"
                        + strtweetsperreply + "<:>" + strNoOfRepliesPerKeyword + "<:>" + strInterval_WaitReply + "<:>" + strWaitReplyThreads, Globals.Path_waitandreplySetting);

                    MessageBox.Show("Task Scheduled");
                    AddToLog_WaitReply("Task Scheduled");

                   
                }
                else
                {
                    AddToLog_WaitReply("Please Add All Data");
                }

            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> btn_waitandreplyscheduler_Click() -- ScheduleFor Later Click --> " + ex.Message, Globals.Path_WaitNreplyErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> btn_waitandreplyscheduler_Click() -- ScheduleFor Later Click --> " + ex.Message, Globals.Path_WaitNreplyErroLog);
            }
        }
        private void btnScheduleForLater_SearchWithInvite_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime dt_scheduledTime = DateTime.Parse(dateTimePicker_Start_SearchWithInvite.Value.ToString());

                if (DateTime.Now < dt_scheduledTime)
                {

                     string IsScheduledDaily = "0";
                    if (chkboxSearchWithInviteScheduledDaily.Checked)
                    {
                        IsScheduledDaily = "1";
                    }

                    clsDBQueryManager queryManager = new clsDBQueryManager();
                    queryManager.InsertUpdateTBScheduler("SearchkeywordInvites_", dateTimePicker_Start_SearchWithInvite.Value.ToString(), IsScheduledDaily);

                    if (scheduler != null && scheduler.IsDisposed == false)
                    {
                        scheduler.LoadDataGrid();
                    }
                }
                else
                {
                    MessageBox.Show("Scheduled Tasks Can Only Be Saved in the Future Timing");
                    AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Scheduled Tasks Can Only Be Saved in the Future Timing]");
                }

            }
            catch { }
        }