/// <summary>
        ///   加载存货信息(存货代码、存货名称)到List泛型
        /// </summary>
        /// <returns> 包含存货信息的List泛型列表 </returns>
        private List<PropertyClass> LoadInven()
        {
            PropertyClass proCla = new PropertyClass(); //实例化PropertyClass类
            Type elemnetType = proCla.GetType(); //获取proCla的Type
            PropertyInfo[] publicProperties = elemnetType.GetProperties(); //得到实例proCla的Type所拥有的所有公共属性
            //得到存货信息,该存货信息为DataTable类型
            DataTable dt =
                db.GetDataSet("select InvenCode,InvenName ,SpecsModel from BSInven", "BSInven").Tables["BSInven"];
            List<PropertyClass> tempProperties = new List<PropertyClass>(); //实例化List<PropertyClass>泛型类
            //逐行读取得到的存货信息
            foreach (DataRow row in dt.Rows)
            {
                //循环数据源dt中的所有列
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    //循环实例proCla的Type拥有的所有公共属性
                    for (int j = 0; j < publicProperties.Length; j++)
                    {
                        //如果数据源dt中指定的列名称与某个公共属性的名称相同
                        if (dt.Columns[i].ColumnName == publicProperties[j].Name)
                        {
                            if (Convert.IsDBNull(row[i])) //如果数据源dt中的当前数据项为null
                            {
                                continue; //则终止本次循环,进入下一次循环
                            }
                            publicProperties[j].SetValue(proCla, row[i], null); //为当前实例proCla中的某个属性赋值,该值为row[i]
                        }
                    }
                }

                tempProperties.Add(proCla); //向泛型列表tempProperties中添加PropertyClass类型的元素,即PropertyClass类的实例proCla
                proCla = new PropertyClass(); //重新创建PropertyClass类的实例
            }

            return tempProperties; //返回包含存货信息的List泛型列表
        }
 /// <summary>
 ///   加载Bom信息(物料清单)到List泛型(使用List泛型封装Bom信息)
 /// </summary>
 /// <returns> 包含Bom信息的List泛型列表 </returns>
 private List<PropertyClass> LoadBom()
 {
     List<PropertyClass> temps = new List<PropertyClass>(); //实例化List<PropertyClass>泛型类
     //得到Bom信息,该Bom信息为DataTable类型
     DataTable dt = db.GetDataSet("select ProInvenCode,MatInvenCode from BSBom", "BSBom").Tables["BSBom"];
     //逐行读取得到的Bom信息
     foreach (DataRow row in dt.Rows)
     {
         //创建PropertyClass类的实例temp
         PropertyClass temp = new PropertyClass();
         //给实例temp的属性赋值
         temp.ProInvenCode = row["ProInvenCode"].ToString();
         temp.MatInvenCode = row["MatInvenCode"].ToString();
         //向泛型列表temps中添加PropertyClass类型的元素,即PropertyClass类的实例temp
         temps.Add(temp);
     }
     return temps;
 }