Exemplo n.º 1
0
        public static List <Buisness> getList()
        {
            string sql = "select * from BUISNESS";

            DataTable dt = ConnectionDB.ExecuteQuery(sql);

            List <Buisness> lista = new List <Buisness>();

            foreach (DataRow fila in dt.Rows)
            {
                Buisness b = new Buisness();
                b.idbuisness  = Convert.ToInt32(fila[0]);
                b.name        = fila[1].ToString();
                b.description = fila[2].ToString();
                lista.Add(b);
            }
            return(lista);
        }
Exemplo n.º 2
0
        private void ReloadControls()
        {
            Buisness actual      = (Buisness)cmbNegocio.SelectedItem;
            int      idBuis      = actual.idbuisness;
            var      productos   = ProductDAO.getListProductsFromStore(idBuis);
            var      negocios    = BuisnessDAO.getList();
            var      direcciones = AdressDAO.getListAdressUser(UserId);

            cmbNegocio.DataSource     = null;
            cmbNegocio.ValueMember    = "idbuisness";
            cmbNegocio.DisplayMember  = "name";
            cmbNegocio.DataSource     = negocios;
            cmbProducto.DataSource    = null;
            cmbProducto.ValueMember   = "idproduct";
            cmbProducto.DisplayMember = "name";
            cmbProducto.DataSource    = productos;
            cmbLocation.DataSource    = null;
            cmbLocation.ValueMember   = "idproduct";
            cmbLocation.DisplayMember = "name";
            cmbLocation.DataSource    = direcciones;
        }