Example #1
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            this.Getfilename();
            t.LoadPersonsFromFile(filename);


            Getfilenamederivalable();
            t.LoadDeliverablesFromFile(filenamed);

            Showdata();
        }
Example #2
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            OFDPersons.Filter       = "Text Files (*.txt)|*.txt";
            OFDPersons.DefaultExt   = "txt";
            OFDPersons.AddExtension = true;
            OFDPersons.Title        = "Select Persons List";

            OFDDeliverables.Filter       = "Text Files (*.txt)|*.txt";
            OFDDeliverables.DefaultExt   = "txt";
            OFDDeliverables.AddExtension = true;
            OFDDeliverables.Title        = "Select deliverables List";
            try
            {
                if (OFDPersons.ShowDialog() == DialogResult.OK)
                {
                    ts.LoadPersonsFromFile(OFDPersons.FileName);
                }

                if (OFDDeliverables.ShowDialog() == DialogResult.OK)
                {
                    ts.LoadDeliverablesFromFile(OFDDeliverables.FileName);
                }

                foreach (Deliverable d in ts.Deliverables)
                {
                    listBox1.Items.Add(d.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #3
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd;

            try
            {
                using (ofd = new OpenFileDialog())
                {
                    ofd.Title  = "Select your person file.";
                    ofd.Filter = "Text Files (*.txt)|*.txt";
                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        string path = ofd.FileName;
                        tc.LoadPersonsFromFile(path);
                    }
                }

                using (ofd = new OpenFileDialog())
                {
                    ofd.Title  = "Select your deliverables file.";
                    ofd.Filter = "Text Files (*.txt)|*.txt";
                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        string path = ofd.FileName;
                        tc.LoadDeliverablesFromFile(path);
                        tc.LoadNormal();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            ShowInfo();

            MessageBox.Show("Import Is done!");
        }
Example #4
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            tc.LoadPersonsFromFile("..\\..\\..\\data\\persons.txt");
            tc.LoadDeliverablesFromFile("..\\..\\..\\data\\deliverables.txt");


            foreach (Deliverable d in tc.Deliverables)
            {
                listBox1.Items.Add(d.ToString());
            }
            //for checking if persons works
            //foreach (Person p in tc.Persons)
            //{

            //    listBox1.Items.Add(p.ToString());
            //}
        }
Example #5
0
 private void btLoad_Click(object sender, EventArgs e)
 {
     using (OpenFileDialog ofd = new OpenFileDialog())
     {
         ofd.Title = "Open a persons data file";
         if (ofd.ShowDialog() == DialogResult.OK)
         {
             myCompany.LoadPersonsFromFile(ofd.FileName);
             using (OpenFileDialog ofdDeliverables = new OpenFileDialog())
             {
                 ofd.Title = "Open a deliverables data file";
                 if (ofd.ShowDialog() == DialogResult.OK)
                 {
                     myCompany.LoadDeliverablesFromFile(ofd.FileName);
                     foreach (Deliverable d in myCompany.Deliverables)
                     {
                         listBox1.Items.Add(d);
                     }
                 }
             }
         }
     }
 }