Пример #1
0
        //add by hiro 08/11/05 检查序列号内容为字母,数字和空格
        public Messages CheckSNContent(string moCode, string rcard, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages   msg        = new Messages();
            MOFacade   mofcade    = new MOFacade(domainProvider);
            ItemFacade itemfacade = new ItemFacade(domainProvider);
            object     objMo      = mofcade.GetMO(moCode);

            if (objMo == null)
            {
                return(msg);
            }
            string itemCode       = ((MO)objMo).ItemCode.ToString();
            object objItemSNcheck = itemfacade.GetItem2SNCheck(itemCode, ItemCheckType.ItemCheckType_SERIAL);

            if (objItemSNcheck == null)
            {
                return(msg);
            }
            if (((Item2SNCheck)objItemSNcheck).SNContentCheck == SNContentCheckStatus.SNContentCheckStatus_Need)
            {
                string pattern = @"^([A-Za-z0-9]+[ ]*)*[A-Za-z0-9]+$";
                Regex  rex     = new Regex(pattern, RegexOptions.IgnoreCase);
                Match  match   = rex.Match(rcard);
                if (!match.Success)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$CS_SNContent_CheckWrong $CS_Param_RunSeq:" + rcard.Trim()));
                    return(msg);
                }
            }
            return(msg);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">工单代码</param>
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_MO_Empty"));
            }
            else
            {
                object obj = new MOFacade(domainProvider).GetMO(data);

                if (obj == null)
                {
                    msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_MO_Not_Exist"));
                }
                else
                {
                    if ((((MO)obj).MOStatus != Web.Helper.MOManufactureStatus.MOSTATUS_RELEASE) &&
                        (((MO)obj).MOStatus != Web.Helper.MOManufactureStatus.MOSTATUS_OPEN))
                    {
                        msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_CS_MO_Should_be_Release_or_Open2"));
                    }
                }
            }

            return(msg);
        }
Пример #3
0
        //
        private Messages DoDataCollectAction(Common.DomainDataProvider.SQLDomainDataProvider domainProvider, IDCTClient client, string runningCard)
        {
            Messages messages = new Messages();

            ActionOnLineHelper _helper = new ActionOnLineHelper(domainProvider);

            messages = _helper.GetIDInfo(runningCard);
            ProductInfo product = (ProductInfo)messages.GetData().Values[0];

            /*
             * if (product == null || product.LastSimulation == null)
             * {
             *      messages.Add(new UserControl.Message(MessageType.Error, "$NoSimulation"));
             *      return messages;
             * }
             */

            CINNOActionEventArgs args = new CINNOActionEventArgs(
                ActionType.DataCollectAction_CollectINNO,
                runningCard,
                client.LoginedUser,
                client.ResourceCode,
                product,
                INNOCode,
                null
                );

            IAction action = new BenQGuru.eMES.DataCollect.Action.ActionFactory(domainProvider).CreateAction(ActionType.DataCollectAction_CollectINNO);

            domainProvider.BeginTransaction();
            try
            {
                messages.AddMessages(action.Execute(args));

                if (messages.IsSuccess())
                {
                    domainProvider.CommitTransaction();
                    messages.Add(new UserControl.Message(MessageType.Success, "$CS_INNO_CollectSuccess"));
                }
                else
                {
                    domainProvider.RollbackTransaction();
                }

                return(messages);
            }
            catch (Exception ex)
            {
                domainProvider.RollbackTransaction();
                messages.Add(new UserControl.Message(ex));
                return(messages);
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)domainProvider).PersistBroker.CloseConnection();
            }
        }
Пример #4
0
        public Messages CheckSN(string moCode, string rcard, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (System.Configuration.ConfigurationSettings.AppSettings["CheckRCardRange"] == "1")
            {
                msg.AddMessages(CheckSNRange(moCode, rcard, domainProvider));
            }
            return(msg);
        }
Пример #5
0
        // 检查序列号是否拆解或报废
        private bool CheckIMEISpliteOrScrape(Common.DomainDataProvider.SQLDomainDataProvider domainProvider, string rcard, decimal rcardseq, string mocode)
        {
            string sql = string.Format(" select count(*) from tblts where rcard='{0}' and rcardseq={1} and mocode='{2}' and tsstatus in ('{3}','{4}')",
                                       rcard, rcardseq, mocode, TSStatus.TSStatus_Scrap, TSStatus.TSStatus_Split);
            int count = domainProvider.GetCount(new Common.Domain.SQLCondition(sql));

            if (count > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">ErrorCode</param>
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$DCT_PLEASE_INPUT_ErrorCode"));
            }
            else
            {
                if (this._currInputStep.StepType == InputStepType.ErrorCode)
                {
                    TSModelFacade tsmodelFacade = new TSModelFacade(domainProvider);
                    object        obj           = tsmodelFacade.GetErrorCode(data);

                    if (obj == null)
                    {
                        msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$ErrorCode_Not_Exist"));
                        return(msg);
                    }

                    /* 不需要检查不良代码组属于产品别
                     * if (currentProductInfo != null)
                     * {
                     *  //object[] errorcodes = tsmodelFacade.QueryECG2ECByECAndModelCode(new string[]{data}, currentProductInfo.LastSimulation.ModelCode);
                     *  object[] errorcodes = null;
                     *  string strModelCode = GetModelCodeFromProduct(currentProductInfo, this.moWillGo, domainProvider);
                     *  if (strModelCode != "")
                     *  {
                     *      errorcodes = tsmodelFacade.QueryECG2ECByECAndModelCode(new string[] { data }, strModelCode);
                     *  }
                     *
                     *  if (errorcodes == null || errorcodes.Length == 0)
                     *  {
                     *      msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$ErrorCode_Not_BelongTo_ModelCode"));
                     *      return msg;
                     *  }
                     * }
                     */
                    this._currInputStep.ErrorCode = data;
                    this._currInputStep.StepType  = InputStepType.ErrorLoc;
                    msg.Add(new UserControl.Message(UserControl.MessageType.Normal, "$CS_Please_Input_Location"));
                }
                else
                {
                    this._currInputStep.ErrorLoc = data;
                    this._currInputStep.StepType = InputStepType.ErrorCode;
                    //msg.Add(new UserControl.Message(UserControl.MessageType.Normal, "$DCT_PLEASE_INPUT_ErrorCode"));
                }
            }

            return(msg);
        }
Пример #7
0
        public Messages CheckSNRange(string moCode, string rcard, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages            msg         = new Messages();
            MORunningCardFacade rcardFacade = new MORunningCardFacade(domainProvider);

            if (rcardFacade.CheckRunningCardInRange(moCode, BenQGuru.eMES.Web.Helper.MORunningCardType.BeforeConvert, rcard) == false)
            {
                msg.Add(new Message(MessageType.Error, "$DCT_GOMO_SN_Not_In_Range"));
                return(msg);
            }
            return(msg);
        }
Пример #8
0
        public Messages CheckSNRange(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages            msg         = new Messages();
            MORunningCardFacade rcardFacade = new MORunningCardFacade(domainProvider);
            Messages            msgProduct  = mergeList["ProdcutInfo"] as Messages;
            ProductInfo         product     = (ProductInfo)msgProduct.GetData().Values[0];

            if (rcardFacade.CheckRunningCardInRange(product.LastSimulation.MOCode, MORunningCardType.AfterConvert, data) == false)
            {
                msg.Add(new Message(MessageType.Error, "$DCT_GOMO_SN_Not_In_Range"));
            }
            return(msg);
        }
Пример #9
0
        //
        private Messages DoDataCollectAction(Common.DomainDataProvider.SQLDomainDataProvider domainProvider, IDCTClient client, bool IsSameMO, int ExistIMEISeq, bool UpdateSimulation)
        {
            Messages messages = new Messages();

            ProductInfo            product = (ProductInfo)(((UserControl.Messages)mergeList["ProdcutInfo"]).GetData().Values[0]);
            ArrayList              listId  = (ArrayList)mergeList["MergeIdList"];
            SplitIDActionEventArgs args    = new SplitIDActionEventArgs(
                ActionType.DataCollectAction_Split,
                product.LastSimulation.RunningCard,
                client.LoginedUser,
                client.ResourceCode,
                product,
                (object[])listId.ToArray(),
                this.mergeIdType,
                IsSameMO,
                ExistIMEISeq,
                UpdateSimulation);

            IAction action = new BenQGuru.eMES.DataCollect.Action.ActionFactory(domainProvider).CreateAction(ActionType.DataCollectAction_Split);

            domainProvider.BeginTransaction();
            try
            {
                messages.AddMessages(action.Execute(args));

                if (messages.IsSuccess())
                {
                    domainProvider.CommitTransaction();
                    messages.Add(new UserControl.Message(MessageType.Success, "$CS_SplitID_CollectSuccess"));
                }
                else
                {
                    domainProvider.RollbackTransaction();
                }

                return(messages);
            }
            catch (Exception ex)
            {
                domainProvider.RollbackTransaction();
                messages.Add(new UserControl.Message(ex));
                return(messages);
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)domainProvider).PersistBroker.CloseConnection();
            }
        }
Пример #10
0
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_Resource_Empty"));
            }
            else
            {
                object obj = new BaseModelFacade(domainProvider).GetResource(data);

                if (obj == null)
                {
                    msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_Resource_Not_Exist"));
                }
            }

            return(msg);
        }
Пример #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">ErrorCode</param>
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$DCT_PLEASE_INPUT_ErrorCode"));
            }
            else
            {
                TSModelFacade tsmodelFacade = new TSModelFacade(domainProvider);
                object        obj           = tsmodelFacade.GetErrorCode(data);

                if (obj == null)
                {
                    msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$ErrorCode_Not_Exist"));
                }
            }

            return(msg);
        }
Пример #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">ErrorCode</param>
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$DCT_PLEASE_INPUT_ErrorCode"));
            }
            else
            {
                TSModelFacade tsmodelFacade = new TSModelFacade(domainProvider);
                object        obj           = tsmodelFacade.GetErrorCode(data);

                if (obj == null)
                {
                    msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$ErrorCode_Not_Exist"));
                    return(msg);
                }

                if (currentProductInfo != null)
                {
                    //object[] errorcodes = tsmodelFacade.QueryECG2ECByECAndModelCode(new string[]{data}, currentProductInfo.LastSimulation.ModelCode);
                    object[] errorcodes   = null;
                    string   strModelCode = GetModelCodeFromProduct(currentProductInfo, this.moWillGo, domainProvider);
                    if (strModelCode != "")
                    {
                        errorcodes = tsmodelFacade.QueryECG2ECByECAndModelCode(new string[] { data }, strModelCode);
                    }

                    if (errorcodes == null || errorcodes.Length == 0)
                    {
                        msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$ErrorCode_Not_BelongTo_ModelCode"));
                        return(msg);
                    }
                }
            }

            return(msg);
        }
Пример #13
0
        // 查询产品序列号应处的工序
        public Messages GetRunningCardOP(ProductInfo product, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages          msg         = new Messages();
            DataCollectFacade dataCollect = new DataCollectFacade(domainProvider);

            try
            {
                ItemRoute2OP op = dataCollect.GetMORouteNextOP(product.LastSimulation.MOCode, product.LastSimulation.RouteCode, product.LastSimulation.OPCode);
                if (op != null)
                {
                    msg.Add(new UserControl.Message(MessageType.Success, "$DCT_RunningCard_In_OP " + op.OPCode));
                }
                else
                {
                    msg.Add(new Message(MessageType.Error, "$CS_Route_Failed_GetNotNextOP"));
                }
            }
            catch (Exception ex)
            {
                msg.Add(new Message(ex));
            }
            return(msg);
        }
Пример #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">Keyparts</param>
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            return(msg);
        }
Пример #15
0
        /// <returns></returns>
        public Messages CheckData(string data, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages msg = new Messages();

            isSameMO         = false;
            existIMEISeq     = 0;
            updateSimulation = false;
            if (mergeList.ContainsKey("MergeIdList") == true)
            {
                ArrayList list = (ArrayList)mergeList["MergeIdList"];
                if (list.Contains(data) == true)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_Merge_ID_Exist"));
                    return(msg);
                }
            }
            ActionOnLineHelper _helper = new ActionOnLineHelper(domainProvider);

            msg = _helper.GetIDInfo(data.ToUpper());
            if (((ProductInfo)msg.GetData().Values[0]).LastSimulation != null)
            {
                if (string.Compare(this.mergeIdType, IDMergeType.IDMERGETYPE_IDMERGE, true) != 0)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_ID_Already_Exist"));                   //序列号已存在
                    return(msg);
                }

                ProductInfo newProduct = (ProductInfo)msg.GetData().Values[0];
                ProductInfo oriProduct = (ProductInfo)(((UserControl.Messages) this.mergeList["ProdcutInfo"]).GetData().Values[0]);

                /* 是序列号转换工序
                 * 转换前的rcard 和 转换后的rcard  不相同
                 * 不同, check IMEI 重复使用
                 * */
                if (string.Compare(oriProduct.LastSimulation.RunningCard, newProduct.LastSimulation.RunningCard, true) != 0)
                {
                    string bMoCode = oriProduct.LastSimulation.MOCode;
                    string aMoCode = newProduct.LastSimulation.MOCode;

                    /* 判断这个IMEI号是否报废或者拆解 */
                    bool isSpliteOrScrape = CheckIMEISpliteOrScrape(
                        domainProvider,
                        newProduct.LastSimulation.RunningCard,
                        newProduct.LastSimulation.RunningCardSequence,
                        aMoCode);
                    if (!isSpliteOrScrape)
                    {
                        /* rcard 完工,工单未关 */
                        if (newProduct.LastSimulation.IsComplete != "1" &&
                            newProduct.LastSimulation.ProductStatus != ProductStatus.OffMo)
                        {
                            msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_ID_Already_Exist"));                           //序列号已存在
                            return(msg);
                        }
                    }

                    /* 归属同一张工单 */
                    if (string.Compare(bMoCode, aMoCode, true) == 0)
                    {
                        isSameMO = true;
                    }
                    else
                    {
                        /* 归属不同工单 */
                        isSameMO = false;
                    }
                    existIMEISeq     = newProduct.LastSimulation.RunningCardSequence;
                    updateSimulation = true;
                }
                else                 /* rcard == tcard */
                {
                    isSameMO     = true;
                    existIMEISeq = newProduct.LastSimulation.RunningCardSequence;
                }
            }
            // 检查是否在工单序列号范围中
            if (mergeList != null && mergeList.ContainsKey("ProdcutInfo") == true)
            {
                if (System.Configuration.ConfigurationSettings.AppSettings["CheckRCardRange"] == "1")
                {
                    msg.AddMessages(CheckSNRange(data, domainProvider));
                }
            }
            return(msg);
        }