Ejemplo n.º 1
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     saveFileDialog1.InitialDirectory = folder;
     saveFileDialog1.Filter           = "Excuse files (*.excuse)|*.excuse|All files (*.*)|*.*";
     saveFileDialog1.FileName         = currentExcuse.Description;
     saveFileDialog1.ShowDialog();
     currentExcuse.Save(saveFileDialog1.FileName);
     UpdateForm(false);
 }
Ejemplo n.º 2
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            Excuse _excuse = new Excuse(this.textBox_Excuse.Text,
                                        this.textBox_Result.Text,
                                        this.dateTimePicker_LastUsed.Value
                                        );

            _excuse.Save(selectedFolder);
            this.Text        = "Excuse Manager";
            this.formChanged = false;
            MessageBox.Show("Excuse written");
        }
Ejemplo n.º 3
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     saveFileDialog.InitialDirectory = _currentPath;
     //saveFileDialog.Filter = "Arquivos de Texto (*.txt)|*.txt|" +
     //    "Todos os Arquivos (*.*)|*.*";
     //saveFileDialog.FileName = txtDescription.Text + ".txt";
     saveFileDialog.Filter = "Arquivos de desculpa (*.excuse)|*.excuse|" +
                             "Todos os Arquivos (*.*)|*.*";
     saveFileDialog.FileName = txtDescription.Text + ".excuse";
     if (saveFileDialog.ShowDialog() == DialogResult.OK)
     {
         _currentExcuse.Save(saveFileDialog.FileName);
         MessageBox.Show("Desculpa Salva");
         UpdateForm(false);
     }
 }
Ejemplo n.º 4
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(description.Text) || String.IsNullOrEmpty(results.Text))
            {
                MessageBox.Show("Please specify an excuse and a result", "Unable to save", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            saveFileDialog1.InitialDirectory = selectedFolder;
            saveFileDialog1.Filter           = "Dat files (*.dat)|*.dat|All files (*.*)|*.*";
            saveFileDialog1.FileName         = description.Text + ".dat";
            DialogResult result = saveFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                currentExcuse.Save(saveFileDialog1.FileName);
                UpdateForm(false);
                MessageBox.Show("Excuse written");
            }
        }
Ejemplo n.º 5
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("Pleas specify an excuse and a result", "Unable to save",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            saveFileDialog1.Title            = "Save as";
            saveFileDialog1.FileName         = textBox1.Text + ".txt";
            saveFileDialog1.Filter           = "Excuse file(*.excuse)|*.excuse|All file(*.*)|*.*";
            saveFileDialog1.InitialDirectory = folderPath;
            DialogResult result = saveFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                currentExcuse.Save(saveFileDialog1.FileName);
                UpdateForm(false);
                MessageBox.Show("Excuse written");
            }
        }
Ejemplo n.º 6
0
        private void save_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(description.Text) || string.IsNullOrEmpty(results.Text))
            {
                MessageBox.Show("Please specify an excuse and a result", "Unable to save",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                SaveFileDialog saveDialog = new SaveFileDialog();
                saveDialog.InitialDirectory = selectedFolder;
                saveDialog.FileName         = FileName();
                saveDialog.Filter           = STRING_FILTER;

                if (saveDialog.ShowDialog() == DialogResult.OK)
                {
                    currentExcuse.Save(saveDialog.FileName);
                    UpdateForm(false);
                    MessageBox.Show("Excuse Written");
                }
            }
        }
Ejemplo n.º 7
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(tbExcuse.Text) || string.IsNullOrEmpty(tbResults.Text))
            {
                MessageBox.Show("Please specify an excuse and the result", "Unable to save", MessageBoxButton.OK);
                return;
            }
            tbFileDate.Text        = DateTime.Now.ToString();
            currentExcuse.LastUsed = (DateTime)datetimeLastUsed.SelectedDate;
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.InitialDirectory     = folderName;
            sfd.Filter               = "Text documents (.txt)|*.txt|All files (*.*)|*.*";
            sfd.FileName             = tbExcuse.Text + ".txt";
            currentExcuse.ExcusePath = string.Format(folderName + @"\" + tbExcuse.Text + ".txt");
            if (sfd.ShowDialog() == true)
            {
                currentExcuse.Save(sfd.FileName);
                UpdateForm(false);
                MessageBox.Show("Excuse written");
            }
        }
Ejemplo n.º 8
0
 private void saveExcuse()
 {
     currentExcuse.Save();
     MessageBox.Show("Excuse Written");
     updateForm(false);
 }