Exemplo n.º 1
0
 private void timerChecking_Tick(object sender, EventArgs e)
 {
     if (checkConnection == false)
     {
         if (pgbWaiting.Value == 100)
         {
             timerChecking.Stop();
             backgroundWorking.WorkerSupportsCancellation = true;
             backgroundWorking.CancelAsync();
             MessageBox.Show("Kết nối với máy chủ không thành công");
             this.Close();
         }
         else
         {
             pgbWaiting.Increment(10);
         }
     }
     else
     {
         fmLogin fm = new fmLogin();
         fm.Show();
         this.Hide();
         timerChecking.Stop();
         MessageBox.Show("Chào mừng đến với phần mềm Quản lý bán hàng");
     }
 }
Exemplo n.º 2
0
        private static void btLogin_Click(object sender, EventArgs e)
        {
            fmLogin src = ((fmLogin)((Button)sender).Parent);

            Model.User user = new Model.User(src.tbUsername.Text, src.tbPassword.Text);
            MessageBox.Show("Authorized: " + user.authorize());
        }
Exemplo n.º 3
0
        private void btnfmDangNhap_Click(object sender, EventArgs e)
        {
            fmLogin fm = new fmLogin();

            this.Hide();
            fm.ShowDialog();
            this.Show();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Form chức năng đăng nhập
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            fmLogin fm = new fmLogin();

            this.Hide();
            this.Cursor = Cursors.Default;
            fm.ShowDialog();
            this.fmMain_Load(sender, e);
            this.Show();
        }
Exemplo n.º 5
0
        static void Main(string[] arguments)
        {
            WindowsFormsSettings.ApplyDemoSettings();
            //new DevExpress.DemoReports.ConnectionStringConfigurator(System.Configuration.ConfigurationManager.ConnectionStrings)
            //    .SelectDbEngine()
            //    .ExpandDataDirectory(fileName => DevExpress.DemoData.Helpers.DataFilesHelper.FindFile(fileName, DevExpress.DemoData.Helpers.DataFilesHelper.DataPath));

            //string path = DevExpress.Utils.FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\NWind.mdf", false);
            //XtraReportsDemos.ConnectionHelper.ApplyDataDirectory(System.IO.Path.GetDirectoryName(path));

            DataHelper.ApplicationArguments = arguments;


            //System.Globalization.CultureInfo enUs = new System.Globalization.CultureInfo("en-US");
            //System.Threading.Thread.CurrentThread.CurrentCulture = enUs;
            //System.Threading.Thread.CurrentThread.CurrentUICulture = enUs;
            DevExpress.Utils.LocalizationHelper.SetCurrentCulture(DataHelper.ApplicationArguments);
            DevExpress.UserSkins.BonusSkins.Register();
            DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Segoe UI", 8);
            //DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Office 2013");
            //DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Visual Studio 2013 Light");
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Office 2010 Black");
            SkinManager.EnableFormSkins();
            EnumProcessingHelper.RegisterEnum <TaskStatus>();


            //SplashScreenManager.ShowForm(null, typeof(ssMain), true, true, false, 1000);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            fmLogin login = new fmLogin();

            Application.Run(login);

            if (login.DialogResult == DialogResult.OK)
            {
                //DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = true;

                Application.Run(new frmMain());

                MySqlManage db = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

                string sql = string.Format("insert into amr_iqr03 values('{0}', '{1}', '1234', '{2}')", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), login.User, 14);
                db.InsertMariaDB(db.Connection, sql);

                db.Dispose();
            }
        }
Exemplo n.º 6
0
        static void Main()
        {
            var culture = CultureInfo.GetCultureInfo("pt-BR");

            CultureInfo.DefaultThreadCurrentCulture   = culture;
            CultureInfo.DefaultThreadCurrentUICulture = culture;

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



            DadosEstaticos.LeDadosEstaticos();

            if (Configuracao.BancoIP == null || Configuracao.BancoUsuario == null || Configuracao.BancoSenha == null || Configuracao.BancoPorta == null)
            {
                var fmCfgBase = new fmCfgBase();
                fmCfgBase.ShowDialog();
                DadosEstaticos.LeDadosEstaticos();
            }



            var carregaSistema = new CarregaSistema();

            if (!carregaSistema.Carrega())
            {
                Application.Exit();
            }

            var formLogin = new fmLogin();

            formLogin.ShowDialog();
            if (Logado.Usuario != null)
            {
                Application.Run(new fmMain());
            }
            else
            {
                Application.Exit();
            }
        }
Exemplo n.º 7
0
 internal static void init(fmLogin src)
 {
     src.btLogin.Click += new System.EventHandler(btLogin_Click);
 }