private void BtnConfirmar_Click(object sender, EventArgs e) { if (TxtJustificativa.Text.Length < 10) { MessageBox.Show("Preencha a justificativa com no mínimo dez (10) caracteres."); TxtJustificativa.Focus(); } else { CPonto.ACESSOPONTOCONTROLE oAcesso = new CPonto.ACESSOPONTOCONTROLE(); oAcesso.APAcessoForcado = true; oAcesso.APCodigoPontoControle = PontoControle; oAcesso.APCodigoUsuarioLiberaForcado = CodigoUsuario; oAcesso.APDataAcesso = DateTime.Now; oAcesso.APMotivoAcessoForcado = TxtJustificativa.Text; oAcesso.APTipoPontoControle = TipoPontoControle; CPonto.CPontoClient oProxy = new CPonto.CPontoClient(); oProxy.IncluirAcesso(oAcesso); oProxy.Close(); bolLibera = true; this.Close(); } }
private void KeyBoard_UserKeyPressed(object sender, KeyboardClassLibrary.KeyboardEventArgs e) { TxtJustificativa.Focus(); SendKeys.Send(e.KeyboardKeyPressed); }