public void Alterar(ModeloUsuario obj) { if (obj.UsuNome.Trim().Length == 0) { throw new Exception("O nome do usuário é obrigatório"); } if (obj.UsuCpf.Trim().Length == 0) { throw new Exception("O CPF do usuário é obrigatório"); } if (obj.UsuTipo.Trim().Length <= 0) { throw new Exception("O tipo de usuário é obrigatório"); } if (obj.UsuStatus.Trim().Length <= 0) { throw new Exception("O status do usuário é obrigatório"); } if (obj.UsuLogin.Trim().Length <= 0) { throw new Exception("O login do usuário é obrigatório"); } if (obj.UsuSenha.Trim().Length <= 0) { throw new Exception("A senha do usuário é obrigatório"); } DALUsuario DALobj = new DALUsuario(conexao); DALobj.Alterar(obj); }
//********************* private Correo correoOfertante(string tenant, Subasta subasta, Oferta oferta) { Correo correo = new Correo(); try { System.Diagnostics.Debug.WriteLine("Entro correo ofertante DAL"); _idal = new DALUsuario(); Usuario vendedor = _idal.GetUsuario(tenant, subasta.id_Vendedor); Usuario comprador = _idal.GetUsuario(tenant, (int)oferta.id_Usuario); correo.destinatario = comprador.email; correo.asunto = "Felicidades " + comprador.nick + ". Has ofertado el articulo " + subasta.titulo; correo.mensaje = "Articulo : " + subasta.titulo + "Valor oferta " + oferta.Monto.ToString() + " Fecha : " + DateTime.Now.ToString() + System.Environment.NewLine + " Sitio " + tenant + "chebay.com"; System.Diagnostics.Debug.WriteLine("Salgo correoComprador DAL"); } catch (Exception) { throw; } return(correo); }
private Correo correoUltimoOfertante(string tenant, Subasta subasta, Oferta oferta, int id_ultimo) { Correo correo = new Correo(); try { System.Diagnostics.Debug.WriteLine("Entro correo ultimo ofertante DAL"); _idal = new DALUsuario(); Usuario vendedor = _idal.GetUsuario(tenant, id_ultimo); Usuario comprador = _idal.GetUsuario(tenant, (int)oferta.id_Usuario); correo.destinatario = comprador.email; correo.asunto = "Lo siento " + comprador.nick + ". Tu oferta en el articulo " + subasta.titulo + " ha sido superada."; correo.mensaje = "Articulo : " + subasta.titulo + "Nueva oferta " + oferta.Monto.ToString() + " Fecha : " + DateTime.Now.ToString() + System.Environment.NewLine + " Sitio " + tenant + "chebay.com"; System.Diagnostics.Debug.WriteLine("Salgo ultimo ofertante DAL"); } catch (Exception) { throw; } return(correo); }
public ClsCliente obtenerClientePorUsuario(string pUsuario) { ClsCliente oCliente = new ClsCliente(); ClsUsuario oUsuario = new ClsUsuario(); DALUsuario oDalUsuario = new DALUsuario(); try { oUsuario = oDalUsuario.obtenerUsuarioPorNombreUsuario(pUsuario); var items = from d in contexto.Cliente where d.idUsuario == oUsuario.idUsuario select d; IEnumerator <Cliente> enu = items.GetEnumerator(); while (enu.MoveNext()) { oCliente.idCliente = enu.Current.Id_Cliente; oCliente.nombre = oCliente.nombre; oCliente.telefono = oCliente.telefono; oCliente.direccion = oCliente.direccion; oCliente.mail = oCliente.mail; oCliente.idUsuario = oCliente.idUsuario; //var items2 = from d in contexto.OpcionDePago // where d.idOpcionDePago == enu.Current.opcionDePago // select d; //IEnumerator<OpcionDePago> enu2 = items2.GetEnumerator(); //while (enu2.MoveNext()) //{ // OpcionDePago oOpcionDePago = new OpcionDePago(); // oOpcionDePago = new OpcionDePago(); // oOpcionDePago.idOpcionDePago = enu2.Current.idOpcionDePago; // oOpcionDePago.nombre = enu2.Current.nombre; // oCliente.opcionDePago = oOpcionDePago; //} } } catch (Exception ex) { DalExcepcion oDExcepcion = new DalExcepcion(ex.InnerException.Message); throw oDExcepcion; } return(oCliente); }
public List <Bitacora> GetAll() { conexion.Open(); List <Bitacora> bitacora = new List <Bitacora>(); query = new SqlCommand("Select * From Bitacora", conexion); using (SqlDataReader reader = query.ExecuteReader()) { DALUsuario dalUsuario = new DALUsuario(); while (reader.Read()) { if (reader.HasRows) { bitacora.Add(new Bitacora(reader.GetDateTime(0), reader.GetString(1), (TipoMensaje)Enum.Parse(typeof(TipoMensaje), reader.GetString(2).ToString()), dalUsuario.Get(new Usuario(reader.GetString(3))))); } } } conexion.Close(); return(bitacora); }
public List <Bitacora> BuscarFecha(string filtro) { conexion.Open(); List <Bitacora> bitacora = new List <Bitacora>(); filtro += "%"; query = new SqlCommand($"SELECT * FROM Bitacora WHERE CONVERT(VARCHAR(25), Fecha, 121) LIKE @filtro", conexion); query.Parameters.AddWithValue("filtro", filtro); using (SqlDataReader reader = query.ExecuteReader()) { DALUsuario dalUsuario = new DALUsuario(); while (reader.Read()) { if (reader.HasRows) { bitacora.Add(new Bitacora(reader.GetDateTime(0), reader.GetString(1), (TipoMensaje)Enum.Parse(typeof(TipoMensaje), reader.GetString(2).ToString()), dalUsuario.Get(new Usuario(reader.GetString(3))))); } } } conexion.Close(); return(bitacora); }
public List <Bitacora> BuscarNombreUsuario(string filtro) { conexion.Open(); List <Bitacora> bitacora = new List <Bitacora>(); filtro += "%"; query = new SqlCommand($"Select * From Bitacora where NombreUsuario like @filtro", conexion); query.Parameters.AddWithValue("filtro", filtro); using (SqlDataReader reader = query.ExecuteReader()) { DALUsuario dalUsuario = new DALUsuario(); while (reader.Read()) { if (reader.HasRows) { bitacora.Add(new Bitacora(reader.GetDateTime(0), reader.GetString(1), (TipoMensaje)Enum.Parse(typeof(TipoMensaje), reader.GetString(2).ToString()), dalUsuario.Get(new Usuario(reader.GetString(3))))); } } } conexion.Close(); return(bitacora); }
public void Excluir(int codigo) { DALUsuario DALobj = new DALUsuario(conexao); DALobj.Excluir(codigo); }
public ModeloUsuario CarregaModeloUsuario(int codigo) { DALUsuario DALobj = new DALUsuario(conexao); return DALobj.CarregaModeloUsuario(codigo); }
public Boolean AutenticarUsuario(ModeloUsuario obj) { DALUsuario DALobj = new DALUsuario(conexao); return DALobj.AutenticarUsuario(obj); }
public Boolean AlterarSenha(ModeloUsuario obj) { DALUsuario DALobj = new DALUsuario(conexao); return DALobj.AlterarSenha(obj); }
public Boolean VerificarCPFLogin(ModeloUsuario obj) { DALUsuario DALobj = new DALUsuario(conexao); return DALobj.VerificarCPFLogin(obj); }
public DataTable Localizar(String valor) { DALUsuario DALobj = new DALUsuario(conexao); return DALobj.Localizar(valor); }
public BLLUsuario() { dal = new DALUsuario(); }
public BLLInstituicao() { dal = new DALUsuario(); }
public BLLVoluntario() { dal = new DALUsuario(); }