public List <beLogin> ValidarLogin(string usuario, string password, string dealercode) { List <beLogin> lbeLogin = null; using (SqlConnection con = new SqlConnection(Conexion)) { try { con.Open(); daLogin odaLogin = new daLogin(); lbeLogin = odaLogin.ValidarLogin(con, usuario, password, dealercode); } catch (SqlException ex) { beLog obeLog; foreach (SqlError err in ex.Errors) { obeLog = new beLog(); obeLog.MensajeError = err.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto <beLog> .grabarArchivoTexto(ArchivoLog, obeLog); } } catch (Exception ex) { beLog obeLog = new beLog(); obeLog.MensajeError = ex.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto <beLog> .grabarArchivoTexto(ArchivoLog, obeLog); } } return(lbeLogin); }
public bool LogOut(string usuario) { bool exito = false; using (SqlConnection con = new SqlConnection(Conexion)) { try { con.Open(); daLogin odaLogin = new daLogin(); exito = odaLogin.LogOut(con, usuario); } catch (SqlException ex) { beLog obeLog; foreach (SqlError err in ex.Errors) { obeLog = new beLog(); obeLog.MensajeError = err.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto.Grabar(obeLog, ArchivoLog); } } catch (Exception ex) { beLog obeLog = new beLog(); obeLog.MensajeError = ex.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto.Grabar(obeLog, ArchivoLog); } } return(exito); }
public beLogin ValidarLogin(string usuario, string password, string dstb) { beLogin lbeLogin = null; using (SqlConnection con = new SqlConnection(Conexion)) { try { con.Open(); daLogin odaLogin = new daLogin(); lbeLogin = odaLogin.ValidarLogin(con, usuario, password, dstb); } catch (SqlException ex) { beLog obeLog; foreach (SqlError err in ex.Errors) { obeLog = new beLog(); obeLog.MensajeError = err.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto.Grabar(obeLog, ArchivoLog); } } catch (Exception ex) { beLog obeLog = new beLog(); obeLog.MensajeError = ex.Message; obeLog.DetalleError = ex.StackTrace; ucObjeto.Grabar(obeLog, ArchivoLog); } } return(lbeLogin); }
public async Task <string> fnValidar(string validacion) { string _xRpta = ""; daLogin _xOda = new daLogin(); string[] _xVal = new string[3]; string _xResponse = ""; _xVal = validacion.Split('¦'); _xRpta = await _xOda.validarLogin(_xVal[0], _xVal[1]).ConfigureAwait(false); if (!string.IsNullOrWhiteSpace(_xRpta)) { _xResponse = "1¦Entorno.html¦" + _xRpta + ""; } else { _xResponse = "0¦***datos inválidos***"; } return(_xResponse); }