/// <summary>
        /// ** nunit
        /// </summary>
        /// <param name="opItemControl"></param>
        public void UpdateItemControl(OPItemControl opItemControl)
        {
            //add by crystal chu 2005/04/20 OPBOM是否在使用中
            OPBOMFacade _opBOMFacade = new OPBOMFacade(this.DataProvider);

            _opBOMFacade.OPBOMChangedCheck(opItemControl.ItemCode, opItemControl.OPBOMCode, opItemControl.OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);
            this._helper.UpdateDomainObject(opItemControl);
        }
        /// <summary>
        /// 添加opitemcontrol,必须先判断相同的控制信息是否已经被添加,如果没有添加,则
        /// 其中的sequence取一组控制信息当中最大sequence加1
        /// ** nunit
        /// </summary>
        /// <param name="opItemControl"></param>
        public void AddOPItemControl(OPItemControl opItemControl)
        {
            if (opItemControl == null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Null_Paramter");
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(OPBOMFacade),String.Format(ErrorCenter.ERROR_ARGUMENT_NULL,"opItemControl")));
            }

            //add by crystal chu 2005/04/20 OPBOM是否在使用中
            OPBOMFacade _opBOMFacade = new OPBOMFacade(this.DataProvider);

            _opBOMFacade.OPBOMChangedCheck(opItemControl.ItemCode, opItemControl.OPBOMCode, opItemControl.OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            object[] objs = QueryOPBOMItemControl(opItemControl.ItemCode, opItemControl.OPBOMItemCode, opItemControl.OPBOMCode, opItemControl.OPBOMVersion, opItemControl.OPID,
                                                  opItemControl.DateCodeStart, opItemControl.DateCodeEnd, opItemControl.VendorCode, opItemControl.VendorItemCode, opItemControl.ItemVersion,
                                                  opItemControl.BIOSVersion, opItemControl.PCBAVersion, opItemControl.CardStart, opItemControl.CardEnd);
            if (objs != null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_OPItemControl_Exist");
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(OPItemControlFacade),String.Format(ErrorCenter.ERROR_ADDOPITEMCONTROL, opItemControl.OPBOMItemCode)));
            }
            objs = QueryOPBOMItemControl(opItemControl.ItemCode, opItemControl.OPBOMItemCode, opItemControl.OPBOMCode, opItemControl.OPBOMVersion, opItemControl.OPID, string.Empty,
                                         string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
            int sequence = 0;

            if (objs != null)
            {
                sequence = System.Int32.Parse(((OPItemControl)objs[objs.Length - 1]).Sequence.ToString()) + 1;
            }
            try
            {
                //Laws Lu,2006/11/13 uniform system collect date
                DBDateTime dbDateTime;

                dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                opItemControl.MaintainDate = dbDateTime.DBDate;
                opItemControl.MaintainTime = dbDateTime.DBTime;

                opItemControl.Sequence = sequence;
                this.DataProvider.Insert(opItemControl);
            }
            catch (Exception ex)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_AddOPItemControl", String.Format("$OPBOMItemcode='{0}'", opItemControl.OPBOMItemCode), ex);
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(OPItemControl), String.Format(ErrorCenter.ERROR_ADDOPITEMCONTROL, opItemControl.OPBOMItemCode)), ex);
            }
        }
        /// <summary>
        /// 判断该bom是否已经被工单使用,如果使用则对应opbom上料料品的控制设置则不可以被删除
        /// ** nunit
        /// </summary>
        /// <param name="opItemControl"></param>
        public void DeleteItemControl(OPItemControl opItemControl)
        {
            if (opItemControl == null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Null_Paramter");
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(OPBOMFacade),String.Format(ErrorCenter.ERROR_ARGUMENT_NULL,"opItemControl")));
            }

            //add by crystal chu 2005/04/20 OPBOM是否在使用中
            OPBOMFacade _opBOMFacade = new OPBOMFacade(this.DataProvider);

            _opBOMFacade.OPBOMChangedCheck(opItemControl.ItemCode, opItemControl.OPBOMCode, opItemControl.OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);

            try
            {
                this.DataProvider.Delete(opItemControl);
            }
            catch (Exception ex)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_DeleteItemControl", String.Format("[$OPBOMItemcode='{0}']", opItemControl.OPBOMItemCode), ex);
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(OPItemControl), string.Format(ErrorCenter.ERROR_DELETEITEMCONTROL,opItemControl.OPBOMItemCode)), ex);
            }
        }