Ejemplo n.º 1
0
        private void button18_Click(object sender, EventArgs e)
        {
            if (m_client.IsConnected == false)
            {
                MessageBox.Show("You are not connected to streaming field server");
                return;
            }
            if (checkBox6.Checked == true && textBox14.Text == string.Empty)
            {
                MessageBox.Show("Please specify user name for the operations");
                return;
            }
            PasswordForm p = new PasswordForm();

            p.ShowDialog();
            if (p.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    TimeSpan t;
                    TimeSpan.TryParse(textBox15.Text, out t);
                    DateTime d = DateTime.Now - t;
                    MessageBox.Show(m_client.DeleteAllWatsonGenerateFilesTimeSpanBeforeNow(d, textBox14.Text, checkBox6.Checked));
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }
            }
        }
Ejemplo n.º 2
0
        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked == false)
            {
                m_taskRunning = false;
                m_eventDeleteEveryTime.Set();
                if (m_taskEveryNTime != null)
                {
                    m_taskEveryNTime.Wait();
                }
                m_taskEveryNTime = null;
            }
            else
            {
                m_taskRunning = false;
                m_eventDeleteEveryTime.Set();
                if (m_taskEveryNTime != null)
                {
                    m_taskEveryNTime.Wait();
                }
                m_taskEveryNTime = null;

                PasswordForm p = new PasswordForm();
                p.ShowDialog();
                if (p.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    m_password = p.GetPassword();
                    if (m_password != "123456")
                    {
                        MessageBox.Show("Incorrect password for delete operation");
                        checkBox2.Checked = false;
                    }
                    else
                    {
                        if (m_taskEveryNTime == null)
                        {
                            m_taskEveryNTime = new Task(() => { DeleteAllUploadedFilesEvery(); });
                            m_taskEveryNTime.Start();
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void button12_Click(object sender, EventArgs e)
 {
     try
     {
         if (m_client.IsConnected == false)
         {
             MessageBox.Show("You are not connected to streaming field server");
             return;
         }
         if (checkBox6.Checked == true && textBox14.Text == string.Empty)
         {
             MessageBox.Show("Please specify user name for the operations");
             return;
         }
         PasswordForm p = new PasswordForm();
         p.ShowDialog();
         if (p.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             /*
              * dateTimePicker1.Format = DateTimePickerFormat.Custom;
              * dateTimePicker1.CustomFormat = "MM dd yyyy hh mm ss";
              *
              * dateTimePicker2.Format = DateTimePickerFormat.Custom;
              * dateTimePicker2.CustomFormat = "MM dd yyyy hh mm ss";
              */
             string   res = m_client.DeleteAllFilesFromFieldBetweenDates(dateTimePicker1.Value, dateTimePicker2.Value, false, p.GetPassword(), textBox14.Text, checkBox6.Checked);
             string[] s   = res.Split(new Char[] { ',' });
             if (s[0] != "ok")
             {
                 MessageBox.Show(s[0]);
             }
             else
             {
                 MessageBox.Show(s[1] + " files were deleted");
             }
         }
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
Ejemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (m_client.IsConnected == false)
            {
                MessageBox.Show("You are not connected to streaming field server");
                return;
            }
            if (checkBox6.Checked == true && textBox14.Text == string.Empty)
            {
                MessageBox.Show("Please specify user name for the operations");
                return;
            }
            PasswordForm p = new PasswordForm();

            p.ShowDialog();
            if (p.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                m_client.DeleteAllUploadedFilesOnServer(p.GetPassword(), textBox14.Text, checkBox6.Checked);
            }
        }