Пример #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool isAutoLogin = args != null && args.Count() > 1;

            //check whether another instance of the program, then kill it
            if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1)
            {
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }


            string var = MosesClassLibrary.Security.Encryption.Decrypt("AoF7IXDme4BRPa7A8ncjJg==");

#if true
            TaxSmartConfiguration.ConfigManager config = new TaxSmartConfiguration.ConfigManager(TaxSmartConfiguration.ConfigManager.GetServerName);

            if (!config.IsDefaultFolderExist)
            {
                //Load Database Settings
                TaxSmartConfiguration.Winform.FrmDatabaseSetup frmDatabaseSetup = new TaxSmartConfiguration.Winform.FrmDatabaseSetup(TaxSmartConfiguration.ConfigManager.GetServerName);
                frmDatabaseSetup.ShowDialog();
                if (!frmDatabaseSetup.Status)
                {
                    return;
                }
            }
            if (!Logic.LoadConfig())
            {
                return;
            }
#else
            if (!MosesClassLibrary.Configuration2.SetConfigurationFilePath(path))
            {
                TaxSmartSuite.Class.Common.setMessageBox("Error loading application information", ApplicationName, 3);
                //return;
            }



            if (!CheckDatabaseSettings)//check if there
            {
                BondForm.FrmConnections dbconnect = new BondForm.FrmConnections(Program.ApplicationName, "TaxSmartSuite", path);

                dbconnect.ShowDialog();

                if (!dbconnect.retValue)
                {
                    TaxSmartSuite.Class.Common.setMessageBox("Application Could not Connect to the Sever", ApplicationName, 3);

                    return;
                }
            }

            Logic.ConfigureSettings();
#endif

            stateCode = getStatecode();

            //StatePayCode = getStatePayCode();

            StateName = getStateName();
            //NavBars.ManageNavBarControls(frm.navBarControl1, Program.ApplicationCode);
            //Application.Run(new MDIMains());



            if (IsApplicationValid())
            {
                string retval;

                ////var frm = new MDIMain();
                //var frm = new MDIMains();

                //NavBars.ManageNavBarControls(frm.navBarControl1, Program.ApplicationCode);

                //var strvale = MosesClassLibrary.Security.Encryption.Decrypt("xiSttfx7JNEqFPn7HB0W7g==");
                //SQL = "SELECT  TOP (1) StateName FROM dbo.ViewDefaultSetupRevenueOffice2";

                //StateName = (new Logic()).ExecuteScalar(SQL);


                //string testApplication = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location);



                var login = new FrmLogin(isAutoLogin);
                if (isAutoLogin)
                {
                    login.Username = args[0];
                    login.Password = args[1];
                }


                //run the menu form
                Application.Run(login);
                Userphone = getuserphone();
                if (APP_CONNECTED)
                {
                    Application.Run(new MDIMains());
                }
                //Application.Run(new FrmApproval());
                //run the main menu form
                //Application.Run(new MDIMain());

                //SingleApplication.Run(new MDIMain());

                //run the menu form
                //Application.Run(login);
                //UserName = getUsername();
                //if (APP_CONNECTED)
                //    Application.Run(new MDIMain());
            }
            else
            {
                InserApplication();

                MessageBox.Show("Application Not Accessible");
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            //string path = tmpFolder;

            bool isAutoLogin = args != null && args.Count() > 1;

            //check whether another instance of the program, then kill it
            if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1)
            {
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }

            string GH   = MosesClassLibrary.Security.Encryption.Decrypt("XSP+kdUZvsyEuNRLXy+lWGxwzndM35Lj");
            string var  = MosesClassLibrary.Security.Encryption.Decrypt("3V1el5Ftwt3JJqu+HasHtg==");
            string vars = MosesClassLibrary.Security.Encryption.Decrypt("TPa7tFbIUYRBs5LESu/2Hg==");
            string var2 = MosesClassLibrary.Security.Encryption.Decrypt("DCb5DBDO2BtbqsOLHpWJ7A==");
            string var4 = MosesClassLibrary.Security.Encryption.Decrypt("D30t9qV1aA8NKPPPz61kmjatzwmaDX2S");


            var gte = TaxSmartConfiguration.ConfigManager.EncryptString("james007");

#if true
            TaxSmartConfiguration.ConfigManager config = new TaxSmartConfiguration.ConfigManager(TaxSmartConfiguration.ConfigManager.GetServerName);

            if (!config.IsDefaultFolderExist)
            {
                //Load Database Settings
                TaxSmartConfiguration.Winform.FrmDatabaseSetup frmDatabaseSetup = new TaxSmartConfiguration.Winform.FrmDatabaseSetup(TaxSmartConfiguration.ConfigManager.GetServerName);
                frmDatabaseSetup.ShowDialog();
                if (!frmDatabaseSetup.Status)
                {
                    return;
                }
            }
            if (!Logic.LoadConfig())
            {
                return;
            }
#else
            if (!MosesClassLibrary.Configuration2.SetConfigurationFilePath(path))
            {
                TaxSmartSuite.Class.Common.setMessageBox("Error loading application information", ApplicationName, 3);
                //return;
            }



            if (!CheckDatabaseSettings)//check if there
            {
                BondForm.FrmConnections dbconnect = new BondForm.FrmConnections(Program.ApplicationName, "TaxSmartSuite", path);

                dbconnect.ShowDialog();

                if (!dbconnect.retValue)
                {
                    TaxSmartSuite.Class.Common.setMessageBox("Application Could not Connect to the Sever", ApplicationName, 3);

                    return;
                }
            }

            Logic.ConfigureSettings();
#endif

            stateCode = getStatecode();

            //StatePayCode = getStatePayCode();



            //stationName = getStationName();

            //setting connection string for app.config
            //TaxSmartSuite.Class.Common.UpdateConfigurationFile(Logic.ConnectionString, "BankReconciliation.Properties.Settings.TaxSmartSuiteRevised_oyoConnectionString");


            if (IsApplicationValid())
            {
                string retval;

                //var frm = new MDIMain();
                var frm = new MDIMains();

                NavBars.ManageNavBarControls(frm.navBarControl1, Program.ApplicationCode);

                var strvale = MosesClassLibrary.Security.Encryption.Decrypt("xiSttfx7JNEqFPn7HB0W7g==");
                //SQL = "SELECT  TOP (1) StateName FROM dbo.ViewDefaultSetupRevenueOffice2";

                //StateName = (new Logic()).ExecuteScalar(SQL);


                //string testApplication = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location);



                var login = new FrmLogin(isAutoLogin);
                if (isAutoLogin)
                {
                    login.Username = args[0];
                    login.Password = args[1];
                }


                //run the menu form
                Application.Run(login);
                Userphone = getuserphone();
                StateName = getStateName();

                UserEmail = getUseremail();


                loginStatus = true;
                if (APP_CONNECTED)
                {
                    Application.Run(new MDIMains());
                }

                //run the main menu form
                //Application.Run(new MDIMain());

                //SingleApplication.Run(new MDIMain());

                //run the menu form
                //Application.Run(login);
                //UserName = getUsername();
                //if (APP_CONNECTED)
                //    Application.Run(new MDIMain());
            }
            else
            {
                InserApplication();

                MessageBox.Show("Application Not Accessible");
            }
        }