Exemple #1
0
      private void pbxBack_Click(object sender, EventArgs e)
      {
          Homeworks hms = new Homeworks(listOfSubjects);

          hms.Show();
          this.Hide();
      }
Exemple #2
0
      private void btnSave_Click(object sender, EventArgs e)
      {
          GetData();

          if (tbxHomework.TextLength > 0 && cbxSubject.Text != "")
          {
              using (StreamReader sr = new StreamReader(@"C: \Users\Windows\Documents\Visual Studio 2015\Projects\Deveres\Deveres\bin\Debug\Notepads\" + @"Subjects.txt"))
              {
                  string linha;
                  while ((linha = sr.ReadLine()) != null)
                  {
                      string[] dever = linha.Split('@');
                      string   name  = dever[0];
                      if ((subjectName + " ") == name)
                      {
                          if (dever[1] == homework)
                          {
                              MessageBox.Show("ja cadastrado");
                          }
                          else
                          {
                              if (dever[1] != null)
                              {
                              }



                              MessageBox.Show("Dever adicionado com sucesso!");
                              hm = new Homeworks(listOfSubjects);
                              using (StreamWriter outputFile = new StreamWriter(@"C:\Users\Windows\Documents\Visual Studio 2015\Projects\Deveres\Deveres\bin\Debug\Notepads" + @"\HomeWork.txt"))
                              {
                                  foreach (Subject subjects in listOfSubjects)
                                  {
                                      if (subjects.SubjectName + " " == name)
                                      {
                                          subjects.Homework = homework;
                                          outputFile.WriteLine(subjects.SubjectName + " @ " + homework);
                                      }
                                      else
                                      {
                                          outputFile.WriteLine(subjects.SubjectName + " @ " + subjects.Homework);
                                      }
                                  }
                              }
                              hm.Show();
                              this.Hide();
                          }
                      }
                  }
              }
          }
          else
          {
              MessageBox.Show("Preencha as informações!");
          }
          CleanData();
      }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            CheckCheckBox();
            using (StreamWriter outputFile = new StreamWriter(@"C: \Users\Windows\Documents\Visual Studio 2015\Projects\Deveres\Deveres\bin\Debug\Notepads" + @"\HomeWork.txt"))
            {
                foreach (Subject subjects in listOfSubjectsExisted)
                {
                    outputFile.WriteLine(subjects.SubjectName + " @ " + subjects.Homework);
                }
            }
            Homeworks hm = new Homeworks(listOfSubjectsExisted);

            hm.Show();
            this.Hide();
        }