Пример #1
0
 private void ECMMainFrm_Load(object sender, EventArgs e)
 {
     //Program.MC.FrmSplash = new SplashFrm();
     //Program.MC.FrmSplash.ShowDialog();
     this.IsMdiContainer = true;
     RebuildForms();
     // Load Data From Registry
     Program.MC.SQLConStrG_Accounts = MCls.GetRegValue(MCls.RegKeyValues.SQLStringG_Accounts.ToString());
     Program.MC.ReportURL = MCls.GetRegValue(MCls.RegKeyValues.ReportUrl.ToString());
     Program.MC.ReportPath = MCls.GetRegValue(MCls.RegKeyValues.ReportPath.ToString());
     if (Program.MC.SQLConStrG_Accounts == string.Empty || Program.MC.ReportURL == string.Empty || Program.MC.ReportPath == string.Empty)
     {
         Program.MC.FrmSQLConnection = new SQLConnectionFrm();
         Program.MC.FrmSQLConnection.FullConString = Program.MC.SQLConStrG_Accounts;
         Program.MC.FrmSQLConnection.DatabaseName = "G_Accounts";
         Program.MC.FrmSQLConnection.RegKeyName = MCls.RegKeyValues.SQLStringG_Accounts.ToString();
         try 
         {
             Directory.CreateDirectory(@"C:\ECM\Database\");
             if (File.Exists(Application.StartupPath + @"\DataBase\G_Accounts.mdf") && !File.Exists(@"C:\ECM\Database\G_Accounts.mdf"))
                 File.Copy(Application.StartupPath + @"\DataBase\G_Accounts.mdf", @"C:\ECM\Database\G_Accounts.mdf", false);
             if (File.Exists(Application.StartupPath + @"\DataBase\G_Accounts_log.ldf") && !File.Exists(@"C:\ECM\Database\G_Accounts_log.ldf"))
                 File.Copy(Application.StartupPath + @"\DataBase\G_Accounts_log.ldf", @"C:\ECM\Database\G_Accounts_log.ldf", false);
         }
         catch { }
         Program.MC.FrmSQLConnection.OFDInitialDirectory = "C:\\ECM\\Database";
         Program.MC.FrmSQLConnection.ShowDialog();
         // Load User Information
         LoginFrm LogFrm = new LoginFrm();
         LogFrm.ShowDialog();
         EnableMenuItem();
     }
 }
Пример #2
0
 private void ECMMainFrm_Activated(object sender, EventArgs e)
 {
     if (Program.MC.UserInfo.UserID == null)
     {
         LoginFrm Log = new LoginFrm();
         Log.ShowDialog();
     }
 }