Beispiel #1
0
        public static void GenerateFullBackup()
        {
            if (AppInit.AppInfo.BackupPath.Length == 0)
            {
                return;
            }
            DbFun.CloseConn();
            string ltimepunch = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + "_" + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + ".ikbkp";

            System.IO.Compression.ZipFile.CreateFromDirectory(Application.StartupPath, AppInit.AppInfo.BackupPath + @"\" + ltimepunch);
            DbFun.OpenConn();
        }
Beispiel #2
0
        private void MDIMain_Load(object sender, EventArgs e)
        {
            //MessageBox.Show("Test1");
            //MessageBox.Show(LicenseChecker.GetActivationCode());
            FrmCompanySelection objcmp = new FrmCompanySelection();

            objcmp.ShowDialog();
            //MessageBox.Show("Test2");
            if (System.Diagnostics.Debugger.IsAttached)
            {
                AppInit.UserInfo.UserId       = 1;
                AppInit.UserInfo.isSuperAdmin = true;
            }
            if (AppInit.UserInfo.UserId == 0)
            {
                FrmLogin objlogin = new FrmLogin();
                objlogin.ShowDialog();
            }
            FrmLogin.GetCompanyInfo();
            this.Text = AppInit.CompanyInfo.CompanyName;
            DbFun.OpenConn();
            // super admin permission
            if (AppInit.UserInfo.isSuperAdmin)
            {
                reportDesignToolStripMenuItem.Visible = true;
                dashDesignerToolStripMenuItem.Visible = true;
            }


            AppInit.SoftwareSettings.IntiSetting();

            if (System.IO.Directory.Exists(Application.StartupPath + @"\Temp"))
            {
                System.IO.DirectoryInfo directory = new System.IO.DirectoryInfo(Application.StartupPath + @"\Temp");
                foreach (System.IO.FileInfo file in directory.GetFiles())
                {
                    file.Delete();
                }
            }


            ////------------ Dashboard
            //DevExpress.DashboardCommon.Dashboard dbs = new DevExpress.DashboardCommon.Dashboard();
            //dbs.ConfigureDataConnection += dbs_ConfigureDataConnection;
            //dbs.LoadFromXml(Application.StartupPath + @"\Dash\D1.xml");
            //db_view_Dash.Dashboard = dbs;

            //InitDashbaord();
        }