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 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 List <Cliente> Select() { PCliente p = new PCliente(); return(p.Open()); }