Exemplo n.º 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(
             "Are you sure delete this datas?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk
             ) == DialogResult.Yes)
     {
         if (MethodsClass.ExportDatabase())
         {
             if (DatabaseClass.DropHistoryStockLocation())
             {
                 label3.ForeColor = Color.Green;
                 label3.Text      = "Backed up and delete.";
                 label3.Visible   = true;
             }
             else
             {
                 label3.ForeColor = Color.Red;
                 label3.Text      = "Cant delete datas.";
                 label3.Visible   = true;
             }
         }
         else
         {
             label3.ForeColor = Color.Red;
             label3.Text      = "Not backed up.";
             label3.Visible   = true;
         }
     }
 }
Exemplo n.º 2
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (MethodsClass.ExportDatabase())
     {
         if (MethodsClass.ImportDatabase())
         {
             label5.ForeColor = Color.Green;
             label5.Text      = "Imported.";
             label5.Visible   = true;
             Application.Restart();
         }
         else
         {
             label5.ForeColor = Color.Red;
             label5.Text      = "Not implemented.";
             label5.Visible   = true;
         }
     }
     else
     {
         label5.ForeColor = Color.Red;
         label5.Text      = "Not implemented.";
         label5.Visible   = true;
     }
 }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (MethodsClass.ExportDatabase())
     {
         label1.ForeColor = Color.Green;
         label1.Text      = "Backed up to the desktop.";
         label1.Visible   = true;
     }
     else
     {
         label1.ForeColor = Color.Red;
         label1.Text      = "Not backed up.";
         label1.Visible   = true;
     }
 }
Exemplo n.º 4
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(
             "Are you sure you want to delete all the data? \nThe program will be restarted.", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk
             ) == DialogResult.Yes)
     {
         if (MethodsClass.ExportDatabase())
         {
             if (File.Exists(@"Databases/Stock.db"))
             {
                 File.Delete(@"Databases/Stock.db");
                 Settings.Default.DeletePeriod = 2;
                 Settings.Default.Save();
                 Application.Restart();
             }
             else
             {
                 label4.ForeColor = Color.Red;
                 label4.Text      = "Database not deleted.";
                 label4.Visible   = true;
             }
         }
         else
         {
             label4.ForeColor = Color.Red;
             label4.Text      = "Database not deleted.";
             label4.Visible   = true;
         }
     }
     else
     {
         label4.ForeColor = Color.Red;
         label4.Text      = "Database not deleted.";
         label4.Visible   = true;
     }
 }