private static string LOGININFO = "Host=35.230.13.126; Username=postgres; Password=oiAv4Kmdup8Pd4vd; Database=milestone3db"; // cloud database
        //private static string LOGININFO = "Host=localhost; Username=postgres; Password=greatPassword; Database=milestone3db";

        public QueryEngine()
        {
            searchParameters = new Dictionary <string, List <string> >();
            lastQuery        = new List <List <string> >();
            currBusId        = "";
            attrList         = new MapNamesToAttrValPair();
        }
Beispiel #2
0
        /**
         * ! YelpGUI
         * ? Initialization functions
         */

        /// <summary>
        /// Constructor for a yelpGUI.
        /// </summary>
        /// <param name="proj">A projection selector for a query to only return certain columns.</param>
        public YelpGUI(string proj = "name, address, city, state, stars, review_count, num_checkins, reviewRating, is_open, business_id, distance")
        {
            // ? initialize variables
            queryEngine = new QueryEngine();
            List <string> businessIds = new List <string> ();

            mapNamesToAttrValPair = new MapNamesToAttrValPair();
            currBusId             = string.Empty;
            currUserId            = string.Empty;
            projection            = proj;

            InitializeComponent();
            InitializeDropDowns();  //Initialize the state list dropdown

            // Initialize map to be able to scroll
            mapTest.userControl11.map.Focus();

            // By default we do not want the user to be able to click this button
            RemoveFavBtn.Enabled = false;

            // Create the column headers for the data grid view.
            foreach (var column in cols)
            {
                DataGridViewTextBoxColumn newColumn = new DataGridViewTextBoxColumn();
                newColumn.HeaderText = column;

                if (column == "Name")
                {
                    newColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; //Can change this to fill depending on if we want to make our app window larger
                }
                else
                {
                    newColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                }

                if (column == "business_id") //TODO: see what this does???
                {
                    newColumn.Visible = false;
                }
                businessGrid.Columns.Add(newColumn);
            }
        }