Example #1
0
        private void BtnSaoLuu_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmBackup fInfor = new frmBackup(username);

            fInfor.ThemNhatKyHeThong += ThemNhatKy_Main;
            fInfor.ShowDialog();
        }
Example #2
0
        private void backupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Deseja escolher o diretório do backup? Caso contrário, será utilizado o padrão do software.", "BACKUP", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                frmBackup frmBackup = new frmBackup();
                frmBackup.ShowDialog();
            }
            else
            {
                string sqlConnectionString = @"Data Source=localhost\SQLEXPRESS01; AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS01\MSSQL\DATA\ADEGA_IRMAOS_BENINHA.mdf;Database=ADEGA_IRMAOS_BENINHA; Trusted_Connection=Yes;";


                SqlConnection conn   = new SqlConnection(sqlConnectionString);
                Server        server = new Server(new ServerConnection(conn));

                string dia    = DateTime.Now.Day.ToString();
                string mes    = DateTime.Now.Month.ToString();
                string ano    = DateTime.Now.Year.ToString();
                string backup = @"BACKUP DATABASE ADEGA_IRMAOS_BENINHA TO DISK = 'C:\Users\Pichau\Documents\backup\" + dia + "_" + mes + "_" + ano + "_BACKUP.Bak'";
                server.ConnectionContext.ExecuteNonQuery(backup);

                MessageBox.Show("Realizado com sucesso.");
            }
        }
Example #3
0
        private void hacerCopiaDeSeguridadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBackup frmBackup = new frmBackup();

            frmBackup.ShowDialog();
        }
Example #4
0
        private void btnYedekle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmBackup form = new frmBackup();

            form.ShowDialog();
        }
Example #5
0
        private void phụcHồiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBackup frmBackup = new frmBackup();

            frmBackup.ShowDialog();
        }
Example #6
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            frmBackup frmBackup = new frmBackup();

            frmBackup.ShowDialog();
        }