public List <MCliente> ListarClientes() { PCliente dados = new PCliente(); List <MCliente> listaDeClientes = dados.Abrir(); return(listaDeClientes); }
public List <Cliente> Select(string s) { PCliente p = new PCliente(); List <Cliente> cs = p.Open(); return(cs.Where(x => x.NomeCliente.StartsWith(s)).ToList()); }
public void DeletarCliente(MCliente cliente) { PCliente dados = new PCliente(); List <MCliente> listaDeClientes = dados.Abrir(); MCliente clienteDeletado = listaDeClientes.Where(temp => temp.Cpf == cliente.Cpf).Single(); listaDeClientes.Remove(clienteDeletado); dados.Salvar(listaDeClientes); }
public void Insert(Cliente c) { PCliente p = new PCliente(); List <Cliente> cs = p.Open(); int Id = 1; if (cs.Count > 0) { Id = cs.Max(x => x.IdCliente) + 1; } c.IdCliente = Id; cs.Add(c); p.Save(cs); }
public void Delete(Cliente c) { PCliente p = new PCliente(); List <Cliente> cs = p.Open(); try { Cliente r = cs.Where(x => x.IdCliente == c.IdCliente).Single(); cs.Remove(r); p.Save(cs); } catch (InvalidOperationException) { } }
public void InserirCliente(MCliente cliente) { //Verifica se todos os campos do cadastro foram preenchidos if (cliente.Nome != "" && cliente.Cpf != "" && cliente.Sexo != "" && cliente.Nascimento != null && cliente.Nascimento != DateTime.MinValue) { PCliente dados = new PCliente(); if (!dados.verificaExistenciaCliente(cliente.Cpf)) { List <MCliente> listaDeClientes = dados.Abrir(); listaDeClientes.Add(cliente); dados.Salvar(listaDeClientes); } else { throw new UsuarioJaCadastradoException("O CPF informado já possui um cadastro"); } } else { throw new CadastroIncompletoException("Cadastro incompleto, não foi possível finalizar a operação"); } }
public void AddDireccion(DtoDirecciones nuevaDireccion, string password) { PCliente pc = new PCliente(); pc.addDire(nuevaDireccion, password); }
public List <DtoDirecciones> GetDirecciones(string password) { PCliente pc = new PCliente(); return(pc.getDataDire(password)); }
public DtoCliente GetDataCliente(string password, out bool existeDir) { PCliente pc = new PCliente(); return(pc.getDataCli(password, out existeDir)); }
public bool AddCliente(DtoCliente dto) { PCliente pc = new PCliente(); return(pc.RegistrarCliente(dto)); }
public static void Eliminar(Clientes _Cliente) { PCliente.Eliminar(_Cliente.Cedula); }
public DtoDirecciones getNombreD(string password, string nombreD) { PCliente pc = new PCliente(); return(pc.getNombreD(password, nombreD)); }
public static void Agregar(Clientes _Cliente) { PCliente.Agregar(_Cliente); }
public List <Cliente> Select() { PCliente p = new PCliente(); return(p.Open()); }
public void ModificarPerfil(DtoCliente dto) { PCliente pc = new PCliente(); pc.UpdateCliente(dto); }
public bool ExisteCliente(DtoCliente dto) { PCliente pc = new PCliente(); return(pc.existeCliente(dto)); }
public static Clientes Buscar(int _Cedula) { Clientes c = null; return(c = PCliente.Buscar(_Cedula)); }
public void EliminarDireccion(int id) { PCliente pc = new PCliente(); pc.eliminarDireccion(id); }
public static void Modificar(Clientes _Cliente) { PCliente.Modificar(_Cliente); }