Esempio n. 1
0
        private void LogOutCurrentUser()
        {
            //Borro la sesión actual (Usuario y Rol logueados)
            SessionManager.ClearCurrentSession();

            this.Hide();
            FrmLogin formLogin = new FrmLogin();

            formLogin.ShowDialog();
        }
Esempio n. 2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            var frmLogin = new FrmLogin();

            frmLogin.ShowDialog(this);

            menuStrip1.Enabled = Auth.Instance().IsAuthenticated;
            StatusBarUser.Text = $@"Logged in user : {Auth.Instance().Username}";
            StatusBarShop.Text = $@"Logged in shop : {Auth.Instance().ShopName}";
        }
Esempio n. 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var frmLogin = new FrmLogin();

            if (frmLogin.ShowDialog() == DialogResult.OK)
            {
                Application.Run(new FrmMainForm(frmLogin.UserName, frmLogin.UserFullName));
            }
        }
Esempio n. 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FrmLogin FrmLogin = new FrmLogin();

            if (FrmLogin.ShowDialog() == DialogResult.OK)
            {
                Application.Run(new FrmMain());
            }
        }
Esempio n. 5
0
        private void MainForm1_Load(object sender, EventArgs e)
        {
            FrmLogin frm = new FrmLogin();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
            }
            else
            {
                Application.Exit();
            }
        }
Esempio n. 6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FrmLogin frm = new FrmLogin();

            //MessageBox.Show(frm.DialogResult.ToString()+"    aaaa"); none
            if (frm.ShowDialog() == DialogResult.Yes)
            {
                frm.Dispose();
                Application.Run(new FrmMain());
            }
        }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     using (FrmLogin login = new FrmLogin())
     {
         login.ShowDialog();
         if (isValid)
         {
             Application.Run(new MainForm());
         }
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Đăng nhập
        /// </summary>
        private void Login()
        {
            var fLogin = new FrmLogin();
            var result = fLogin.ShowDialog();

            if (result == DialogResult.OK)
            {
                SetVisibilityByUserLogin();
                var f = new FrmBooking();
                f.MdiParent = this;
                f.Show();
                LoginSuccess();
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 执行btn本地事件
        /// </summary>
        /// <param name="func"></param>
        /// <param name="btn"></param>
        public void Do(BP.WF.Func func, RibbonButton btn)
        {
            switch (func.No)
            {
            case "LogOut":
                if (MessageBox.Show("您确定要注销吗?", "执行确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                {
                    return;
                }

                WebUser.SignOut();

                this.SetState();
                break;

            case "Login":
                FrmLogin fl = new FrmLogin();
                fl.ShowDialog();
                this.SetState();
                break;

            case "ChUser":
                FrmLogin fm = new FrmLogin();
                fm.ShowDialog();
                break;

            case "WKInfo":
                string msg = "\t\n No=" + WebUser.No;
                msg += "\t\n FK_Flow=" + WebUser.FK_Flow;
                msg += "\t\n FK_Node=" + WebUser.FK_Node;
                msg += "\t\n WorkID=" + WebUser.WorkID;
                MessageBox.Show(msg);
                break;

            case "About":
                AboutBox ab = new AboutBox();
                ab.ShowDialog();
                break;

            case "Save":
                this.DoSave();
                break;

            case "SaveTo":
            default:
                MessageBox.Show("功能未实现:" + func.No + " " + func.Name);
                break;
            }
        }
        private void LblCancelar_Click(object sender, EventArgs e)
        {
            var dialogAnswer = MessageBox.Show("Esta seguro que quiere cancelar la operacion?", "Atencion", MessageBoxButtons.YesNo);

            if (DialogResult.Yes == dialogAnswer)
            {
                Hide();
                //Si vino del registrarme, lo mando de nuevo al login
                if (!_abmCliente)
                {
                    var frmLogin = new FrmLogin();
                    frmLogin.ShowDialog();
                }
            }
        }
Esempio n. 11
0
        private bool LoginCheck()
        {
            using (FrmLogin frmLogin = new FrmLogin())
            {
                if (frmLogin.ShowDialog() != DialogResult.OK)
                {
                    //_currentUser = frmLogin.User;
                    //GetUserRights(Gloabal.SoftVersion);
                    return(true);
                }

                //Close();
                return(false);
            }
        }
Esempio n. 12
0
        //Login();
        private static void Login()
        {
            FrmLogin login = new FrmLogin();

            login.StartPosition = FormStartPosition.CenterScreen;
            if (DialogResult.OK == login.ShowDialog())
            {
                if (login.LoginState == true)
                {
                    FrmMain main = new FrmMain();
                    main.ShowDialog();
                    login.Hide();
                }
            }
        }
Esempio n. 13
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Guid     WorkCall    = new Guid(ConfigurationManager.AppSettings["WorkCellFid"].ToString());
            FrmLogin f           = new FrmLogin(WorkCall);
            var      loginResult = f.ShowDialog();

            if (loginResult == DialogResult.Yes)
            {
                Application.Run(new FrmMain(f.User));
            }

            //Application.Run(new FrmKanbanView());
        }
Esempio n. 14
0
 private void btLogin_Click(object sender, EventArgs e)
 {
     if (CAppOption.m_lUserID <= 0)
     {
         FrmLogin mLogin = new FrmLogin();
         if (mLogin.ShowDialog() != DialogResult.OK)
         {
             MessageBox.Show("дЦц╩спх╗оч!");
             return;
         }
         else
         {
             tbIdiograph.Enabled = true;
         }
     }
 }
Esempio n. 15
0
        private void FrmSplash_Shown(object sender, EventArgs e)
        {
            Thread.Sleep(3000);
            FrmLogin fl = new FrmLogin();

            this.Visible = false;
            //Create user if it does not exist.
            if (Crud.Login("Admin", "121181") == 0)
            {
                if (Crud.Insert_UserSys("Admin", "121181") != 1)
                {
                    MessageBox.Show("Error creating user for system.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            fl.ShowDialog(this);
        }
Esempio n. 16
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            //ghil.CreateLoginUserByReflection();

            //THilConfig.gOption.SysOptionFile = Application.StartupPath + @"\options\Hilconfig";

            //NeMessage.MsgDlg.ShowMsg(THilConfig.gOption.Port.ToString());

            if (THilConfig.giLoginUser.LoginName == null)
            {
                FrmLogin Frm = new FrmLogin(THilConfig.giLoginUser);
                if (Frm.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                }
            }
        }
Esempio n. 17
0
        private void OnFormLoad()
        {
            this.Visible = false;
            FrmLogin frmLogin = new FrmLogin();

            frmLogin.ShowDialog();

            if (LoginInfo.LoginEmployee.EmployeeTypeCode == Constants.EMPLOYEE)
            {
                pnlEmployees.Visible = false;
            }
            else
            {
                pnlEmployees.Visible = true;
            }
            lnkUserName.Text = LoginInfo.LoginEmployee.EmployeeName;
        }
Esempio n. 18
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException   += CurrentDomain_UnhandledException;
            AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
            try
            {
                _splashScreen               = new SplashScreen();
                _splashScreen.WindowState   = FormWindowState.Normal;
                _splashScreen.StartPosition = FormStartPosition.CenterScreen;

                if (_splashScreen.ShowDialog() == DialogResult.OK)
                {
                    if (!_splashScreen.DatabaseExists)
                    {
                        FormsOpened <FrmDataBaseConfig> .OpenForm(frmDataBaseConfig);
                    }

                    var container = BuildContainer();

                    var frm = new FrmLogin(container);

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        frm.Close();
                        _frmMain = new FrmMain(container);

                        using (var scope = container.BeginLifetimeScope())
                            Application.Run(_frmMain);
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
            }
            catch (Exception ex)
            {
                _splashScreen.Close();
                KryptonMessageBox.Show("Wystąpił błąd, treść : " + ex.Message, "Uwaga!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                Application.Exit();
            }
        }
Esempio n. 19
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // buat objek form login
            FrmLogin frmLogin = new FrmLogin();

            // tampilkan form login
            if (frmLogin.ShowDialog() == DialogResult.OK) // jika user dan password benar
            {
                Application.Run(new FrmUtama());          // jalankan form utama
            }
            else
            {
                Application.Exit(); // keluar dari aplikasi
            }
        }
Esempio n. 20
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //不对控件的多线程访问安全进行控制
            Control.CheckForIllegalCrossThreadCalls = false;

            bool loginSucceed = false;

            using (FrmLogin loginform = new FrmLogin())
            {
                loginform.ShowDialog();
                loginSucceed = Convert.ToBoolean(loginform.Tag);
            }
            if (loginSucceed)
            {
                Application.Run(new MainForm());
            }
        }
Esempio n. 21
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Form Principal
            FrmLogin fLogin = new FrmLogin();

            fLogin.ShowDialog();

            if (Util.tipo_usuario != 0)
            {
                Application.Run(new FrmPrincipal());
            }
            else
            {
                Application.Exit();
            }
        }
Esempio n. 22
0
 private void FrmMenuPrincipal_Activated(object sender, EventArgs e)
 {
     if (Usuario == null)
     {
         //si no hay nadie logeado, entonces mostramos el formulario de Login
         var frmLogin = new FrmLogin(this);
         frmLogin.ShowDialog();
         if (Usuario != null)
         {
             //dependiendo el tipo de usuario, habilitamos los distintos menues para que tengan acceso
             MnuUsuario.Enabled          = Usuario.TipoUsuario == TipoUsuarioEnum.Administrador ? true : false;
             MnuCambioContraseña.Enabled = Usuario.TipoUsuario == TipoUsuarioEnum.Administrador ? true : false;
         }
         else
         {
             Application.Exit();
         }
     }
 }
Esempio n. 23
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FrmLogin FrmLogin = new FrmLogin();

            if (FrmLogin.ShowDialog() == DialogResult.OK)
            {
                //Application.Run(new FrmPrincipal());
                if (BmsSoftware.ConfigSistema1.Default.FlagEmissorNFe == "S")
                {
                    Application.Run(new FrmEmissorNFe());
                }
                else
                {
                    Application.Run(new FrmPrincipal2());
                }
            }
        }
Esempio n. 24
0
        private void Connect()
        {
            FrmLogin     login = new FrmLogin();
            DialogResult dr    = new DialogResult();

            dr = login.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                client.Connect("127.0.0.1", 3333, cID.ToString());
                //  LOGIN:<USERNAME>:<PASSWORD>
                message = "LOGIN:"******":" + login.Password;
            }
            else if (login.IsRegistered)
            {
                client.Connect("127.0.0.1", 3333, cID.ToString());
                //  REGISTRATION:<USERNAME>:<PASSWORD>
                message = "REGISTRATION:" + login.EmailAddress + ":" + login.Password;
            }
        }
Esempio n. 25
0
        /// <summary>
        ///加载窗体
        /// </summary>
        private void LockForm()
        {
            this.Enabled = false;

            this.Cursor = Cursors.WaitCursor;
            FrmLogin frmlogin = new FrmLogin();

            frmlogin.cmbUserName.Text    = Security.CorporationName;
            frmlogin.cmbUserName.Enabled = false;
            frmlogin.ShowDialog();
            if (frmlogin.DialogResult == DialogResult.Cancel)
            {
                Application.Exit();
            }
            else
            {
                this.Enabled = true;
                //this.WindowState = FormWindowState.Maximized;
            }
        }
Esempio n. 26
0
        private void PagarConsumoInterno()
        {
            FrmLogin f = new FrmLogin();

            f.TipoUsuario = "ADMINISTRADOR";
            f.ShowDialog();
            if (f.DialogResult != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (FactoryUsuarios.UsuarioActivo.PuedeDarConsumoInterno.GetValueOrDefault(false) != true)
            {
                return;
            }
            this.SaldoTextEdit.Focus();
            LimpiarPagos();
            factura.ConsumoInterno = factura.MontoTotal;
            factura.Totalizar();
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Esempio n. 27
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            FrmLogin fLogin = new FrmLogin( );

            if (fLogin.ShowDialog( ) == DialogResult.OK)
            {
                menuStrip1.Enabled   = true;
                btnCharge.Enabled    = true;
                btnRefund.Enabled    = true;
                tbbarUser.Tag        = fLogin.CurrentEmployeeID;
                tbbarUser.Text       = DataReader.GetEmployeeNameById(fLogin.CurrentEmployeeID);
                _CurrentEmployeeId   = fLogin.CurrentEmployeeID;
                _CurrentWorkId       = fLogin.CurrentWorkId;
                _CurrentEmployeeName = DataReader.GetEmployeeNameById(fLogin.CurrentEmployeeID);
            }
            else
            {
                this.Close( );
            }
        }
Esempio n. 28
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FrmLogin frm_Login = new FrmLogin();

            frm_Login.ShowDialog();
            if (frm_Login.DialogResult == DialogResult.OK)
            {
                Application.Run(new FrmMain());
            }
            else
            {
                Application.Exit();
            }

            //FrmMain frmMain = new FrmMain();
            //frmMain.Show();

            //Application.Run(new FrmMain());
        }
Esempio n. 29
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FrmWelcome());
            FrmLogin f = new FrmLogin();

            f.ShowDialog();

            Engine.UserMenu();
            while (true)
            {
                if (Engine.logO == true)
                {
                    FrmLogin f2 = new FrmLogin();
                    f2.ShowDialog();

                    Engine.UserMenu();
                }
            }
        }
Esempio n. 30
0
        void RunInstance()
        {
            frmLogin             = new FrmLogin();
            frmLogin.LoginEvent += DoClickEvent;
            if (DialogResult.OK == frmLogin.ShowDialog())
            {
                // 判断当前是否有更新
                if (updateUtil.HasUpdate(appId))
                {
                    // 如果强制更新,不提示用户直接更新
                    if (!string.IsNullOrEmpty(updateUtil.LocalVersion.WH_CODE) &&
                        updateUtil.LocalVersion.WH_CODE.IndexOf(user.WarehouseCode) > -1 &&
                        ((updateUtil.LocalVersion != null && updateUtil.LocalVersion.UPDATE_FLAG == 1) ||
                         MsgBox.AskOK("系统当前有更新,是否更新系统?") == DialogResult.OK))
                    {
                        updateUtil.UpdateNow();
                        this.shouldRun = false;
                        this.ExitThread();
                        return;
                    }
                }
                GlobeSettings.LocalVersion = updateUtil.LocalVersion;
#if !DEBUG
                //加载报警窗体
                FrmStockWarm warm = new FrmStockWarm();
                warm.ShowDialog();
#endif
                FrmMain frmMain = new FrmMain();
                frmMain.FormClosed += OmMainFormClosed;

                frmMain.Show();
                frmMain.Activate();
            }
            else
            {
                this.shouldRun = false;
                this.ExitThread();
            }
        }
Esempio n. 31
0
        private void FrmMain_Load(object sender, System.EventArgs e)
        {
            //Check version
            //Dat edit to 1 connectionStr
               // string strConn = "Provider=MSDAORA.1;User ID=banana;Password="******";Data Source=electra.40;Extended Properties=;Persist Security Info=True";

               string strConn =FrmMain.connectionstr;
               //End Dat edit to 1 connectionStr
            OleDbConnection cn = new OleDbConnection(strConn);
            DataTable dt_v = new DataTable();
            try
            {
                if (cn.State == ConnectionState.Closed)
                    cn.Open();
                string SQL = "select version, nvl(checkexist,0) as checkexist from "+ owner + "nab_version where appid = '" + APPID + "'";
                OleDbDataAdapter da = new OleDbDataAdapter(SQL, cn);
                da.Fill(dt_v);
                if (dt_v.Rows.Count == 0)
                {
                    MessageBox.Show("Not exists application");
                    Application.Exit();
                }
                if (dt_v.Rows[0]["checkexist"].ToString().Trim() == "1")
                {
                    if (dt_v.Rows[0]["version"].ToString().Trim() != version)
                    {
                        string CustomerCare = "CustomerCare:0";
                        string ReportATM = "ReportATM:0";
                        string BanknetDomestic = "BanknetDomestic:0";
                        if (File.Exists("C:\\APP\\Checkversion.txt"))
                        {
                            FileStream ft = new FileStream(@"C:\APP\Checkversion.txt", FileMode.Open, FileAccess.Read);
                            StreamReader trr = new StreamReader(ft);
                            string text = "";
                            int i = 0;
                            while ((text = trr.ReadLine()) != null)
                            {
                                if (i == 0)
                                    BanknetDomestic = text;
                                else if (i == 1)
                                    ReportATM = text;
                                else if (i == 2)
                                    CustomerCare = text;
                                i += 1;
                            }
                            ReportATM = "ReportATM:1";
                            trr.Close();
                            trr.Dispose();
                            ft.Close();
                            ft.Dispose();
                        }
                        //Write file update
                        FileStream fp = new FileStream(@"C:\APP\Checkversion.txt", FileMode.Create, FileAccess.Write, FileShare.None);
                        StreamWriter tp = new StreamWriter(fp);
                        tp.WriteLine(BanknetDomestic);
                        tp.WriteLine(ReportATM);
                        tp.WriteLine(CustomerCare);
                        tp.Flush();
                        tp.Dispose();
                        fp.Close();
                        fp.Dispose();

                        MessageBox.Show("Đã có thay đổi trên server, vui lòng start lại ứng dụng để cập nhật phiên bản mới");
                        Application.Exit();
                        return;
                    }
                }
            }
            catch
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                    cn.Dispose();
                }
            }
            if (cn.State == ConnectionState.Open)
            {
                cn.Close();
                cn.Dispose();
            }
            //---------end check version
            string tem;
            FrmLogin frm =new FrmLogin();
            frm.ShowDialog();
            if (login==0)
            {
                MReport.Enabled=false;
                menuItem4.Enabled=false;
                MLogin.Enabled=true;
            }
            else
            {
                MReport.Enabled=true;
                menuItem4.Enabled=true;
                MLogin.Enabled=false;
                MAppCompareTran.Enabled = false;
            //		System.IO.StreamReader str=new System.IO.StreamReader("ConnectStr.txt");
            //		tem=str.ReadLine();
                tem = "REPORT";
                this.Text="ATM - " + tem;
            //	str.Close();
            }
        }
Esempio n. 32
0
        private void MLogin_Click(object sender, System.EventArgs e)
        {
            string tem;
            FrmLogin frm =new FrmLogin();
            frm.ShowDialog();
            if (login==0)
            {
                MReport.Enabled=false;
                menuItem4.Enabled=false;
                MLogin.Enabled=true;
            }
            else
            {
                MReport.Enabled=true;
                menuItem4.Enabled=true;
                MLogin.Enabled=false;
                ////System.IO.StreamReader str=new System.IO.StreamReader("ConnectStr.txt");
                ////tem=str.ReadLine();
                tem = "REPORT";
                this.Text="ATM - " + tem;

            //	str.Close();
            }
        }
Esempio n. 33
0
        /// <summary>
        /// @author : KhoaHT
        /// @CreateDate:04/07/2008
        /// @Description: Login menu click
        /// </summary>
        private void mnuLogin_Click(object sender, EventArgs e)
        {
            if(QTC.Adv.BusinessModule.Global.TestConnection())
                {
                    FrmLogin frmLogin = new FrmLogin();
                    frmLogin.ShowInTaskbar =false;
                    frmLogin.UserName = Properties.Settings.Default.SaveInfo ? Properties.Settings.Default.UserName : "";
                    frmLogin.Password = Properties.Settings.Default.SaveInfo ? Properties.Settings.Default.Password :"";
                    frmLogin.PasswordEncryptValue = Properties.Settings.Default.Password;
                    frmLogin.SavedInfo = Properties.Settings.Default.SaveInfo;
                    frmLogin.HidePassword = Properties.Settings.Default.SaveInfo;
                    frmLogin.ShowDialog();
                    if(frmLogin.SuccessFull)
                    {
                        DataRow dr = BWorkstation.SearchCode(Properties.Settings.Default.UserName).Tables[0].Rows[0];
                        LoadDetail(dr);

                        SetFormEnableLoginStatus();
                        SetPrivilige(true);
                    if(global::QTC.Adv.Workstation.Properties.Settings.Default.Download_Start==true)
                        if(QTC.Adv.BusinessModule.Global.TestConnection())
                        {
                            // Get current db time
                            GetCurrentTime();
                            // Binding data to grid
                            LoadSchedule();
                            Download();
                            BindingGrid();
                        }

                    }
            }
            else
                MsgBoxVN.ShowError("Không thể kết nối tới máy chủ CSDL.",Dic.STRING_ERROR);
        }