Esempio n. 1
0
        private void Selection_Load(object sender, EventArgs e)
        {
            GRD.Row = 0;

            GRD.set_ColWidth(0, 1500);
            GRD.Col  = 0;
            GRD.Text = "Start Date";

            GRD.set_ColWidth(1, 1500);
            GRD.Col  = 1;
            GRD.Text = "Start Time";

            GRD.set_ColWidth(2, 1500);
            GRD.Col  = 2;
            GRD.Text = "End Time";
        }
        private void Main_Load(object sender, EventArgs e)
        {
            GRD.Row = 0;

            GRD.set_ColWidth(0, 3000);
            GRD.Col  = 0;
            GRD.Text = "PRO Name";

            GRD.set_ColWidth(1, 4500);
            GRD.Col  = 1;
            GRD.Text = "Category";

            GRD.set_ColWidth(2, 1000);
            GRD.Col  = 2;
            GRD.Text = "Zip";

            GRD.set_ColWidth(3, 2000);
            GRD.Col  = 3;
            GRD.Text = "Contact";

            GRD.set_ColWidth(4, 1000);
            GRD.Col  = 4;
            GRD.Text = "Rating";

            GRD.set_ColWidth(5, 1000);
            GRD.Col  = 5;
            GRD.Text = "Jobs";

            GRD.set_ColWidth(6, 1000);
            GRD.Col  = 6;
            GRD.Text = "Pay";

            GRD.set_ColWidth(7, 3000);
            GRD.Col  = 7;
            GRD.Text = "Availability";

            GRD.set_ColWidth(8, 0);
            GRD.Col  = 8;
            GRD.Text = "Skills";

            GRD.set_ColWidth(9, 0);
            GRD.Col  = 9;
            GRD.Text = "Lat";

            GRD.set_ColWidth(10, 0);
            GRD.Col  = 10;
            GRD.Text = "Long";

            lstCategory.Items.Clear();

            try
            {
                using (SQLiteConnection conn = new SQLiteConnection(connectionString))
                {
                    conn.Open();
                    string sql = "SELECT DISTINCT S_CATEGORY FROM CATEGORY_SERVICE_MAPPING";

                    using (SQLiteCommand cmd = new SQLiteCommand(sql, conn))
                    {
                        using (SQLiteDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                lstCategory.Items.Add(reader["S_CATEGORY"].ToString());
                            }
                        }
                    }
                    conn.Close();
                }
            }
            catch (SQLiteException ex)
            {
                Console.Write(ex.StackTrace);
            }


            try
            {
                using (SQLiteConnection conn = new SQLiteConnection(connectionString))
                {
                    conn.Open();
                    string sql = "SELECT * FROM PRO_CUSTOMER_LIST";

                    using (SQLiteCommand cmd = new SQLiteCommand(sql, conn))
                    {
                        using (SQLiteDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                PRO_CUSTOMER cust = new PRO_CUSTOMER();
                                cust.Pro_Customer_Name = reader["Pro_Name"].ToString();
                                cust.Pro_Category_Name = reader["Pro_Category"].ToString();
                                cust.Pro_Zip_Code      = int.Parse(reader["Pro_Zip"].ToString());
                                cust.Pro_Phone_Number  = reader["Pro_Phone"].ToString();
                                cust.Pro_Rating_from_5 = double.Parse(reader["Pro_Rating"].ToString());
                                cust.Pro_No_Of_Orders  = int.Parse(reader["Pro_NoOfOrders"].ToString());
                                cust.Pro_Rate_in_USD   = double.Parse(reader["Pro_Rate"].ToString());
                                cust.Pro_Skills_List   = reader["Pro_Skills"].ToString();
                                cust.Lat      = reader["Latitude"].ToString();
                                cust.Lng      = reader["Longitude"].ToString();
                                cust.Username = reader["username"].ToString();
                                cust.Passwd   = reader["password"].ToString();
                                pros_list.Add(cust);
                            }
                        }
                    }
                    conn.Close();
                }
            }
            catch (SQLiteException ex)
            {
                Console.Write(ex.StackTrace);
            }
        }