Exemplo n.º 1
0
        public static Customer GetById(uint id)
        {
            string   value    = AccountDAO.RegistrationCompleted(id) ? "tbCustomer" : "tblogin";
            Customer customer = null;

            if (AccountDAO.RegistrationCompleted(id))
            {
                var row = db.ReaderRow(db.ReturnCommand($"select * from tbcustomer where LoginId = '{id}'"));
                customer = new Customer(AccountDAO.GetById(id), (string)row[1], (string)row[2], (string)row[3], row[4] + "");
            }
            else
            {
                var row = db.ReaderRow(db.ReturnCommand($"select * from tblogin where LoginId = '{id}'"));
                customer = new Customer(AccountDAO.GetById(id), "", "", "", "");
            }
            return(customer);
        }
Exemplo n.º 2
0
        public static List <Customer> GetList()
        {
            var list = new List <Customer>();

            db.ReaderRows(db.ReturnCommand("select * from tbCustomer"), row => list.Add(new Customer(AccountDAO.GetById((uint)row[0]), (string)row[1], (string)row[2], (string)row[3], row[4] + "")));
            return(list);
        }
Exemplo n.º 3
0
        public static Customer GetByCPF(string cpf)
        {
            var row = db.ReaderRow(db.ReturnCommand($"select * from tbcustomer where custcpf = '{cpf}'"));

            return(new Customer(AccountDAO.GetById((uint)row[0]), (string)row[1], (string)row[2], (string)row[3], row[4] + ""));
        }