Example #1
0
        public List <Client> General_Devolver_AllClient()
        {
            List <Client> listaClientes = new List <Client>();

            clientTableTableAdapter adapterClient = new clientTableTableAdapter();
            clientTableDataTable    client        = new clientTableDataTable();

            adapterClient.FillByNone_ALLCLIENT(client);

            foreach (clientTableRow row in client.Rows)
            {
                Client tempClient = new Client();
                tempClient.Name         = row.NAME;
                tempClient.Last_Name    = row.LAST;
                tempClient.ID_Number    = row.IDENTIFIER;
                tempClient.Email        = row.EMAIL;
                tempClient.Client_State = row.STATE;
                tempClient.Direction    = row.DIRECTION;
                tempClient.Pin          = row.PIN;
                tempClient.Password     = row.PASSWORD;
                listaClientes.Add(tempClient);
            }

            return(listaClientes);
        }
Example #2
0
        public string RegistrarClient(string name, string last, string identifier, string email, string pin, string direction, string password)
        {
            try
            {
                clientTableTableAdapter adapter = new clientTableTableAdapter();
                adapter.InsertClientNuevo(identifier, name, last, password, pin, direction, email);

                return("Creado con exito");
            }
            catch
            {
                return("Datos erroneos");
            }
        }
Example #3
0
        public Client General_Consulta_Cliente(string cedula)
        {
            //CREAR OBJETO VACIO
            Client         objClient    = new Client();
            List <Account> listAccounts = new List <Account>();

            //GET DATOS_EN_clientTable
            clientTableTableAdapter adapterClient   = new clientTableTableAdapter();
            clientTableDataTable    clientDataTable = new clientTableDataTable();

            adapterClient.FillByCedula_Cliente(clientDataTable, cedula);

            //GET DATOS_EN_accountTable
            accountTableTableAdapter adapterAccount   = new accountTableTableAdapter();
            accountTableDataTable    accountDataTable = new accountTableDataTable();

            adapterAccount.FillByCedula_Account(accountDataTable, cedula);

            //Transferir datos de clientTable a ObjClient
            foreach (clientTableRow row in clientDataTable.Rows)
            {
                Client tempClient = new Client();
                objClient.Name               = row.NAME;
                objClient.Last_Name          = row.LAST;
                objClient.ID_Number          = row.IDENTIFIER;
                objClient.Email              = row.EMAIL;
                objClient.Client_State       = row.STATE;
                objClient.Direction          = row.DIRECTION;
                objClient.Pin                = row.PIN;
                objClient.Password           = row.PASSWORD;
                objClient.Number_Of_Accounts = row.ACCOUNTS;
            }
            //Transferir datos de clientTable a ObjClient
            foreach (accountTableRow row in accountDataTable.Rows)
            {
                Account tempAccount = new Account();
                tempAccount.Client_ID     = row.IDENTIFIER;
                tempAccount.Account_Name  = row.ACCOUNT_NAME;
                tempAccount.Account_State = row.ACCOUNT_STATE;
                tempAccount.Account_Type  = row.ACCOUNT_TYPE;
                tempAccount.Balance       = row.BALANCE;
            }
            objClient.Accounts = listAccounts;
            return(objClient);
        }