示例#1
0
        private void metroTile3_Click(object sender, EventArgs e)//查询订单操作
        {
            string selectStatement = "select * from orderlist where " +
                                     "user_id = \"" + userId + "\"";
            MySqlCommand com = new MySqlCommand(selectStatement, Login.con);

            com.ExecuteNonQuery();
            MySqlDataReader dataReader = com.ExecuteReader();

            //many.
            order_lists = null;
            if (dataReader.HasRows)
            {
                while (dataReader.Read() && dataReader.GetString(0) != null)
                {
                    if (order_lists == null)
                    {
                        order_lists = new List <string>();
                    }
                    // order_id
                    order_lists.Add(dataReader.GetString(0));
                }
            }
            dataReader.Close();
            if (order_lists == null || order_lists.Count == 0)
            {
                MetroFramework.MetroMessageBox.Show(this, "您当前还没有下过单哦!", "订单", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                QueryOrder order = new QueryOrder(order_lists);
                order.Show();
            }
        }
示例#2
0
 private void metroTile3_Click(object sender, EventArgs e)//查询订单操作
 {
     string selectStatement = "select * from orderlist where " +
         "user_id = \"" + userId + "\"";
     MySqlCommand com = new MySqlCommand(selectStatement, Login.con);
     com.ExecuteNonQuery();
     MySqlDataReader dataReader = com.ExecuteReader();
     //many.
     order_lists = null;
     if (dataReader.HasRows)
     {
         while (dataReader.Read() && dataReader.GetString(0) != null)
         {
             if (order_lists == null)
             {
                 order_lists = new List<string>();
             }
             // order_id
             order_lists.Add(dataReader.GetString(0));
         }
     }
     dataReader.Close();
     if (order_lists == null || order_lists.Count==0 )
         MetroFramework.MetroMessageBox.Show(this, "您当前还没有下过单哦!", "订单", MessageBoxButtons.OK, MessageBoxIcon.Error);
     else
     {
         QueryOrder order = new QueryOrder(order_lists);
         order.Show();
     }
 }