示例#1
0
        private void saoLưuDữLiệuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            string cap, mes;

            try
            {
                // Tạo đường dẫn.
                VNTCode.Controller oCtl      = new VNTSellGold.App_Code.Controller();
                string             sFullName = Application.StartupPath + "\\VNTSellGold.bak";
                // Kiểm tra tồn tại đường dẫn.
                if (System.IO.File.Exists(sFullName))
                {
                    System.IO.File.Delete(sFullName);
                }
                // Bắt đầu backup.
                oCtl.MtdBackupDatabase(sFullName);

                cap = global::VNTSellGold.Properties.Resources.CapSave;
                mes = global::VNTSellGold.Properties.Resources.MesBackup;
            }
            catch (Exception ex) {
                cap = global::VNTSellGold.Properties.Resources.CapError;
                mes = global::VNTSellGold.Properties.Resources.MesBackupError;
            }
            Cursor = Cursors.Default;
            MessageBox.Show(mes, cap, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#2
0
 void MtdCreateController()
 {
     if (oCtrLer == null)
     {
         oCtrLer = new VNTCode.Controller();
     }
 }