Exemplo n.º 1
0
 private void importToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (saveFile.ShowDialog() == DialogResult.OK)
         {
             string pathOfsaveFile = saveFile.FileName;
             administration.Save(pathOfsaveFile);
         }
     }
     catch (ArgumentNullException arnull)
     {
         MessageBox.Show(arnull.Message);
     }
     catch (PathTooLongException pathlong)
     {
         MessageBox.Show(pathlong.Message);
     }
     catch (ArgumentException argument)
     {
         MessageBox.Show(argument.Message);
     }
     catch (IOException io)
     {
         MessageBox.Show(io.Message);
     }
 }
Exemplo n.º 2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         string savePath = saveFileDialog1.FileName;
         admin.Save(savePath);
     }
 }
Exemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Database for animal shelter |*.thisisadatabaseforanimalshelter";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                administration.Save(sfd.FileName);
            }
        }
Exemplo n.º 4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         Administration.Save(fileName);
     }
     catch (ArgumentNullException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (ArgumentException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (PathTooLongException ex)
     {
         MessageBox.Show(ex.Message);
     }
     catch (FileNotFoundException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }