Esempio n. 1
0
        private void AddManAccept_Click(object sender, EventArgs e)
        {
            string Name = AddManName.Text;

            ManipulationClass.AddManToListOfMan(new Man(Name));
            this.Close();
        }
Esempio n. 2
0
        private void AddWeightInfoAccept_Click(object sender, EventArgs e)
        {
            string value   = AddWeightInfoWeightValue.Text;
            string comment = Comment.Text;

            ManipulationClass.AddWeightInfo(man, value, comment);
            this.Close();
        }
Esempio n. 3
0
 private void RemoveMan_Click(object sender, EventArgs e)
 {
     try
     {
         ManipulationClass.RemoveManFromList(ListOfMan.Items.IndexOf(ListOfMan.SelectedItems[0]));
     }
     catch
     {
     }
 }
 public static void LoadDataFromFile()
 {
     try
     {
         string[] inputString = File.ReadAllLines("listOfMan.txt");
         for (int i = 0; i < inputString.Length; i++)
         {
             Console.WriteLine(inputString[i]);
             ManipulationClass.AddManToListOfMan(new Man(inputString[i]));
         }
     }
     catch { }
 }
        public static void LoadWeightsFromFile()
        {
            //try{
            string[] inputString = File.ReadAllLines("listOfWeights.txt");
            char[]   separator   = { '|' };
            for (int i = 0; i < inputString.Length; i++)
            {
                string[] inputSplitted = inputString[i].Split(separator[0]);
                Console.WriteLine(inputString[i]);
                Console.WriteLine(string.Join(" ", inputSplitted));
                for (int k = 0; k < inputSplitted.Length; k += 3)
                {
                    ManipulationClass.AddWeightInfo(DataClass.listOfMan[i], inputSplitted[k], inputSplitted[k + 1], inputSplitted[k + 2]);
                }
            }

            //} catch { }
        }
Esempio n. 6
0
 private void WeightMeter_FormClosed(object sender, FormClosedEventArgs e)
 {
     ManipulationClass.SaveManToFileFull();
     ManipulationClass.SaveWeightsToFileFull();
 }
Esempio n. 7
0
 private void WeightMeter_Load(object sender, EventArgs e)
 {
     DataClass.listViewOfMan = ListOfMan;
     ManipulationClass.LoadDataFromFile();
     ManipulationClass.LoadWeightsFromFile();
 }