コード例 #1
0
ファイル: Login.cs プロジェクト: AdrielRA/SGMI
        private void Btn_Logar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txt_User.Text) && !string.IsNullOrEmpty(txt_Pass.Text) && txt_User.Text != txt_User.HintText && txt_Pass.Text != txt_Pass.HintText)
            {
                User user = new User();
                user.Nome         = txt_User.Text;
                user.Passpassword = txt_Pass.Text;

                btn_Logar.Text = "AGUARDE...";
                if (Data_Controller.Validate_Login(user))
                {
                    if (cb_KeepConnection.Checked)
                    {
                        Data_Controller.Save_Logged_User(user);
                    }
                    Data_Controller.Start_Thread(new System.Threading.Thread(() => Data_Controller.Start_UserLogged_Delete_Watch()));
                    Forms_Controller.Esconder(this);
                    Forms_Controller.Abrir(new frm_Menu());
                }
                btn_Logar.Text = "LOGAR";
            }
            else
            {
                MessageBox.Show("Preencha os campos corretamente!");
            }
        }