public static ShelfOnInfo GetShelfOnInfo()
 {
     try
     {
         myCon.Open();
         string          sql             = "SELECT sp.ProductName,GROUP_CONCAT(tid),COUNT(1) FROM StockProducts sp WHERE sp.ProductState='已入库' GROUP BY sp.ProductName ";
         MySqlCommand    mySqlCommand    = new MySqlCommand(sql, myCon);
         MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader();
         ShelfOnInfo     shelfOnInfo     = new ShelfOnInfo();
         while (mySqlDataReader.Read())
         {
             if (mySqlDataReader.HasRows)
             {
                 Productinfo productinfo = new Productinfo
                 {
                     ProductName = mySqlDataReader[0].ToString(),
                     tids        = mySqlDataReader[1].ToString().Split(new char[1] {
                         ','
                     }).ToList(),
                     Count = mySqlDataReader[2].ToString()
                 };
                 shelfOnInfo.productinfos.Add(productinfo);
             }
         }
         mySqlDataReader.Close();
         string          sql2             = "SELECT shelfcode,shelflocation from ShelfCodePositionCorrespondence WHERE ShelfState='无货物'";
         MySqlCommand    mySqlCommand2    = new MySqlCommand(sql2, myCon);
         MySqlDataReader mySqlDataReader2 = mySqlCommand2.ExecuteReader();
         while (mySqlDataReader2.Read())
         {
             if (mySqlDataReader2.HasRows)
             {
                 ShelfCode shelfCode = new ShelfCode
                 {
                     shelfcode     = mySqlDataReader2[0].ToString(),
                     shelflocation = mySqlDataReader2[1].ToString(),
                 };
                 shelfOnInfo.ShelfCodes.Add(shelfCode);
             }
         }
         mySqlDataReader2.Close();
         return(shelfOnInfo);
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog("查询失败", ex);
         return(null);
     }
     finally
     {
         myCon.Close();
     }
 }
        public void GetShelfOnOrder()
        {
            comboBox1.Items.Clear();
            comboBox3.Items.Clear();
            shelfOnInfo = DatabaseHelper.GetShelfOnInfo();
            foreach (var item in shelfOnInfo.productinfos)
            {
                comboBox1.Items.Add(item.ProductName);
            }

            foreach (var item in shelfOnInfo.ShelfCodes)
            {
                comboBox3.Items.Add(item.shelflocation);
            }
        }