/// <summary>
        /// 删除指定材料类别信息(父材料类别参数存在数据时更新父材料类别信息)
        /// </summary>
        /// <param name="materialTypeCode">要删除的材料类别编码</param>
        /// <param name="parentMaterialType">父材料类别信息, 如果此信息不为null则需修改父材料类别树信息</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>成功返回true</returns>
        public bool DeleteMaterialType(string materialTypeCode, MaterialTypeData parentMaterialType, out string error)
        {
            error = null;

            Hashtable[] inParamTables  = new Hashtable[2];
            Hashtable[] outParamTables = new Hashtable[2];

            inParamTables[0] = new Hashtable();
            inParamTables[0].Add("@MaterialTypeCode", materialTypeCode);

            inParamTables[1] = GetParamTable(parentMaterialType);

            string[] spCmds = new string[2];
            spCmds[0] = "DelMaterialType";
            spCmds[1] = "UpdateMaterialType";

            Dictionary <OperateCMD, object> dicOperateCMD =
                AccessDB.GetIDBOperate().Transaction_CMD(spCmds, inParamTables, ref outParamTables);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// 保存CVT下线试验数据
        /// </summary>
        /// <param name="testInfo">CVT下线试验信息</param>
        /// <returns>返回操作是否成功的标志</returns>
        public bool SaveCVTExpData(CvtTestInfo testInfo)
        {
            if (testInfo == null)
            {
                throw new ArgumentException("试验数据参数不允许为空");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.CvtNumber))
            {
                throw new Exception("CVT编号不允许为空");
            }

            string[] cvtNumber = testInfo.CvtNumber.Split(new char[] { ' ' });

            if (cvtNumber.Length != 2)
            {
                throw new Exception("CVT编号格式不正确");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.OilType))
            {
                throw new Exception("油品类型不允许为空");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.TestDevice))
            {
                throw new Exception("试验设备名称不允许为空");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.TestResult))
            {
                throw new Exception("试验结果不允许为空");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.Tester))
            {
                throw new Exception("实验员不允许为空");
            }

            if (GlobalObject.GeneralFunction.IsNullOrEmpty(testInfo.PreassemblyPersonnel))
            {
                throw new Exception("预装员不允许为空");
            }

            if (testInfo.TestData == null || testInfo.TestData.Rows.Count == 0)
            {
                throw new Exception("试验项目表不允许为空");
            }

            string error = null;

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@ProductType", cvtNumber[0]);
            paramTable.Add("@CvtNumber", cvtNumber[1]);
            paramTable.Add("@TestDevice", testInfo.TestDevice);
            paramTable.Add("@OilType", testInfo.OilType);
            paramTable.Add("@TestResult", testInfo.TestResult);
            paramTable.Add("@Tester", testInfo.Tester);
            paramTable.Add("@PreassemblyPersonnel", testInfo.PreassemblyPersonnel);
            paramTable.Add("@Remark", testInfo.Remark);

            IDBOperate dbOperate = AccessDB.GetIDBOperate("DepotManagement");

            string[]    lstCmd    = new string[testInfo.TestData.Rows.Count + 1];
            Hashtable[] lstParam  = new Hashtable[testInfo.TestData.Rows.Count + 1];
            Hashtable[] outParams = new Hashtable[testInfo.TestData.Rows.Count + 1];

            lstCmd[0]   = "ZPX_InsertCVTTestInfo";
            lstParam[0] = paramTable;

            for (int i = 0; i < testInfo.TestData.Rows.Count; i++)
            {
                lstCmd[i + 1] = "ZPX_InsertCVTTestDataItems";

                paramTable = new Hashtable();

                paramTable.Add("@TestType", testInfo.TestData.Rows[i]["TestType"].ToString());
                paramTable.Add("@TestItemName", testInfo.TestData.Rows[i]["TestItemName"].ToString());
                paramTable.Add("@TestCondition", testInfo.TestData.Rows[i]["TestCondition"].ToString());
                paramTable.Add("@TestRequirement", testInfo.TestData.Rows[i]["TestRequirement"].ToString());
                paramTable.Add("@TestData", testInfo.TestData.Rows[i]["TestData"].ToString());
                paramTable.Add("@TestResult", testInfo.TestData.Rows[i]["TestResult"].ToString());

                lstParam[i + 1] = paramTable;
            }

            Dictionary <OperateCMD, object> dicOperateCMD = dbOperate.Transaction_CMD(lstCmd, lstParam, ref outParams);

            if (!AccessDB.GetResult(dicOperateCMD, out error))
            {
                throw new Exception(error);
            }
            else
            {
                return(true);
            }
        }