Example #1
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (pubclass.IsUserValid(txt_Username.Text.Trim(), txt_Password.Text.Trim()))
                {
                    ValidUser = true;

                    MainForm mfrm = new MainForm();
                    mfrm.Online_Username = txt_Username.Text.Trim();

                    Close();
                }
            }
            catch (Exception ex)
            {
                OCA.WinUI.BaseForms.BaseMessageBox mesg = new OCA.WinUI.BaseForms.BaseMessageBox();
                mesg.Error("خطا", ex.Message);

                if (LoginFailed == 3)
                {
                    this.Close();
                }

                LoginFailed++;
                txt_Username.Clear();
                txt_Password.Clear();
                txt_Username.Focus();
            }
        }