Example #1
0
        /// <summary>
        /// RCard Burn Out
        /// </summary>
        /// <returns></returns>
        private Messages RunBurnOut(string rcard, string shelfpk)
        {
            if (Resource == null)
            {
                BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
                Resource = (Domain.BaseSetting.Resource)dataModel.GetResource(ApplicationService.Current().ResourceCode);
            }

            Messages messages = new Messages();

            try
            {
                messages = GetProduct(rcard);
                if (messages.IsSuccess())
                {
                    product                       = (ProductInfo)messages.GetData().Values[0];
                    actionCheckStatus             = new ActionCheckStatus();
                    actionCheckStatus.ProductInfo = product;
                    if (actionCheckStatus.ProductInfo != null)
                    {
                        actionCheckStatus.ProductInfo.Resource = Resource;
                    }

                    IAction         dataCollectModule = new ActionFactory(this.DataProvider).CreateAction(ActionType.DataCollectAction_BurnOutGood);
                    ActionEventArgs actionEventArgs   = new ActionEventArgs(
                        ActionType.DataCollectAction_BurnOutGood,
                        rcard,
                        ApplicationService.Current().UserCode,
                        ApplicationService.Current().ResourceCode,
                        shelfpk,
                        product);
                    messages.AddMessages(((IActionWithStatus)dataCollectModule).Execute(
                                             actionEventArgs,
                                             actionCheckStatus));
                }

                if (messages.IsSuccess())
                {
                    messages.Add(new UserControl.Message(MessageType.Success, string.Format("$CS_BurnOutSUCCESS,$CS_Param_ID:{0}", rcard)));
                }
                return(messages);
            }
            catch (Exception e)
            {
                messages.Add(new UserControl.Message(e));
                return(messages);
            }
        }
Example #2
0
        private OQCLot CreateNewLot(ActionEventArgs actionEventArgs, Item item, DBDateTime currentDBDateTime, bool forRework, string oldLotNo)
        {
            string  lotNoMarkCode  = forRework ? "R" : "L";
            string  lotType        = forRework ? OQCLotType.OQCLotType_ReDO : OQCLotType.OQCLotType_Normal;
            string  productionType = "";
            decimal lotSize        = 0;

            OQCFacade oqcFacade       = new OQCFacade(DataProvider);
            TryFacade tryFacade       = new TryFacade(this.DataProvider);
            OQCLot    newOQCLot       = null;
            OQCLot    objLot          = null;
            DateTime  currentDateTime = FormatHelper.ToDateTime(currentDBDateTime.DBDate, currentDBDateTime.DBTime);

            object[] tryListOfRCard  = null;
            object[] tryListOfOldLot = null;

            if (forRework)
            {
                OQCLot oldLot = oqcFacade.GetOQCLot(oldLotNo, OQCFacade.Lot_Sequence_Default) as OQCLot;

                productionType = oldLot.ProductionType;
                if (productionType == ProductionType.ProductionType_Try)
                {
                    tryListOfRCard = tryFacade.GetTryListOfRCard(actionEventArgs.ProductInfo.NowSimulation.RunningCard, item.ItemCode);
                }

                //Lot Size
                lotSize = oldLot.LotCapacity;

                tryListOfOldLot = tryFacade.GetTryListOfLotNo(oldLot.LOTNO);
            }
            else
            {
                #region 先获取产品序列号对应的工单的productionType(来自于tblmo.momemo)
                // 先获取产品序列号对应的工单的productionType(来自于tblmo.momemo)
                MO mo = (new MOFacade(DataProvider)).GetMO(actionEventArgs.ProductInfo.NowSimulation.MOCode) as MO;
                SystemSettingFacade ssf = new SystemSettingFacade(this.DataProvider);
                Parameter           param;
                param = ssf.GetParameter(mo.MOType, BenQGuru.eMES.Web.Helper.MOType.GroupType) as Parameter;
                if (param != null)
                {
                    if (string.Compare(param.ParameterValue, BenQGuru.eMES.Web.Helper.MOType.MOTYPE_RMAREWORKMOTYPE, true) == 0)
                    {
                        productionType = ProductionType.ProductionType_Claim;
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(mo.MOMemo))
                        {
                            productionType = ProductionType.ProductionType_Mass;
                            mo.MOMemo      = MOProductType.MO_Product_Type_Mass.ToUpper();
                        }

                        // 根据Memo获取ProductionType
                        param = ssf.GetParameter(mo.MOMemo, MOProductType.GroupType) as Parameter;
                        //changed by hiro 08/11/10 判断param不空进行比较
                        if (param != null)
                        {
                            if (string.Compare(param.ParameterValue, MOProductType.MO_Product_Type_New, true) == 0)
                            {
                                productionType = ProductionType.ProductionType_New;
                            }
                            else if (string.Compare(param.ParameterValue, MOProductType.MO_Product_Type_Mass, true) == 0)
                            {
                                productionType = ProductionType.ProductionType_Mass;
                            }
                            else
                            {
                                throw new Exception("$Error_MOMemoNotConfig $Domain_Parameter=" + mo.MOMemo);
                            }

                            tryListOfRCard = tryFacade.GetTryListOfRCard(actionEventArgs.ProductInfo.NowSimulation.RunningCard, item.ItemCode);
                            if (tryListOfRCard != null && tryListOfRCard.Length > 0)
                            {
                                productionType = ProductionType.ProductionType_Try;
                            }
                        }
                        else
                        {
                            throw new Exception("$CS_System_Params_Losted $Domain_ParameterGroup='" + MOProductType.GroupType + "' $Domain_Parameter=" + mo.MOMemo);
                        }
                    }
                }
                else
                {
                    throw new Exception("$CS_System_Params_Losted $Domain_ParameterGroup='" + BenQGuru.eMES.Web.Helper.MOType.GroupType + "' $Domain_Parameter=" + mo.MOType);
                }
                #endregion
            }

            #region 获取ShiftDay和ShiftCode
            BaseSetting.BaseModelFacade dataModel = new BaseSetting.BaseModelFacade(this.DataProvider);
            Domain.BaseSetting.Resource res       = (Domain.BaseSetting.Resource)dataModel.GetResource(actionEventArgs.ResourceCode);
            int    shiftDay  = 0;
            string shiftCode = string.Empty;

            BaseSetting.ShiftModelFacade  shiftModel = new BaseSetting.ShiftModelFacade(this.DataProvider);
            Domain.BaseSetting.TimePeriod period     = (Domain.BaseSetting.TimePeriod)shiftModel.GetTimePeriod(res.ShiftTypeCode, currentDBDateTime.DBTime);
            if (period == null)
            {
                throw new Exception("$OutOfPerid");
            }

            shiftCode = period.ShiftCode;

            if (period.IsOverDate == Web.Helper.FormatHelper.TRUE_STRING)
            {
                if (period.TimePeriodBeginTime < period.TimePeriodEndTime)
                {
                    shiftDay = FormatHelper.TODateInt(currentDateTime.AddDays(-1));
                }
                else if (Web.Helper.FormatHelper.TOTimeInt(currentDateTime) < period.TimePeriodBeginTime)
                {
                    shiftDay = FormatHelper.TODateInt(currentDateTime.AddDays(-1));
                }
                else
                {
                    shiftDay = FormatHelper.TODateInt(currentDateTime);
                }
            }
            else
            {
                shiftDay = FormatHelper.TODateInt(currentDateTime);
            }
            #endregion

            bool needCreateNewLot  = false;
            bool needAddLotTryCode = false;

            // 获取Lot的主逻辑
            if (productionType == ProductionType.ProductionType_Try)  //试流批
            {
                object[] lotList = oqcFacade.GetLotList4TryCase(item.ItemCode, res.StepSequenceCode, lotType, productionType, lotNoMarkCode);
                if (lotList == null || lotList.Length == 0) // 找不到对应的任何试流批,则新建试流批
                {
                    needCreateNewLot  = true;
                    needAddLotTryCode = true;
                }
                else // 找到多个,则遍历每一个,找其中试流批与RCard完全一致的批,若没有则新建试流批
                {
                    object[] tryListOfLot;

                    foreach (OQCLot lotTemp in lotList)
                    {
                        tryListOfLot = tryFacade.GetTryListOfLotNo(lotTemp.LOTNO);
                        if (tryListOfRCard != null && tryListOfRCard.Length != 0 &&
                            tryListOfLot != null && tryListOfLot.Length != 0 &&
                            this.CompareTryCodeList(tryListOfRCard, tryListOfLot) == true)
                        {
                            newOQCLot = oqcFacade.GetOQCLot(lotTemp.LOTNO, lotTemp.LotSequence) as OQCLot;
                            break;
                        }
                    }

                    if (newOQCLot == null)
                    {
                        needCreateNewLot  = true;
                        needAddLotTryCode = true;
                    }
                }
            }
            else //新品批或量产批或理赔批
            {
                objLot = oqcFacade.GetMaxLot4NormalCase(item.ItemCode, res.StepSequenceCode, lotType, productionType, lotNoMarkCode);

                if (objLot == null || objLot.LOTNO == null || objLot.LOTNO == string.Empty)
                {
                    needCreateNewLot  = true;
                    needAddLotTryCode = false;
                }
                else
                {
                    newOQCLot = oqcFacade.GetOQCLot(objLot.LOTNO, OQCFacade.Lot_Sequence_Default) as OQCLot;
                }
            }

            // Added By Hi1/Venus.Feng on 20081128 for Hisense Version
            // 增加了ForRework的这个条件
            // 如果是Rework,都应该产生新的批,因为调用该函数之前,就已经by老的lot获取新的lot了,但是没有获取到
            // 才会跑到该函数中,所以在该函数中对于Rework的Case,都应该产生新的批
            // End Added
            if (needCreateNewLot || forRework)
            {
                newOQCLot = oqcFacade.CreateNewOQCLot();

                objLot = oqcFacade.GetMaxLot(res.StepSequenceCode, shiftDay, lotNoMarkCode);

                if (objLot == null || objLot.LOTNO == null || objLot.LOTNO == string.Empty)
                {
                    newOQCLot.LOTNO = res.StepSequenceCode + shiftDay.ToString() + lotNoMarkCode + "001";
                }
                else
                {
                    string oldLotNO    = objLot.LOTNO;
                    string newSequence = Convert.ToString((int.Parse(oldLotNO.Substring(oldLotNO.Length - 3, 3)) + 1));

                    newOQCLot.LOTNO = oldLotNO.Substring(0, oldLotNO.Length - 3) + newSequence.PadLeft(3, '0');
                }

                // Create New OQC Lot
                if (forRework)
                {
                    newOQCLot = oqcFacade.CreateNewOQCLot(newOQCLot.LOTNO, actionEventArgs.UserCode, currentDBDateTime,
                                                          res.OrganizationID, lotSize, res.StepSequenceCode,
                                                          item.ItemCode, oldLotNo, lotType,
                                                          productionType, res.ResourceCode, shiftDay, shiftCode);
                }
                else
                {
                    newOQCLot = oqcFacade.CreateNewOQCLot(newOQCLot.LOTNO, actionEventArgs.UserCode, currentDBDateTime,
                                                          res.OrganizationID, item.LotSize, res.StepSequenceCode,
                                                          item.ItemCode, oldLotNo, lotType,
                                                          productionType, res.ResourceCode, shiftDay, shiftCode);
                }

                oqcFacade.AddOQCLot(newOQCLot);

                if (needAddLotTryCode || forRework)
                {
                    Try2Lot try2Lot = null;
                    if (forRework)
                    {
                        if (tryListOfOldLot != null && tryListOfOldLot.Length > 0)
                        {
                            foreach (Try tempTry in tryListOfOldLot)
                            {
                                try2Lot              = tryFacade.CreateNewTry2Lot();
                                try2Lot.EAttribute1  = "";
                                try2Lot.LotNo        = newOQCLot.LOTNO;
                                try2Lot.MaintainDate = currentDBDateTime.DBDate;
                                try2Lot.MaintainTime = currentDBDateTime.DBTime;
                                try2Lot.MaintainUser = actionEventArgs.UserCode;
                                try2Lot.TryCode      = tempTry.TryCode;

                                tryFacade.AddTry2Lot(try2Lot);
                            }
                        }
                    }
                    else
                    {
                        foreach (Try tempTry in tryListOfRCard)
                        {
                            try2Lot              = tryFacade.CreateNewTry2Lot();
                            try2Lot.EAttribute1  = "";
                            try2Lot.LotNo        = newOQCLot.LOTNO;
                            try2Lot.MaintainDate = currentDBDateTime.DBDate;
                            try2Lot.MaintainTime = currentDBDateTime.DBTime;
                            try2Lot.MaintainUser = actionEventArgs.UserCode;
                            try2Lot.TryCode      = tempTry.TryCode;

                            tryFacade.AddTry2Lot(try2Lot);
                        }
                    }
                }
            }

            return(newOQCLot);
        }
Example #3
0
        /// <summary>
        /// ** 功能描述:	确认流程卡序列号的维修
        /// ** 作 者:		crystal chu
        /// ** 日 期:		2005/07/26/
        /// ** 修 改:
        /// ** 日 期:
        /// ** nunit
        /// </summary>
        /// <param name="actionEventArgs"> </param>
        /// <returns></returns>
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                //检查res在不在OPTS中
                messages.AddMessages(dataCollect.CheckResourceInOperationTS(actionEventArgs));

                //Laws Lu,2006/11/13 uniform system collect date
                DBDateTime dbDateTime;
                //Laws Lu,2006/11/13 uniform system collect date
                if (actionEventArgs.ProductInfo != null && actionEventArgs.ProductInfo.WorkDateTime != null)
                {
                    dbDateTime = actionEventArgs.ProductInfo.WorkDateTime;
                }
                else
                {
                    dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);
                    if (actionEventArgs.ProductInfo != null)
                    {
                        actionEventArgs.ProductInfo.WorkDateTime = dbDateTime;
                    }
                }

                DateTime dtNow = FormatHelper.ToDateTime(dbDateTime.DBDate, dbDateTime.DBTime);
                if (messages.IsSuccess())
                {
                    //Laws Lu,2005/09/16,修改	整理逻辑
                    TSFacade tsFacade = new TSFacade(this.DataProvider);
                    //					if( !tsFacade.IsCardInTS(actionEventArgs.RunningCard))
                    //					{
                    //						messages.Add(new Message(MessageType.Error,"$CSError_Card_Not_In_TS"));
                    //					}
                    //Laws Lu,2005/10/16,在订单1中的已经拆解的产品序列号,
                    //现在系统中可以实现将该产品序列号重新归属到另外一个订单2,
                    //但是该产品序列号在工单2采集完不良后,
                    //作送修作业时,系统提出报错信息:
                    //该产品状态为“拆解”状态。导致该产品序列号无法进行维修。
                    object obj = tsFacade.GetCardLastTSRecordInNewStatus(actionEventArgs.RunningCard);

                    if (obj == null)
                    {
                        //Laws Lu,2006,07/05 Support RMA Repair
                        //						if(actionEventArgs.IsRMA)
                        //						{
                        MOFacade moFAC  = new MOFacade(DataProvider);
                        object   objRMA = moFAC.GetRepairRMARCARDByRcard(actionEventArgs.RunningCard);
                        if (objRMA != null)
                        {
                            #region 新增维修信息

                            RMARCARD     rma = objRMA as RMARCARD;
                            Domain.TS.TS tS  = tsFacade.CreateNewTS();
                            tS.TSId = FormatHelper.GetUniqueID((rma.REWORKMOCODE == String.Empty?rma.RMABILLNO:rma.REWORKMOCODE)
                                                               , actionEventArgs.RunningCard, ActionOnLineHelper.StartSeq.ToString());

                            tS.CardType      = CardType.CardType_Product;;
                            tS.FormTime      = rma.MTIME;
                            tS.FromDate      = rma.MDATE;
                            tS.FromInputType = TSFacade.TSSource_RMA;
                            tS.FromUser      = rma.MUSER;
                            tS.FromMemo      = rma.EATTRIBUTE1;
                            //Laws Lu,2006/07/05 add support RMA
                            tS.RMABillCode = rma.RMABILLNO;
                            //工作时间和工业布局信息

                            //Laws Lu,2005/11/09,新增	记录ShiftDay
                            BaseSetting.BaseModelFacade dataModel = new BaseSetting.BaseModelFacade(this.DataProvider);
                            Domain.BaseSetting.Resource res       = (Domain.BaseSetting.Resource)dataModel.GetResource(actionEventArgs.ResourceCode);
                            //onwip.SegmentCode				= productInfo.NowSimulationReport.SegmentCode;
                            //2006/11/17,Laws Lu add get DateTime from db Server

                            BaseSetting.ShiftModelFacade  shiftModel = new BaseSetting.ShiftModelFacade(this.DataProvider);
                            Domain.BaseSetting.TimePeriod period     = (Domain.BaseSetting.TimePeriod)shiftModel.GetTimePeriod(res.ShiftTypeCode, Web.Helper.FormatHelper.TOTimeInt(dtNow));
                            if (period == null)
                            {
                                throw new Exception("$OutOfPerid");
                            }

                            if (period.IsOverDate == Web.Helper.FormatHelper.TRUE_STRING)
                            {
                                if (period.TimePeriodBeginTime < period.TimePeriodEndTime)
                                {
                                    tS.FromShiftDay = FormatHelper.TODateInt(dtNow.AddDays(-1));
                                }
                                else if (Web.Helper.FormatHelper.TOTimeInt(dtNow) < period.TimePeriodBeginTime)
                                {
                                    tS.FromShiftDay = FormatHelper.TODateInt(dtNow.AddDays(-1));
                                }
                                else
                                {
                                    tS.FromShiftDay = FormatHelper.TODateInt(dtNow);
                                }
                            }
                            else
                            {
                                tS.FromShiftDay = FormatHelper.TODateInt(dtNow);
                            }

                            tS.FromOPCode           = "TS";
                            tS.FromResourceCode     = actionEventArgs.ResourceCode;
                            tS.FromRouteCode        = String.Empty;
                            tS.FromSegmentCode      = res.SegmentCode;
                            tS.FromShiftCode        = period.ShiftCode;                     /*Laws Lu,2006/03/11 修正班次填写有误*/
                            tS.FromShiftTypeCode    = period.ShiftTypeCode;
                            tS.FromStepSequenceCode = res.StepSequenceCode;
                            tS.FromTimePeriodCode   = period.TimePeriodCode;

                            tS.ItemCode     = rma.ITEMCODE;
                            tS.MaintainDate = FormatHelper.TODateInt(dtNow);
                            tS.MaintainTime = FormatHelper.TOTimeInt(dtNow);
                            tS.MaintainUser = actionEventArgs.MaintainUser;

                            tS.MOCode              = (rma.REWORKMOCODE == String.Empty?rma.RMABILLNO:rma.REWORKMOCODE);
                            tS.ModelCode           = rma.MODELCODE;
                            tS.RunningCard         = actionEventArgs.RunningCard;
                            tS.RunningCardSequence = ActionOnLineHelper.StartSeq;
                            tS.SourceCard          = actionEventArgs.RunningCard;
                            tS.SourceCardSequence  = ActionOnLineHelper.StartSeq;
                            tS.TransactionStatus   = TSFacade.TransactionStatus_None;

                            tS.TranslateCard         = actionEventArgs.RunningCard;
                            tS.TranslateCardSequence = ActionOnLineHelper.StartSeq;
                            //tS.TSStatus = TSStatus.TSStatus_New;

                            tS.Week    = (new ReportHelper(DataProvider)).WeekOfYear(tS.FromShiftDay.ToString());
                            tS.Month   = int.Parse(tS.FromShiftDay.ToString().Substring(4, 2));
                            tS.TSTimes = ActionOnLineHelper.StartNGTimes;

                            tS.ConfirmUser         = actionEventArgs.UserCode;
                            tS.ConfirmDate         = FormatHelper.TODateInt(dtNow);
                            tS.ConfirmTime         = FormatHelper.TOTimeInt(dtNow);
                            tS.ConfirmOPCode       = "TS";
                            tS.ConfirmResourceCode = actionEventArgs.ResourceCode;
                            tS.TSStatus            = TSStatus.TSStatus_Confirm;
                            // Added by Icyer 2007/07/03
                            MO mo = (MO)moFAC.GetMO(tS.MOCode);
                            if (mo != null)
                            {
                                tS.MOSeq = mo.MOSeq;
                            }
                            // Added end

                            tsFacade.AddTS(tS);
                            //Laws Lu,2006/07/07 add ,Success release than delete rma
                            moFAC.DeleteRMARCARD(rma);
                            #endregion
                        }
                        else
                        {
                            messages.Add(new Message(MessageType.Error, "$CSError_Card_Not_In_TS_OR_Status_Error"));
                        }
                        //						}
                        //						else
                        //						{
                        //							messages.Add(new Message(MessageType.Error,"$CSError_Card_Not_In_TS_OR_Status_Error"));
                        //						}
                    }
                    else
                    {
                        BenQGuru.eMES.Domain.TS.TS ts = (BenQGuru.eMES.Domain.TS.TS)obj;

                        if (ts.TSStatus == TSStatus.TSStatus_New)
                        {
                            ts.ConfirmUser         = actionEventArgs.UserCode;
                            ts.ConfirmDate         = FormatHelper.TODateInt(dtNow);
                            ts.ConfirmTime         = FormatHelper.TOTimeInt(dtNow);
                            ts.ConfirmOPCode       = "TS";
                            ts.ConfirmResourceCode = actionEventArgs.ResourceCode;
                            ts.TSStatus            = TSStatus.TSStatus_Confirm;

                            //added by jessie lee, 2005/11/24,
                            ts.MaintainUser = actionEventArgs.MaintainUser;
                            ts.MaintainDate = FormatHelper.TODateInt(dtNow);
                            ts.MaintainTime = FormatHelper.TOTimeInt(dtNow);

                            tsFacade.UpdateTSConfirmStatus(ts);
                        }
                        else
                        {
                            messages.Add(new Message(MessageType.Error, "$CSError_Card_TSStatus_Error $Current_Status $" + ts.TSStatus));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Example #4
0
        /// <summary>
        /// 维修完成
        /// </summary>
        /// <param name="actionEventArgs"></param>
        /// <returns></returns>
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                //检查res在不在OPTS中
                // Modified By Hi1/Venus.Feng on 20080711 for Hisense Version : 对于自动作Reflow的动作来讲,不再Check Resource是否在回流的工序中
                if (((TSActionEventArgs)actionEventArgs).IgnoreResourceInOPTS != true)
                {
                    messages.AddMessages(dataCollect.CheckResourceInOperationTS(actionEventArgs));
                }
                // End Modified

                if (messages.IsSuccess())
                {
                    TSFacade tsFacade = new TSFacade(this.DataProvider);
                    //					if( !tsFacade.IsCardInTS(actionEventArgs.RunningCard))
                    //					{
                    //						messages.Add(new Message(MessageType.Error,"$CSError_Card_Not_In_TS"));
                    //					}
                    //					if(messages.IsSuccess())
                    //					{

                    //Laws Lu,2005/09/16,修改	逻辑调整P4.8
                    object obj = tsFacade.GetCardLastTSRecord(actionEventArgs.RunningCard);



                    if (obj == null)
                    {
                        messages.Add(new Message(MessageType.Error, "$CSError_Card_Not_In_TS"));
                        //messages.Add(new Message(MessageType.Error,"$CSError_Card_TSStatus_IsNot_TS"));
                    }
                    else
                    {
                        Domain.TS.TS ts = (Domain.TS.TS)obj;



                        if (ts.TSStatus == TSStatus.TSStatus_Scrap ||
                            ts.TSStatus == TSStatus.TSStatus_Split ||
                            ts.TSStatus == TSStatus.TSStatus_Reflow ||
                            ts.TSStatus == TSStatus.TSStatus_Confirm)
                        {
                            messages.Add(new Message(MessageType.Error, "$CSError_Card_TSStatus_IsNot_TS $Current_Status $" + ts.TSStatus));
                        }


                        if (messages.IsSuccess())
                        {
                            //2006/11/17,Laws Lu add get DateTime from db Server
                            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                            DateTime dtNow = FormatHelper.ToDateTime(dbDateTime.DBDate, dbDateTime.DBTime);

                            //修改 Karron Qiu,2005-9-26
                            if (ts.FromInputType == TS.TSFacade.TSSource_OnWIP)//线上.必须是回流或者报废
                            {
                                if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Complete)
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_Please_Select_Reflow_OR_Scrap"));//请选择回流或者报废
                                }
                            }
                            else if (ts.FromInputType == TS.TSFacade.TSSource_TS)//离线. 不能回流
                            {
                                if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Reflow)
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_Offline_Cannot_Reflow"));//离线不能回流
                                }
                            }
                            else if (ts.FromInputType == TS.TSFacade.TSSource_RMA)//RMA. 不能回流
                            {
                                if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Reflow)
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_RMATS_Cannot_Reflow"));//RMA不能回流
                                }
                            }



                            //Laws Lu,2005/11/09,新增	记录ShiftDay
                            BaseSetting.BaseModelFacade dataModel = new BaseSetting.BaseModelFacade(this.DataProvider);
                            Domain.BaseSetting.Resource res       = (Domain.BaseSetting.Resource)dataModel.GetResource(actionEventArgs.ResourceCode);
                            //onwip.SegmentCode				= productInfo.NowSimulationReport.SegmentCode;

                            BaseSetting.ShiftModelFacade  shiftModel = new BaseSetting.ShiftModelFacade(this.DataProvider);
                            Domain.BaseSetting.TimePeriod period     = (Domain.BaseSetting.TimePeriod)shiftModel.GetTimePeriod(res.ShiftTypeCode, Web.Helper.FormatHelper.TOTimeInt(dtNow));

                            int shiftDay = 0;
                            if (period == null)
                            {
                                throw new Exception("$OutOfPerid");
                            }

                            if (period.IsOverDate == Web.Helper.FormatHelper.TRUE_STRING)
                            {
                                if (period.TimePeriodBeginTime < period.TimePeriodEndTime)
                                {
                                    shiftDay = FormatHelper.TODateInt(dtNow.AddDays(-1));
                                }
                                else if (Web.Helper.FormatHelper.TOTimeInt(dtNow) < period.TimePeriodBeginTime)
                                {
                                    shiftDay = FormatHelper.TODateInt(dtNow.AddDays(-1));
                                }
                                else
                                {
                                    shiftDay = FormatHelper.TODateInt(dtNow);
                                }
                            }
                            else
                            {
                                shiftDay = FormatHelper.TODateInt(dtNow);
                            }

                            #region 报废
                            if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Scrap)
                            {
                                if (ts.TSStatus == TSStatus.TSStatus_TS || ts.TSStatus == TSStatus.TSStatus_Confirm)
                                {
                                    ts.TSStatus       = TSStatus.TSStatus_Scrap;
                                    ts.TSResourceCode = actionEventArgs.ResourceCode;
                                    ts.TSUser         = actionEventArgs.UserCode;

                                    ts.TSDate = shiftDay;
                                    ts.TSTime = FormatHelper.TOTimeInt(dtNow);

                                    //added by jessie lee, 2005/11/24,
                                    //新增报废原因
                                    ts.ScrapCause   = (actionEventArgs as TSActionEventArgs).ScrapCause;
                                    ts.MaintainUser = (actionEventArgs as TSActionEventArgs).MaintainUser;
                                    ts.MaintainDate = ts.TSDate;
                                    ts.MaintainTime = ts.TSTime;

                                    //TODO:Laws Lu,2005/11/09,需要优化
                                    tsFacade.UpdateTS(ts);

                                    //added by alex,2010/11/09
                                    BenQGuru.eMES.OQC.OQCFacade oqcFacade = new BenQGuru.eMES.OQC.OQCFacade(this.DataProvider);
                                    OQCLot2Card oqcLot2Card = oqcFacade.GetLastOQCLot2CardByRCard(actionEventArgs.RunningCard) as OQCLot2Card;
                                    if (oqcLot2Card != null)
                                    {
                                        oqcLot2Card.Status = "SCRAP";
                                        oqcFacade.UpdateOQCLot2Card(oqcLot2Card);
                                    }

                                    MOFacade moFAC = new MOFacade(this._domainDataProvider);

                                    if (ts.FromInputType == TSFacade.TSSource_OnWIP)
                                    {
                                        //Laws Lu,2005/08/19,新增
                                        //Laws Lu,2005/08/25,修改	处理报废时,更新工单的报废数量
                                        doAction(actionEventArgs);
                                    }
                                }
                                else
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_Card_TSStatus_IsNot_TS_OR_Confirm"));
                                }
                            }
                            #endregion

                            #region 完成
                            if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Complete)
                            {
                                if (ts.TSStatus == TSStatus.TSStatus_TS)
                                {
                                    ts.TSStatus = TSStatus.TSStatus_Complete;

                                    ts.TSTimes = 1;

                                    //added by jessie lee, 2005/11/24,
                                    ts.MaintainUser = (actionEventArgs as TSActionEventArgs).MaintainUser;
                                    ts.TSUser       = actionEventArgs.UserCode;
                                    ts.MaintainDate = FormatHelper.TODateInt(dtNow);
                                    ts.MaintainTime = FormatHelper.TOTimeInt(dtNow);
                                    //Laws Lu,2006/04/28 add 添加维修shiftday和维修resourcecode
                                    ts.TSDate         = shiftDay;
                                    ts.TSTime         = FormatHelper.TOTimeInt(dtNow);
                                    ts.TSResourceCode = actionEventArgs.ResourceCode;


                                    tsFacade.UpdateTS(ts);

                                    // Added by Icyer 2006/11/07, KeyPart维修完成
                                    if (ts.CardType == CardType.CardType_Part && ts.FromInputType == TSFacade.TSSource_TS)
                                    {
                                        DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
                                        SimulationReport  simRpt            = dataCollectFacade.GetLastSimulationReport(ts.RunningCard);
                                        if (simRpt != null && simRpt.Status == ProductStatus.NG)
                                        {
                                            simRpt.Status = ProductStatus.GOOD;
                                            dataCollectFacade.UpdateSimulationReport(simRpt);
                                        }
                                    }
                                    // Added end
                                }
                                else
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_Card_TSStatus_IsNot_TS $Current_Status $" + ts.TSStatus));
                                }
                            }
                            #endregion

                            #region 回流
                            if (((TSActionEventArgs)actionEventArgs).TSStatus == TSStatus.TSStatus_Reflow)
                            {
                                if (ts.TSStatus == TSStatus.TSStatus_TS)
                                {
                                    ts.TSStatus     = TSStatus.TSStatus_Reflow;
                                    ts.ReflowMOCode = ((TSActionEventArgs)actionEventArgs).MOCode;
                                    //ts.ReflowResourceCode = ((TSActionEventArgs)actionEventArgs).ItemCode ;
                                    ts.ReflowRouteCode = ((TSActionEventArgs)actionEventArgs).RouteCode;
                                    ts.ReflowOPCode    = ((TSActionEventArgs)actionEventArgs).OPCode;

                                    //added by jessie lee, 2005/11/24,
                                    //added by jessie lee, 2005/11/24,
                                    ts.MaintainUser = (actionEventArgs as TSActionEventArgs).MaintainUser;
                                    ts.TSUser       = actionEventArgs.UserCode;
                                    ts.MaintainDate = FormatHelper.TODateInt(dtNow);
                                    ts.MaintainTime = FormatHelper.TOTimeInt(dtNow);

                                    //Laws Lu,2006/04/28 add 添加维修shiftday和维修resourcecode
                                    ts.TSDate         = shiftDay;
                                    ts.TSTime         = FormatHelper.TOTimeInt(dtNow);
                                    ts.TSResourceCode = actionEventArgs.ResourceCode;

                                    tsFacade.UpdateTSReflowStatus(ts);
                                }
                                else
                                {
                                    messages.Add(new Message(MessageType.Error, "$CSError_Card_TSStatus_IsNot_TS $Current_Status $" + ts.TSStatus));
                                }
                            }
                            #endregion
                        }
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
Example #5
0
        private Messages SetReworkInformation(Messages messages, object[] Simulations, OQCRejectEventArgs actionEventArgs, ActionOnLineHelper dataCollect, ReworkFacade reworkFacade)
        {
            Messages newMessages = new Messages();

            BenQGuru.eMES.TS.TSFacade tsFacade = new BenQGuru.eMES.TS.TSFacade(this.DataProvider);
            DataCollectFacade         dcf      = new DataCollectFacade(this._domainDataProvider);
            //ProductInfo preProduct =null;
            int i = 0;

            ActionCheckStatus actionCheckStatus = new ActionCheckStatus();

            if (Resource == null)
            {
                BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
                Resource = (Domain.BaseSetting.Resource)dataModel.GetResource(actionEventArgs.ResourceCode);
            }

            while (i < Simulations.Length)
            {
                try
                {
                    #region 保存WIP
                    ProductInfo productionInf = dataCollect.GetIDInfoBySimulation((Simulation)Simulations[i]);

                    if (actionEventArgs.listActionCheckStatus.ContainsKey(productionInf.LastSimulation.MOCode))
                    {
                        actionCheckStatus = (ActionCheckStatus)actionEventArgs.listActionCheckStatus[productionInf.LastSimulation.MOCode];

                        actionCheckStatus.ProductInfo = productionInf;

                        actionCheckStatus.ProductInfo.Resource = Resource;

                        //					lastSimulation =  productionInf.LastSimulation;
                        actionCheckStatus.ActionList = new ArrayList();
                    }
                    else
                    {
                        //actionCheckStatus.NeedUpdateSimulation = false;
                        //actionCheckStatus.NeedFillReport = true;
                        actionEventArgs.listActionCheckStatus.Add(productionInf.LastSimulation.MOCode, actionCheckStatus);
                    }

                    OQCRejectEventArgs oqcRejectEventArgs = new OQCRejectEventArgs(
                        ActionType.DataCollectAction_OQCReject, ((Simulation)Simulations[i]).RunningCard,
                        actionEventArgs.UserCode, actionEventArgs.ResourceCode, actionEventArgs.OQCLotNO, productionInf);

                    newMessages.AddMessages(dataCollect.CheckID(oqcRejectEventArgs, actionCheckStatus));
                    //					if (preProduct != null)
                    //					{
                    //						if (dataCollect.CompareSimulationCheck(preProduct.LastSimulation,oqcRejectEventArgs.ProductInfo.LastSimulation))
                    //						{
                    //							dataCollect.CopyProduct(preProduct,oqcRejectEventArgs.ProductInfo);
                    //							dcf.WriteSimulationCheckOnlineOP(oqcRejectEventArgs.RunningCard,oqcRejectEventArgs.ActionType,oqcRejectEventArgs.ResourceCode,
                    //								oqcRejectEventArgs.UserCode,oqcRejectEventArgs.ProductInfo);
                    //							needCheck=false;
                    //						}
                    //					}
                    //					if (needCheck)
                    //						newMessages.AddMessages(dataCollect.CheckID(oqcRejectEventArgs));
                    if (!newMessages.IsSuccess())
                    {
                        return(newMessages);
                    }
                    #region TS
                    //Laws Lu,需要修改	曾经走过TS处理,没有考虑多次TS的情况,MOCode和Sequence也应该作为关键参数,
                    BenQGuru.eMES.Domain.TS.TS ts = (BenQGuru.eMES.Domain.TS.TS)tsFacade.GetCardLastTSRecord(oqcRejectEventArgs.RunningCard);
                    if (ActionType.DataCollectAction_OQCReject == oqcRejectEventArgs.ActionType &&
                        ts != null &&
                        ts.FromInputType == TS.TSFacade.TSSource_OnWIP
                        )
                    {
                        //Laws Lu,2006/07/07 修复在OQC前工序NG回流后,SN后仍然留在PK站
                        dcf.AdjustRouteOPOnline(oqcRejectEventArgs.RunningCard
                                                , ActionType.DataCollectAction_OQCReject
                                                , oqcRejectEventArgs.ResourceCode
                                                , oqcRejectEventArgs.UserCode
                                                , oqcRejectEventArgs.ProductInfo);


                        //oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = op.OPCode;

                        dcf.WriteSimulation(
                            oqcRejectEventArgs.RunningCard
                            , ActionType.DataCollectAction_OQCReject
                            , oqcRejectEventArgs.ResourceCode
                            , oqcRejectEventArgs.UserCode
                            , oqcRejectEventArgs.ProductInfo);
                    }
                    #endregion
                    //Laws Lu,2006/07/07 fix op
                    if (oqcRejectEventArgs.ProductInfo.CurrentItemRoute2OP != null)
                    {
                        oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = oqcRejectEventArgs.ProductInfo.CurrentItemRoute2OP.OPCode;
                    }
                    else
                    {
                        object objNextOP = (new BaseModelFacade(DataProvider)).GetNextOperationOfRoute(oqcRejectEventArgs.ProductInfo.LastSimulation.RouteCode, oqcRejectEventArgs.ProductInfo.LastSimulation.OPCode);
                        if (objNextOP != null)
                        {
                            oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode = (objNextOP as Operation).OPCode;
                        }
                    }

                    oqcRejectEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.Reject;
                    if (actionCheckStatus.NeedUpdateSimulation == true)
                    {
                        //把资源暂时替换成onwip需要正确资源
                        string resCode = oqcRejectEventArgs.ResourceCode;
                        oqcRejectEventArgs.ResourceCode = actionEventArgs.rightResource;
                        newMessages.AddMessages(dataCollect.Execute(oqcRejectEventArgs));
                        //转换回原来的资源
                        oqcRejectEventArgs.ResourceCode = resCode;
                    }
                    #endregion
                    if (newMessages.IsSuccess())
                    {
                        if (oqcRejectEventArgs.ProductInfo.NowSimulation == null)
                        {
                            throw new Exception("$System_Error");
                        }


                        #region reject
                        Reject reject = reworkFacade.CreateNewReject();
                        reject.ItemCode              = oqcRejectEventArgs.ProductInfo.NowSimulation.ItemCode;
                        reject.LOTNO                 = oqcRejectEventArgs.OQCLotNO;
                        reject.MaintainUser          = oqcRejectEventArgs.UserCode;
                        reject.MOCode                = oqcRejectEventArgs.ProductInfo.NowSimulation.MOCode;
                        reject.ModelCode             = oqcRejectEventArgs.ProductInfo.NowSimulation.ModelCode;
                        reject.OPCode                = oqcRejectEventArgs.ProductInfo.NowSimulation.OPCode;
                        reject.RejectDate            = oqcRejectEventArgs.ProductInfo.NowSimulation.MaintainDate;
                        reject.RejectStatus          = RejectStatus.Reject;
                        reject.RejectTime            = oqcRejectEventArgs.ProductInfo.NowSimulation.MaintainTime;
                        reject.RejectUser            = oqcRejectEventArgs.UserCode;
                        reject.ResourceCode          = oqcRejectEventArgs.ResourceCode;
                        reject.RouteCode             = oqcRejectEventArgs.ProductInfo.NowSimulation.RouteCode;
                        reject.RunningCard           = oqcRejectEventArgs.RunningCard;
                        reject.RunningCardSequence   = oqcRejectEventArgs.ProductInfo.NowSimulation.RunningCardSequence;
                        reject.SegmentCode           = oqcRejectEventArgs.ProductInfo.NowSimulationReport.SegmentCode;
                        reject.SourceCard            = oqcRejectEventArgs.ProductInfo.NowSimulation.SourceCard;
                        reject.SourceCardSequence    = oqcRejectEventArgs.ProductInfo.NowSimulation.SourceCardSequence;
                        reject.StepSequenceCode      = oqcRejectEventArgs.ProductInfo.NowSimulationReport.StepSequenceCode;
                        reject.TranslateCard         = oqcRejectEventArgs.ProductInfo.NowSimulation.TranslateCard;
                        reject.TranslateCardSequence = oqcRejectEventArgs.ProductInfo.NowSimulation.TranslateCardSequence;
                        reject.MOSeq                 = oqcRejectEventArgs.ProductInfo.NowSimulation.MOSeq; // Added by Icyer 2007/07/02
                        reworkFacade.AddReject(reject);
                        #endregion
                    }

                    //Laws Lu,2005/08/25,新增
                    //样本如果有若干个已经经过“送修确认”转为“待修”状态(或者在维修中),那么批退不可以继续
                    //TSFacade tsFacade = new TSFacade(this._domainDataProvider);
                    //Laws Lu,2005/08/25,新增	删除TS中的记录
                    //Laws Lu,2005/08/31,修改	只有FQC工序送修才能够被删除
                    if (oqcRejectEventArgs.ActionType == ActionType.DataCollectAction_OQCReject &&
                        ts != null &&
                        ts.FromInputType == TS.TSFacade.TSSource_OnWIP &&
                        ts.TSStatus == BenQGuru.eMES.Web.Helper.TSStatus.TSStatus_New)
                    {
                        if (ts.FromRouteCode == oqcRejectEventArgs.ProductInfo.LastSimulation.RouteCode &&
                            ts.FromOPCode == oqcRejectEventArgs.ProductInfo.LastSimulation.OPCode &&
                            ts.MOCode == oqcRejectEventArgs.ProductInfo.LastSimulation.MOCode &&
                            ts.RunningCardSequence == oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCardSequence &&
                            ts.RunningCard == oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCard)
                        {
                            tsFacade.DeleteCardInTS(
                                oqcRejectEventArgs.ProductInfo.LastSimulation.MOCode
                                , oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCard
                                , oqcRejectEventArgs.ProductInfo.LastSimulation.RunningCardSequence.ToString());
                        }
                    }
                }
                catch (Exception ex)
                {
                    newMessages.Add(new Message(ex));
                }

                //preProduct=oqcRejectEventArgs.ProductInfo;
                i = i + 1;
            }

            //Laws Lu,2006/03/20 填写资源报表
            //Laws Lu,2006/03/21 支持混单
            Hashtable htOutput = new Hashtable();

            foreach (Simulation sim in Simulations)
            {
                Simulation tmpSim = null;
                foreach (Simulation x in htOutput.Keys)
                {
                    if (sim.MOCode == x.MOCode)
                    {
                        tmpSim = x;
                        break;
                    }
                }
                if (tmpSim != null)
                {
                    htOutput[tmpSim] = Convert.ToInt32(htOutput[tmpSim]) + 1;
                }
                else
                {
                    htOutput.Add(sim, 1);
                }
            }


            foreach (Simulation sim in htOutput.Keys)
            {
                ProductInfo product = null;

                Messages msgs = dataCollect.GetIDInfo(sim.RunningCard);
                if (msgs.IsSuccess())
                {
                    product = msgs.GetData().Values[0] as ProductInfo;
                }
                DBDateTime dbDateTime;

                dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                //				dcf.AdjustRouteOPOnline(
                //					product.LastSimulation.RunningCard,
                //					actionEventArgs.ActionType,
                //					actionEventArgs.ResourceCode,
                //					actionEventArgs.UserCode,
                //					product);

                product.NowSimulation.MaintainUser  = actionEventArgs.UserCode;
                product.NowSimulation.MaintainDate  = dbDateTime.DBDate;
                product.NowSimulation.MaintainTime  = dbDateTime.DBTime;
                product.NowSimulation.LastAction    = actionEventArgs.ActionType;
                product.NowSimulation.ProductStatus = ProductStatus.GOOD;
                product.NowSimulation.ResourceCode  = Resource.ResourceCode;

                (new DataCollectFacade(DataProvider)).WriteSimulation(
                    product.LastSimulation.RunningCard
                    , ActionType.DataCollectAction_OQCPass
                    , actionEventArgs.ResourceCode
                    , actionEventArgs.UserCode
                    , product);


                product.NowSimulation.RouteCode = product.LastSimulation.RouteCode;
                product.NowSimulation.OPCode    = product.LastSimulation.OPCode;;

                product.NowSimulationReport = dataCollect.FillSimulationReport(product);
                //dataCollect.FillOnWip(pro);

                //newMessages.AddMessages((new ReportHelper(DataProvider)).SetReportResQuanMaster(
                //    DataProvider
                //    , actionEventArgs.ActionType
                //    , product
                //    , 0
                //    , Convert.ToInt32(htOutput[sim])
                //    , Convert.ToInt32(htOutput[sim])));
            }

            return(newMessages);
        }
Example #6
0
        private void ucBtnOK_Click(object sender, System.EventArgs e)
        {
            if (this.ucLEMOCode.Value.Trim() == string.Empty)
            {
                this.ucMessage.Add(">>$CS_Please_Input_MOCode");

                ucLEMOCode.TextFocus(false, true);
                return;
            }

            if (this.ucLERunningCard.Value.Trim() == string.Empty)
            {
                this.ucMessage.Add(">>$CS_Please_Input_RunningCard");


                return;
            }

            if (this._moCode == string.Empty)
            {
                if (!this.displayMOInfo())
                {
                    return;
                }
            }

            string runningCard = this.ucLERunningCard.Value.Trim().ToUpper();

            this.ucMessage.Add("<< " + runningCard);

            Messages messages = this._helper.GetIDInfo(runningCard);

            if (messages.IsSuccess())
            {
                ProductInfo product = (ProductInfo)messages.GetData().Values[0];

                // Added by Icyer 2005/10/28
                if (Resource == null)
                {
                    BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
                    Resource = (Domain.BaseSetting.Resource)dataModel.GetResource(ApplicationService.Current().ResourceCode);
                }
                // Added end

                ActionCheckStatus actionCheckStatus = new ActionCheckStatus();

                if (listActionCheckStatus.ContainsKey(_moCode))
                {
                    actionCheckStatus             = (ActionCheckStatus)listActionCheckStatus[_moCode];
                    actionCheckStatus.ProductInfo = null;
                    actionCheckStatus.ActionList  = new ArrayList();
                }
                else
                {
                    listActionCheckStatus.Add(_moCode, actionCheckStatus);
                }

                GoToMOActionEventArgs args = new GoToMOActionEventArgs(
                    ActionType.DataCollectAction_GoMO,
                    runningCard,
                    ApplicationService.Current().UserCode,
                    ApplicationService.Current().ResourceCode,
                    product,
                    this._moCode);

                IAction action = new ActionFactory(this.DataProvider).CreateAction(ActionType.DataCollectAction_GoMO);

                //Laws Lu,2005/10/19,新增	缓解性能问题
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
                DataProvider.BeginTransaction();
                try
                {
                    messages.AddMessages(((IActionWithStatus)action).Execute(args, actionCheckStatus));

                    if (messages.IsSuccess())
                    {
                        this.DataProvider.CommitTransaction();
                        messages.Add(new UserControl.Message(MessageType.Success, string.Format("$CS_GOMO_CollectSuccess $MOCode={0}", this._moCode)));

                        actionCheckStatus.MO.MOInputQty += actionCheckStatus.MO.IDMergeRule;


                        this.displayMOInfo();
                    }
                    else
                    {
                        this.DataProvider.RollbackTransaction();
                    }
                }
                catch (Exception ex)
                {
                    this.DataProvider.RollbackTransaction();

                    messages.Add(new UserControl.Message(ex));
                }
                finally
                {
                    //Laws Lu,2005/10/19,新增	缓解性能问题
                    ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                }
            }

            this.ucMessage.Add(messages);
            this.ucMessage.Add(">>$CS_Please_Input_RunningCard");

            this.ucLERunningCard.Value = "";
            this.ucLERunningCard.TextFocus(false, true);
        }