コード例 #1
0
        private void btnRestore_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtFileName_R.Text != string.Empty)
                {
                    DAL.DataAccessLayer dal = new DAL.DataAccessLayer();

                    //dal.Open(); لأن اتصالها مختلف لذلك عملنا الفتح والاغلاق في الكلاس
                    dal.RestoreBackup(txtFileName_R.Text);

                    MessageBox.Show("تم استعادة نسخة احتياطية بنجاح", "استعادة نسخة احتياطية", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtFileName_R.Clear();
                }
                else
                {
                    MessageBox.Show("اختر النسخة المحفوظة", "استعادة نسخة احتياطية", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ":حصل الخطأ التالي", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }