Пример #1
0
        public Form1()
        {
            InitializeComponent();
            mydb = new MySQL_connection();
            sqlIns = new SQLInserter();
            businessDicts = new List<List<Dictionary<string, string>>>();
            reviewDicts = new List<Dictionary<string, string>>();
            userDicts = new List<Dictionary<string, string>>();
            string[] ex = new string[]{ "hours", "neighborhoods", "friends", "compliments", "elite" };

            json = new JSON(ex);
            //json.Convert("yelp_business.json", "Test2.txt");
            // json.Convert("yelp_review.json", "Text3.txt");
            //json.Convert("yelp_user.json", "Text4.txt");
            //businessDicts = sqlIns.JSON_to_Dict_Business("Test2.txt"); //change business table to dictionaries
            //reviewDicts = sqlIns.JSON_to_Dict_Review("Text3.txt");
            userDicts = sqlIns.JSON_to_Dict_User("Text4.txt");
            if (mydb.OpenConnection() == true)
            {
            }

            //sqlIns.Dict_to_SQL_Business(businessDicts, mydb.connect);
            //sqlIns.Dict_to_SQL_Review(reviewDicts,mydb.connect);
            sqlIns.Dict_to_SQL_User(userDicts, mydb.connect);
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            mydb          = new MySQL_connection();
            sqlIns        = new SQLInserter();
            businessDicts = new List <List <Dictionary <string, string> > >();
            reviewDicts   = new List <Dictionary <string, string> >();
            userDicts     = new List <Dictionary <string, string> >();
            string[] ex = new string[] { "hours", "neighborhoods", "friends", "compliments", "elite" };

            json = new JSON(ex);
            //json.Convert("yelp_business.json", "Test2.txt");
            // json.Convert("yelp_review.json", "Text3.txt");
            //json.Convert("yelp_user.json", "Text4.txt");
            //businessDicts = sqlIns.JSON_to_Dict_Business("Test2.txt"); //change business table to dictionaries
            //reviewDicts = sqlIns.JSON_to_Dict_Review("Text3.txt");
            //userDicts = sqlIns.JSON_to_Dict_User("Text4.txt");
            if (mydb.OpenConnection() == true)
            {
            }

            //sqlIns.Dict_to_SQL_Business(businessDicts, mydb.connect);
            //sqlIns.Dict_to_SQL_Review(reviewDicts,mydb.connect);
            //sqlIns.Dict_to_SQL_User(userDicts, mydb.connect);
        }
Пример #3
0
        //List<List<Dictionary<string, string>>> businessDicts;
        //List<Dictionary<string, string>> reviewDicts;
        //List<Dictionary<string, string>> userDicts;
        public Form1()
        {
            InitializeComponent();
            sqlIns = new SQLInserter();
            mydb   = new MySQL_connection();
            //businessDicts = new List<List<Dictionary<string, string>>>();
            //reviewDicts = new List<Dictionary<string, string>>();
            //userDicts = new List<Dictionary<string, string>>();
            string[] ex = new string[] { "hours", "neighborhoods", "friends", "compliments", "elite" };

            json = new JSON(ex);
            //json.Convert("yelp_business.json", "Test2.txt");
            //json.Convert("yelp_review.json", "Text3.txt");
            //json.Convert("yelp_user.json", "Text4.txt");
            //businessDicts = sqlIns.JSON_to_Dict_Business("Test2.txt"); //change business table to dictionaries
            //reviewDicts = sqlIns.JSON_to_Dict_Review("Text3.txt");
            //userDicts = sqlIns.JSON_to_Dict_User("Text4.txt");
            if (mydb.OpenConnection() == true)
            {
            }

            //sqlIns.Dict_to_SQL_Business(businessDicts, mydb.connect);
            //sqlIns.Dict_to_SQL_Review(reviewDicts, mydb.connect);
            //sqlIns.Dict_to_SQL_User(userDicts, mydb.connect);


            //****** set up business category checklist ******
            //must make a list of strings that just holds category because all
            //we're looking for is category
            List <string> categoryC = new List <string>();

            categoryC.Add("category");
            string qStr = "SELECT distinct category FROM categories ORDER BY category;";
            List <List <string> > qResult = mydb.SQLSELECTExec(qStr, categoryC);

            //copy query results to the dropdown
            for (int i = 0; i < qResult[0].Count(); i++)
            {
                busDemCheckedListBox.Items.Add(qResult[0][i]);
                checkedListBox1.Items.Add(qResult[0][i]);
            }
        }