public bool ModificarMailPorCliente() { try { Datos.ACCESO ac = CommonBC.DBConexion.ACCESO.First(b => b.USUARIO_ID == this.UsuarioId); ac.USUARIO = this.Usuario; CommonBC.DBConexion.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool ModificarClaveProveedor() { try { Datos.ACCESO ac = CommonBC.DBConexion.ACCESO.First(b => b.PROVEEDOR_ID == this.ProveedorId); ac.CLAVE = this.Clave; CommonBC.DBConexion.Entry(ac).State = System.Data.EntityState.Modified; CommonBC.DBConexion.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Login() { try { Datos.ACCESO ac = CommonBC.DBConexion.ACCESO.First(b => b.USUARIO.ToUpper().Equals(this.Usuario.ToUpper()) && b.CLAVE.Equals(this.Clave)); this.ID = int.Parse(ac.ID.ToString()); this.Usuario = ac.USUARIO; if (ac.USUARIO_ID != null) { this.UsuarioId = int.Parse(ac.USUARIO_ID.ToString()); this.ProveedorId = 0; } else { this.ProveedorId = int.Parse(ac.PROVEEDOR_ID.ToString()); this.UsuarioId = 0; } return(true); } catch (Exception err) { return(false); } }