コード例 #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

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

            //string var = MosesClassLibrary.Security.Encryption.Decrypt("pMjHyBh1atLUMAUBKFvR7w==");
            //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();
            }

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

            TaxSmartConfiguration.ConfigManager config = new TaxSmartConfiguration.ConfigManager();
            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;
            }

            stateCode = getStatecode();

            StateName = getStateName();


            Application.Run(new Form1());
        }
コード例 #2
0
        void checkcontionstring()
        {
            string name = System.Environment.MachineName;

            string filePath = "C://TSS//TaxSmartSuiteNew//TaxSmartSuiteNew//Configuration.xml";

            //var config = new TaxSmartConfiguration.ConfigManager("C://TSS//TaxSmartSuiteNew", true);
            TaxSmartConfiguration.ConfigManager config2 = new TaxSmartConfiguration.ConfigManager(filePath, true);
            if (!config2.IsDefaultFolderExist)
            {
                //Load Database Settings
                TaxSmartConfiguration.Winform.FrmDatabaseSetup frmDatabaseSetup = new TaxSmartConfiguration.Winform.FrmDatabaseSetup(filePath, true);
                frmDatabaseSetup.ShowDialog();
                if (!frmDatabaseSetup.Status)
                {
                    return;
                }
            }
            if (!Logic.LoadConfig2())
            {
                return;
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: leofemmy/TSS_Ogun
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            //string path = tmpFolder;

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

            // Sets the CurrentCulture property to U.S. English.
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException1;
            // Force all WinForms errors to go through handler
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            Application.ThreadException += Application_ThreadException1;

            //RpohR9gbCkfm68WwyTTPFA ==
            //RpohR9gCbkfm68WywTTPFA ==old
            string var = MosesClassLibrary.Security.Encryption.Decrypt("wAJGdHnaqS8HiltluSOXVQ==");


            string var2 = MosesClassLibrary.Security.Encryption.Decrypt("cowkqU3RAp5NnBQP5LAEFg==");

            string var3 = MosesClassLibrary.Security.Encryption.Decrypt("fUGCTv0mBudxLzAy/UpOnQ==");

            string var3s = MosesClassLibrary.Security.Encryption.Decrypt("XGTBpxxY8m7A26IoVgykqg==");

            string varg3 = MosesClassLibrary.Security.Encryption.Decrypt("zFinOJ+88wFMs2p5XphOxg==");
            string varg4 = MosesClassLibrary.Security.Encryption.Decrypt("wAJGdHnaqS8HiltluSOXVQ==");

            string var4 = MosesClassLibrary.Security.Encryption.Decrypt("Udn/YDBdmprYCzNIai3VLHXPXP+jepSe");

            var gte = MosesClassLibrary.Security.Encryption.Encrypt("password@1234");

            isCentralData = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["IsCentralData"]) == 1 ? true : false;
#if true
            SystemName = System.Environment.MachineName;
            //var configPath = TaxSmartConfiguration.ConfigManager.GetServerName;
            //bool isFullPath = !isCentralData;

            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;
            }

            //MessageBox.Show(Logic.ConnectionString);
            //return;
            //if (Logic.LoadConfig2()) return;
#else
            if (!MosesClassLibrary.Configuration2.SetConfigurationFilePath(path))
            {
                TaxSmartSuite.Class.Common.setMessageBox("Error loading application information", ApplicationName, 3);

                return;
            }


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

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

            Logic.ConfigureSettings();
#endif


            stateCode = getStatecode();

            //passwords = getUserPassword();

            if (Program.isCentralData)
            {
                stationName = "Central Station";

                stationCode = "0009";
            }
            else
            {
                stationName = getStationName();

                stationCode = getStationCode();
            }



            //check station code
            //if (string.IsNullOrEmpty(stationCode))
            //{ }

            //TaxSmartSuite.Class.Common.UpdateConfigurationFile(Logic.ConnectionString, "Collection.Properties.Settings.TaxSmartSuiteConnectionString");

            //TaxSmartSuite.Class.Common.UpdateConfigurationFile(Logic.ConnectionString, "Collection.Properties.Settings.TaxSmartSuiteRevisedConnectionString");

            //Guid g = Guid.NewGuid();
            //customerID = string.Format("{0}{1}{2}", DateTime.Now.ToString("yyyyMMdd"), "-", custIDIncrementer);


            if (IsApplicationValid())
            {
                var frm = new MDIMain();

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

                SQL = "SELECT  TOP (1) StateName FROM dbo.ViewDefaultSetupRevenueOffice2";

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

                //Application.EnableVisualStyles();
                //Application.SetCompatibleTextRenderingDefault(false);

                //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();


                var login = new FrmLogin(isAutoLogin);

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

                    UserID = args[0];
                    //passwords = args[1];
                }


                //run the menu form
                Application.Run(login);
                UserName  = getUsername();
                Userphone = getuserphone();
                if (APP_CONNECTED)
                {
                    Application.Run(new MDIMain());
                }
            }
            else
            {
                MessageBox.Show("Application Not Accessible");
            }

            //}
            //else
            //{

            //}
        }
コード例 #4
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");
            }
        }
コード例 #5
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");
            }
        }