Beispiel #1
0
        static void Main()
        {
            Assembly asm = typeof(NSRetailPOSSkinDARK).Assembly;

            SkinManager.Default.RegisterAssembly(asm);
            SplashScreenManager.RegisterUserSkins(typeof(NSRetailPOSSkinDARK).Assembly);
            UserLookAndFeel.Default.SetSkinStyle("NSRetailPOSSkinDARK");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SkinManager.EnableFormSkins();
            SkinManager.EnableMdiFormSkins();
            DataTable dt = new POSRepository().GetPOSConfiguration();

            if (dt != null && dt.Rows.Count > 0)
            {
                Utility.branchinfo.BranchID          = dt.Rows[0]["BRANCHID"];
                Utility.branchinfo.BranchCounterID   = dt.Rows[0]["BRANCHCOUNTERID"];
                Utility.branchinfo.BranchName        = dt.Rows[0]["BRANCHNAME"];
                Utility.branchinfo.BranchCounterName = dt.Rows[0]["COUNTERNAME"];
                Application.Run(new frmLogin());
            }
            else
            {
                Application.Run(new frmConfiguration());
            }
        }
Beispiel #2
0
        static void Main()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationOnThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

            SplashScreenManager.RegisterUserSkins(typeof(DevExpress.UserSkins.BonusSkins).Assembly);

            SplashScreenManager.ShowForm(typeof(SplashScreenFrm), false, false);

            _appSkinStyle = ConfigurationManager.AppSettings["AppSkinStyle"];

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.Skins.SkinManager.EnableMdiFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();

            string          typeDataBase   = ConfigurationManager.AppSettings.Get("TypeDataBase");
            IConnectionUtil connectionUtil = null;

            switch (typeDataBase.ToLower())
            {
            case "postgresql":
                connectionUtil = new NpgsqlConnectionUtil();
                break;

            case "sqlserver":
                connectionUtil = new SqlServerConnectionUtil();
                break;
            }

            if (connectionUtil != null)
            {
                if (!connectionUtil.CheckConnectionString())
                {
                    return;
                }
            }

            string versionApp = ConfigurationManager.AppSettings.Get("VersionApp");

            switch (versionApp)
            {
            case "PRINCIPAL":
                UserLookAndFeel.Default.SetSkinStyle(_appSkinStyle);
                break;

            case "CLINICA":
                UserLookAndFeel.Default.SetSkinStyle("Office 2007 Green");
                break;
            }


            CacheObjects cacheObjects = new CacheObjects();

            _cacheObjects = cacheObjects;
            _cacheObjects.Inicializar();

            SplashScreenManager.CloseForm();

            SessionApp.SucursalSel    = null;
            SessionApp.EmpresaSel     = null;
            SessionApp.UsuarioSel     = null;
            SessionApp.GrupoUsarioSel = null;
            SessionApp.EmpleadoSel    = null;
            SessionApp.VersionApp     = versionApp;

            _usuarioIngresoFrm = new UsuarioIngresoFrm();
            if (_usuarioIngresoFrm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            switch (versionApp)
            {
            case "PRINCIPAL":
                Application.Run(new Principal());
                break;

            case "CLINICA":
                Application.Run(new ModuloClinica());
                break;
            }
        }