Пример #1
0
        public void DeleteCliente(MCliente c)
        {
            PProgram        p  = new PProgram();
            List <MCliente> cs = p.OpenCliente();

            for (int i = 0; i < cs.Count; i++)
            {
                if (cs[i].Id == c.Id)
                {
                    cs.RemoveAt(i);
                    break;
                }
            }
            p.SaveCliente(cs);
        }
Пример #2
0
        /* --------------------------------------------------------------------------------------------------------------- */

        public List <MUsuario> AllAccount()
        {
            PProgram        p    = new PProgram();
            List <MUsuario> list = new List <MUsuario>();

            foreach (MUsuario u in p.OpenFuncionario())
            {
                list.Add(u);
            }
            foreach (MUsuario u in p.OpenCliente())
            {
                list.Add(u);
            }

            return(list);
        }
Пример #3
0
        public void InserirCliente(MCliente c)
        {
            PProgram        p  = new PProgram();
            List <MCliente> cs = p.OpenCliente();
            int             m  = 0;

            foreach (MUsuario x in AllAccount())
            {
                if (x.Id > m)
                {
                    m = x.Id;
                }
            }
            c.Id = m + 1;
            cs.Add(c);
            p.SaveCliente(cs);
        }
Пример #4
0
        }/*
          * public void InserirConta(MUsuario c)
          * {
          * PProgram p = new PProgram();
          * List<MUsuario> cs = p.OpenContas();
          * int m = 0;
          * foreach (MUsuario x in cs) if (x.Id > m) m = x.Id;
          * c.Id = m + 1;
          * cs.Add(c);
          *
          * p.SaveContas(cs);
          * }
          * public void UpdateConta(MUsuario c)
          * {
          * PProgram p = new PProgram();
          * List<MUsuario> cs = p.OpenContas();
          * for (int i = 0; i < cs.Count; i++)
          *     if (cs[i].Id == c.Id)
          *     {
          *         cs.RemoveAt(i);
          *         break;
          *     }
          * cs.Add(c);
          * p.SaveContas(cs);
          * }
          * public void DeleteConta(MUsuario c)
          * {
          * PProgram p = new PProgram();
          * List<MUsuario> cs = p.OpenContas();
          * for (int i = 0; i < cs.Count; i++)
          *     if (cs[i].Id == c.Id)
          *     {
          *         cs.RemoveAt(i);
          *         break;
          *     }
          * p.SaveContas(cs);
          * }*/

        public List <MCliente> ListarClientes()
        {
            PProgram p = new PProgram();

            return(p.OpenCliente());
        }