示例#1
0
文件: Form7.cs 项目: latl7/pia
        private void button5_Click(object sender, EventArgs e)
        {
            List <string> outputs = Interface1.display();
            string        disp    = string.Join(Environment.NewLine, outputs.ToArray());

            textBox4.Text += Environment.NewLine + disp + Environment.NewLine;
        }
示例#2
0
文件: Form6.cs 项目: latl7/pia
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime      localDate = DateTime.Now;
            string        date      = "Date: " + localDate.ToShortDateString();
            string        Time      = "Time: " + localDate.ToShortTimeString();
            string        Location  = "Location: " + textBox2.Text;
            string        staffname = "Staff Name: " + textBox3.Text;
            List <string> outputs   = Interface1.display();
            string        disp;

            textBox1.Text  = date + Environment.NewLine + Time + Environment.NewLine + Location + Environment.NewLine + staffname + Environment.NewLine + Environment.NewLine;
            disp           = string.Join(Environment.NewLine, outputs.ToArray());
            textBox1.Text += disp + Environment.NewLine;
        }
示例#3
0
        private void button5_Click(object sender, EventArgs e)
        {
            var texts = this.checkedListBox1.CheckedItems.Cast <object>()
                        .Select <object, string>(x => this.checkedListBox1.GetItemText(x));

            foreach (string r in texts)
            {
                Interface1.CurrentReportView(r);
            }

            string text = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + Interface1.CurRepViewSend());
            string Name = AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + Interface1.CurRepViewSend();

            Interface1.ReptoCSV(text, Name);
        }
示例#4
0
        private void button4_Click_1(object sender, EventArgs e)
        {
            var texts = this.checkedListBox1.CheckedItems.Cast <object>()
                        .Select <object, string>(x => this.checkedListBox1.GetItemText(x));

            foreach (string r in texts)
            {
                Interface1.CurrentReportView(r);
            }
            Form7 frm7 = new Form7();

            frm7.StartPosition = FormStartPosition.CenterScreen;
            frm7.Show();
            this.Close();
        }
示例#5
0
文件: Form8.cs 项目: latl7/pia
        private void GenRepButton_Click(object sender, EventArgs e)
        {
            var texts = this.checkedListBox1.CheckedItems.Cast <object>()
                        .Select <object, string>(x => this.checkedListBox1.GetItemText(x));

            if (!texts.Contains("There are no search Results"))
            {
                Interface1.Repget(texts);
            }

            Form7 frm7 = new Form7();

            frm7.StartPosition = FormStartPosition.CenterScreen;
            frm7.Show();
            this.Close();
        }
示例#6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (checkedListBox1.CheckedItems.Count > 0)
     {
         var texts = this.checkedListBox1.CheckedItems.Cast <object>()
                     .Select <object, string>(x => this.checkedListBox1.GetItemText(x));
         foreach (string r in texts)
         {
             Interface1.get(r);
         }
         for (int i = 0; i < checkedListBox1.Items.Count; i++)
         {
             checkedListBox1.SetItemChecked(i, false);
         }
     }
 }
示例#7
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "Enter Report Name" && textBox1.Text != "")
            {
                Interface1.CurrentReport(textBox1.Text);
                Form5 frm5 = new Form5();
                frm5.StartPosition = FormStartPosition.CenterScreen;
                frm5.Show();
                this.Close();
            }

            else
            {
                textBox1.Text = "Enter Report Name";
            }
        }
示例#8
0
文件: Form6.cs 项目: latl7/pia
        private void button2_Click(object sender, EventArgs e)
        {
            List <string> Files = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\", "*.txt")
                                  .Select(Path.GetFileName)
                                  .ToList <string>();
            string txtname;

            if (textBox1.Text != "")
            {
                txtname = Interface1.CurRepSend();
                if (Files.Contains(txtname + ".txt"))
                {
                    if (checkBox1.Text == "")
                    {
                        checkBox1.Checked = false;
                        checkBox1.Visible = false;
                    }
                    checkBox1.Visible = true;
                    checkBox1.Text    = "Are you sure you want" + Environment.NewLine + "to overwrite the old Report:" + Environment.NewLine + txtname + ".txt";
                    button2.Text      = "Confirm Save";
                    if (checkBox1.Text == "Are you sure you want" + Environment.NewLine + "to overwrite the old Report:" + Environment.NewLine + txtname + ".txt" && checkBox1.Checked == true)
                    {
                        string Name = AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + txtname + ".txt";
                        Interface1.RepSave(textBox1.Text, Name);
                        Interface1.clear();
                        checkBox1.Text    = "";
                        checkBox1.Checked = false;
                        checkBox1.Visible = false;
                        button2.Text      = "Save";
                        textBox1.ReadOnly = true;
                        save++;
                    }
                }
                else
                {
                    File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + txtname + ".txt", textBox1.Text);
                    textBox1.ReadOnly = true;
                    save++;
                }
            }
            else
            {
                textBox1.Text = "Generate report first";
            }
        }
示例#9
0
文件: Form8.cs 项目: latl7/pia
        public Form8()
        {
            InitializeComponent();
            string output = string.Join(Environment.NewLine, Interface1.send().ToArray());

            if (Interface1.send().Count <= 0)
            {
                checkedListBox1.Items.Add("There are no search Results");
            }
            else
            {
                foreach (string R in Interface1.send())
                {
                    checkedListBox1.Items.Add(R);
                }
            }
            checkBox1.Checked = false;
        }
示例#10
0
文件: Form8.cs 项目: latl7/pia
 private void ClearBut_Click_1(object sender, EventArgs e)
 {
     if (checkBox1.Text == "")
     {
         checkBox1.Checked = false;
         checkBox1.Visible = false;
     }
     checkBox1.Visible = true;
     checkBox1.Text    = "Are you sure you want" + Environment.NewLine + "to delete all your Results?";
     ClearBut.Text     = "Confirm Clear";
     if (checkBox1.Text == "Are you sure you want" + Environment.NewLine + "to delete all your Results?" && checkBox1.Checked == true)
     {
         checkedListBox1.Items.Clear();
         Interface1.clear();
         checkBox1.Text    = "";
         checkBox1.Checked = false;
         checkBox1.Visible = false;
         ClearBut.Text     = "Clear Results";
     }
 }
示例#11
0
文件: Form7.cs 项目: latl7/pia
 private void button2_Click(object sender, EventArgs e)
 {
     if (checkBox1.Text == "")
     {
         checkBox1.Checked = false;
         checkBox1.Visible = false;
     }
     checkBox1.Visible = true;
     checkBox1.Text    = "Are you sure you want" + Environment.NewLine + "to overwrite the old Report:" + Environment.NewLine + Interface1.CurRepViewSend();
     button2.Text      = "Confirm Save";
     if (checkBox1.Text == "Are you sure you want" + Environment.NewLine + "to overwrite the old Report:" + Environment.NewLine + Interface1.CurRepViewSend() && checkBox1.Checked == true)
     {
         string Name = AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + Interface1.CurRepViewSend();
         Interface1.RepSave(textBox4.Text, Name);
         Interface1.clear();
         checkBox1.Text    = "";
         checkBox1.Checked = false;
         checkBox1.Visible = false;
         button2.Text      = "Save";
         textBox4.ReadOnly = true;
         button4.Visible   = false;
         button5.Visible   = false;
     }
 }
示例#12
0
文件: Form7.cs 项目: latl7/pia
        public Form7()
        {
            InitializeComponent();
            try
            {
                textBox4.Text = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"\PIA\Reports\" + Interface1.CurRepViewSend());
            }

            catch
            {
            }
        }