Exemplo n.º 1
0
        private StateCollection CreateParserStates(CGTContent content)
        {
            rules = CreateRules(content);

            StateCollection states = new StateCollection();
            foreach (LALRStateRecord record in content.LALRStateTable)
            {
                State state = new State(record.Index);
                states.Add(state);
            }

            foreach (LALRStateRecord record in content.LALRStateTable)
            {
                State state = states[record.Index];
                foreach (ActionSubRecord subRecord in record.ActionSubRecords)
                {
                    Action action =
                        ActionFactory.CreateAction(subRecord,
                                                   states,
                                                   symbols,
                                                   rules);
                    state.Actions.Add(action);
                }

            }
            return states;
        }
Exemplo n.º 2
0
    public IEnumerable <DiffAction> CreateDiff(IEnumerable <ProjectTask> tasks)
    {
        var elements = tasks.Select(task => _elementFactory.CreateElement(task));
        var actions  = elements.Select(element => _actionFactory.CreateAction(element));

        return(actions);
    }
Exemplo n.º 3
0
        public GameSession()
        {
            // Create message log
            messageLog = new MessageLog();

            // Populate player object
            CurrentPlayer = new Player("Dom", 500, 500, 0, 1, 0);

            // Create new GUI dimensions
            gui = new GUI(100, 30);

            // Create new WorldFactory
            WorldFactory worldFactory = new WorldFactory();

            // Put it into CurrentWorld property
            CurrentWorld    = worldFactory.CreateWorld();
            CurrentLocation = CurrentWorld.GetLocation(0, 0);

            // Create new ActionFactory
            ActionFactory actionFactory = new ActionFactory();

            action       = actionFactory.CreateAction();
            battleAction = actionFactory.CreateBattleAction();


            CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(2001));
            CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(2002));
            CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(2003));
            CurrentPlayer.AddItemToInventory(ItemFactory.CreateItem(1001));

            CurrentPlayer.CurrentWeapon = CurrentPlayer.Inventory.Where(i => i.Type == Item.ItemType.Weapon).FirstOrDefault();
        }
Exemplo n.º 4
0
        private void NewAction(bool preAction)
        {
            ItemSelector selector = new ItemSelector();

            selector.Initialize(ActionFactory.GetActionList(SelectedSolution).ToList <object>(), "Action Type");
            if (selector.ShowIfMultiple() == DialogResult.OK && selector.SelectedItem != null)
            {
                BaseAction da = ActionFactory.CreateAction((BaseAction)selector.SelectedItem);
                da.Solution = SelectedSolution;
                ComponentControl ac = new ComponentControl();

                ac.Setup(da, da.Id + " - Properties");

                if (ac.ShowDialog() == DialogResult.OK)
                {
                    ac.UpdateComponent(da);

                    if (SelectedSolution != null)
                    {
                        if (preAction)
                        {
                            SelectedSolution.BuildActions.Add(da);
                            lbPreActions.Items.Add(da);
                            Package.HasUnsavedChanges = true;
                        }
                        else
                        {
                            SelectedSolution.DeployActions.Add(da);
                            lbPostActions.Items.Add(da);
                            Package.HasUnsavedChanges = true;
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
 public async Task <IActionResult> Create([Bind("Id,Name,Description,CashValue,PercentValue,CreatedDate,StartDate,EndDate,IsCanceled,CancelDate,CancelReason")] ActionModel discountAction)
 {
     if (ModelState.IsValid)
     {
         _actionFactory.CreateAction(discountAction);
         return(RedirectToAction(nameof(Index)));
     }
     return(View(discountAction));
 }
Exemplo n.º 6
0
    //To create action cell u need to create BAction,
    //then assign it to BSObject
    //and then assign BSObject to cell
    //and return list with events u created
    //examples are here
    public List <BattleCell> AddTargets()
    {
        //Creating BAction
        BAction easyTarget = actionFactory.CreateAction()
                             .AddSkillTest(
            skill: new Skills(str: 5),
            pass: "******",
            fail: "Soldier was too weak to save man");

        BAction hardTarget = actionFactory.CreateAction()
                             .AddItemTest(
            item: new Item(name: "Shovel", count: 1),
            pass: "******",
            fail: "Soldier has no shovel to help man")
                             .AddSkillTest(
            skill: new Skills(med: 1, str: 2),
            pass: "******",
            fail: "Soldier left one-leged man to die");

        BAction insaneTarget = actionFactory.CreateAction()
                               .AddItemTest(
            item: new Item("Knife", 1),
            pass: "******",
            fail: "Soldier has no items to help man")
                               .AddSkillTest(
            skill: new Skills(med: 5, str: 0),
            pass: "******",
            fail: "Soldier didn retrieves a bullet and man died with pain")
                               .AddAnotherAction((Character ch) => { Debug.Log("Sad soldier goes home"); });

        //creating BSObjects with events
        EventObject event1 = actionFactory.CreateEvent(easyTarget);
        EventObject event2 = actionFactory.CreateEvent(hardTarget);
        EventObject event3 = actionFactory.CreateEvent(insaneTarget);

        //creating EventCells with BSObjects
        return(new List <BattleCell>()
        {
            cellFactory.CreateCell(s.action, event1),
            cellFactory.CreateCell(s.action, event2),
            cellFactory.CreateCell(s.action, event3)
        });
    }
Exemplo n.º 7
0
 public override void MappingCommand()
 {
     Dictionary <IInputEventService.VertualKey, ACTION_ID> .KeyCollection keyCol = m_Dictionary.Keys;
     foreach (KeyValuePair <IInputEventService.VertualKey, ACTION_ID> kvp in m_Dictionary)
     {
         if (ServiceLocator.getInputEventSetvice().IsActive(kvp.Key))
         {
             ActionFactory sf = new ActionFactory();
             sf.CreateAction(kvp.Value);
         }
     }
 }
Exemplo n.º 8
0
        //Methods
        public new void LoadXml(XElement inputxml)
        {
            //load the xml for the base class stuff
            base.LoadXml(inputxml);
            this.ButtonText = XmlHandler.GetStringFromXElement(inputxml, "ButtonText", this.ButtonText);

            XElement x;

            x = inputxml.Element("Action");
            if (x != null)
            {
                this._action = ActionFactory.CreateAction(x);
            }

            this.IsDefault = XmlHandler.GetBoolFromXAttribute(inputxml, "IsDefault", this.IsDefault);
        }
Exemplo n.º 9
0
        private void InitActions(ActionParameter[] actionParams)
        {
            if (actionParams == null || actionParams.Length == 0)
            {
                actions = new IAction[0];
                return;
            }

            actions = new IAction[actionParams.Length];
            for (int i = 0; i < actions.Length; i++)
            {
                try { actions[i] = ActionFactory.CreateAction(actionParams[i]); }
                catch (Exception e)
                {
                    logger.Error("Error while initializing actions for button '{0}'. {1}", Id, e.Message);
                }
            }
        }
Exemplo n.º 10
0
        private void DoAction(string rcard, string sourceCard)
        {
            Messages messages = new Messages();

            ActionOnLineHelper actionOnLineHelper = new ActionOnLineHelper(this.DataProvider);
            ActionFactory      actionFactory      = new ActionFactory(this.DataProvider);
            IAction            actionCartonPack   = actionFactory.CreateAction(ActionType.DataCollectAction_Carton);

            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            DataProvider.BeginTransaction();
            try
            {
                messages.AddMessages(AddSingleIDIntoCartonAndTry(sourceCard, messages, actionCartonPack, actionOnLineHelper));
                if (!messages.IsSuccess())
                {
                    this.DataProvider.RollbackTransaction();
                    InitMessage("", false, 0, rcard, false);
                }
                else
                {
                    this.DataProvider.CommitTransaction();
                    InitMessage("", false, 0, rcard, true);
                }
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                ApplicationRun.GetInfoForm().AddEx(ex.Message);
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                ApplicationRun.GetInfoForm().AddEx(this._FunctionName, "" + this.ucLabelRCardForCarton.Value, messages, false);
                if (!messages.IsSuccess())
                {
                    this.ucLabelRCardForCarton.TextFocus(false, true);
                }
            }
            //if (messages.IsSuccess())
            //{
            //    RefreshCartonNumber();
            //}
        }
Exemplo n.º 11
0
        private void ucButton2_Click(object sender, EventArgs e)
        {
            Messages messages = new Messages();

            if (rCardEditor.Text.Trim() == String.Empty)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CSError_RCard_CanNot_Empty"));
                ApplicationRun.GetInfoForm().Add(messages);
                return;
            }

            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
            string            sourceRCard       = dataCollectFacade.GetSourceCard(rCardEditor.Text.Trim().ToUpper(), string.Empty);

            string tsStatus;
            //Laws Lu,2005/11/22,新增	添加代理录入人员
            //modified by jessie lee, 2005/11/24
            string userCode = ApplicationService.Current().UserCode;

            if (txtAgentUser.Checked == true && txtAgentUser.Value.Trim().Length == 0)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CS_Error_Vicegerent_CanNot_Empty"));
                ApplicationRun.GetInfoForm().Add(messages);
                return;
            }
            else if (txtAgentUser.Checked == true && txtAgentUser.Value != String.Empty)
            {
                if ((new BenQGuru.eMES.Security.SecurityFacade(this.DataProvider)).CheckResourceRight(txtAgentUser.Value.Trim().ToUpper()
                                                                                                      , ApplicationService.Current().ResourceCode))
                {
                    userCode = txtAgentUser.Value;
                }
                else
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$CS_Error_Vicegerent_Is_Wrong"));
                    ApplicationRun.GetInfoForm().Add(messages);
                    return;
                }
            }

            if (ultraCheckEditor1.Checked == true)
            {
                tsStatus = TSStatus.TSStatus_Reflow;

                //勾选回流,然后不工位栏位未选资料也可允许通过。在业务上回流是一定有确定的工位的。
                //系统要检查此时保存,工位是否为空。
                if (ucLabComboxOPCode.SelectedItemText == string.Empty)
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$CS_Error_ReflowOPCode_CanNot_Empty"));
                    ApplicationRun.GetInfoForm().Add(messages);
                    ucLabComboxOPCode.Focus();
                    return;
                }
            }
            else if (ultraCheckEditorScrap.Checked == true)
            {
                tsStatus = TSStatus.TSStatus_Scrap;
            }
            else
            {
                tsStatus = TSStatus.TSStatus_Complete;
//				//修改,Karron Qiu 2005-9-23
//				//线上采集的不良品,修复后则“回流”;修不好则“报废”。而不选“回流”或“报废”代表该产品要入了良品库,
//				//线上的不良品修好后是直接回产线回流,不需要入良品库的
//				messages.Add(new UserControl.Message(MessageType.Error,"$CSError_Please_Select_Reflow_OR_Scrap"));//请选择回流或者报废
//				ApplicationRun.GetInfoForm().Add(messages);
//				return;
            }

            ActionFactory     actionFactory    = new ActionFactory(this.DataProvider);
            IAction           actionTSComplete = actionFactory.CreateAction(ActionType.DataCollectAction_TSComplete);
            TSActionEventArgs actionEventArgs  = new TSActionEventArgs(
                ActionType.DataCollectAction_TSComplete,
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(sourceRCard)),
                userCode,
                ApplicationService.Current().ResourceCode,
                tsStatus,
                this.ucLabEditMOCode.Value,
                this.ucLabEditItemCode.Value,
                this.ucLabEditRoute.Value,
                this.ucLabComboxOPCode.SelectedItemText,
                ApplicationService.Current().UserCode,
                FormatHelper.CleanString(this.txtScrapCause.Text, 100));

            //修改 Karron Qiu 2005-9-26
            //在做维修完成处理时,依然按照之前的检查逻辑
            //(不良品是否“已选不良零件”或“已选不良位置”有信息),如果没有,则弹出提示信息,
            //比如:“该不良品无“不良零件”或“不良位置”信息,是否要维修完成”,
            //点击“确认”即维修完成,点击“取消”则维修完成失败

            TSFacade tsFacade = new TSFacade(this.DataProvider);
            object   obj      = tsFacade.GetCardLastTSRecord(actionEventArgs.RunningCard);

            if (obj == null)
            {
                messages.Add(new UserControl.Message(MessageType.Error, "$CSError_Card_Not_In_TS"));
                ApplicationRun.GetInfoForm().Add(messages);
                return;
            }
            else
            {
                Domain.TS.TS ts = (Domain.TS.TS)obj;
                if (tsFacade.CheckErrorCodeCountAndErrorSolutionForTSComplete(actionEventArgs.RunningCard))
                {
                    if (!tsFacade.CheckErrorPartAndErrorLocationForTSComplete(actionEventArgs.RunningCard))
                    {
                        if (System.Windows.Forms.MessageBox.Show(null, MutiLanguages.ParserString("$CS_No_ErrorPartAndLoc_Is_Com"), "", System.Windows.Forms.MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                        {
                            return;
                        }
                    }
                }
                else
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$CSError_Card_TSStatus_IsNot_TS $Current_Status $" + ts.TSStatus));
                    ApplicationRun.GetInfoForm().Add(messages);
                    return;
                }
            }
            //karron qiu ,2005/9/16 ,增加try catch,在catch中添加rollback操作
            DataProvider.BeginTransaction();
            try
            {
                messages.AddMessages(actionTSComplete.Execute(actionEventArgs));
                if (!messages.IsSuccess())
                {
                    this.DataProvider.RollbackTransaction();
                    ApplicationRun.GetInfoForm().Add(messages);
                }
                else
                {
                    this.DataProvider.CommitTransaction();
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Success, "$CS_TSScrap_SUCCESS"));
                }
            }
            catch
            {
                this.DataProvider.RollbackTransaction();
                throw;
            }
            finally
            {
                (DataProvider as SQLDomainDataProvider).PersistBroker.CloseConnection();
            }
        }
Exemplo n.º 12
0
        //对批通过和批判退的处理
        private void LotOPerate(string lotStatus, bool isForce)
        {
            Messages msg      = new Messages();
            bool     isFrozen = false;

            string        oqcLotNo      = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.ucLabelEditLotNo.Value));
            ActionFactory actionFactory = new ActionFactory(this.DataProvider);
            OQCFacade     oqcFacade     = new OQCFacade(this.DataProvider);

            //获取OQCLot以及逻辑检查
            object obj = null;

            msg.AddMessages(GetOQCLotToOperate(oqcFacade, oqcLotNo, out obj));
            if (!msg.IsSuccess())
            {
                ApplicationRun.GetInfoForm().Add(msg);
                this.ucLabelEditLotNo.TextFocus(false, true);
                return;
            }

            //其他检查
            if (lotStatus == OQCLotStatus.OQCLotStatus_Reject)
            {
                if (this.ucLabelEditStatusMemo.Value.Trim().Length == 0)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$CS_PleaseInputMemo"));
                    ApplicationRun.GetInfoForm().Add(msg);
                    this.ucLabelEditStatusMemo.TextFocus(false, true);
                    return;
                }
            }
            string msgInfo = String.Empty;

            if (lotStatus == OQCLotStatus.OQCLotStatus_Pass)
            {
                if (isForce)
                {
                    msgInfo = UserControl.MutiLanguages.ParserMessage("$CS_CONFIRM_ForcePassLot");
                }
                else
                {
                    msgInfo = UserControl.MutiLanguages.ParserMessage("$CS_CONFIRM_LOT_PASS");
                }
            }
            else
            {
                if (isForce)
                {
                    msgInfo = UserControl.MutiLanguages.ParserMessage("$CS_CONFIRM_ForceRejectLot");
                }
                else
                {
                    msgInfo = UserControl.MutiLanguages.ParserMessage("$CS_CONFIRM_LOT_RJECT");
                }
            }

            frmDialog dialog = new frmDialog();

            dialog.Text          = this.Text;
            dialog.DialogMessage = msgInfo;

            if (DialogResult.OK != dialog.ShowDialog(this))
            {
                return;
            }

            //add by roger xue  2008/10/27
            OQCLot objFrozen = obj as OQCLot;

            if (objFrozen.FrozenStatus == FrozenStatus.STATUS_FRONZEN)
            {
                isFrozen = true;
                FFrozenReason frozenReason = new FFrozenReason();
                string        reason       = this.ucLabelEditStatusMemo.Value.Trim();
                if (reason.Length == 0)
                {
                    if (lotStatus == OQCLotStatus.OQCLotStatus_Reject)
                    {
                        reason = "批判退";
                    }
                    else
                    {
                        reason = "批判过";
                    }
                }
                frozenReason.Reason = reason;
                frozenReason.Event += new ParentChildRelateEventHandler <ParentChildRelateEventArgs <string> >(Form_Event);
                if (DialogResult.Cancel == frozenReason.ShowDialog(this))
                {
                    return;
                }
            }

            //end add

            // 输入用户名、密码确认 add by alex.hu 2010/11/19
            if (isForce)
            {
                string       strMsg       = UserControl.MutiLanguages.ParserString("$SMT_UnLoadAll_Confirm_UserCode");
                FDialogInput finput       = new FDialogInput(strMsg);
                DialogResult dialogResult = finput.ShowDialog();
                if (dialogResult != DialogResult.OK)
                {
                    return;
                }
                string strUserCode = finput.InputText.Trim().ToUpper();
                strMsg = UserControl.MutiLanguages.ParserString("$Please_Input_Password");
                finput = new FDialogInput(strMsg);
                finput.InputPasswordChar = '*';
                dialogResult             = finput.ShowDialog();
                if (dialogResult != DialogResult.OK)
                {
                    return;
                }
                string strPassword = finput.InputText.Trim().ToUpper();
                finput.Close();
                BenQGuru.eMES.Security.SecurityFacade security = new BenQGuru.eMES.Security.SecurityFacade(this.DataProvider);
                try
                {
                    object objSec = security.PasswordCheck(strUserCode, strPassword);

                    if (lotStatus == OQCLotStatus.OQCLotStatus_Pass && !security.IsBelongToAdminGroup(strUserCode) && !security.CheckAccessRight(strUserCode, "OQCFORCEPASS"))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_No_Access_Right"));
                        return;
                    }

                    if (lotStatus == OQCLotStatus.OQCLotStatus_Reject && !security.IsBelongToAdminGroup(strUserCode) && !security.CheckAccessRight(strUserCode, "OQCFORCEREJECT"))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_No_Access_Right"));
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Messages msgErr = new Messages();
                    msgErr.Add(new UserControl.Message(ex));
                    ApplicationRun.GetInfoForm().Add(msgErr);
                    Application.DoEvents();
                    return;
                }
            }
            //end add

            //把lotcapacity更新成lotsise一样大小,防止此时有产品在产生工序进入批而产生批判定时整个批无法全部完工的并发问题 by hiro
            Decimal reallyLotCapacity = ((OQCLot)obj).LotCapacity;

            this.DataProvider.BeginTransaction();
            try
            {
                //lock该lot,防止同时对该lot操作产生死锁
                oqcFacade.LockOQCLotByLotNO(oqcLotNo);
                //end

                oqcFacade.UpdateOQCLotCapacity(((OQCLot)obj).LOTNO, ((OQCLot)obj).LotSize);

                this.DataProvider.CommitTransaction();
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                msg.Add(new UserControl.Message(ex));
                ApplicationRun.GetInfoForm().Add(msg);
            }

            if (!msg.IsSuccess())
            {
                return;
            }
            //end add

            //缓解性能问题
            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = false;
            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            DataProvider.BeginTransaction();
            try
            {
                //lock该lot,防止同时对该lot操作产生死锁
                oqcFacade.LockOQCLotByLotNO(oqcLotNo);

                //
                msg.AddMessages(GetOQCLotToOperate(oqcFacade, oqcLotNo, out obj));
                if (!msg.IsSuccess())
                {
                    return;
                }

                #region 业务逻辑
                ActionOnLineHelper actinOnlineHelper = new ActionOnLineHelper(this.DataProvider);

                object[] objs = (new ActionOQCHelper(this.DataProvider)).QueryCardOfLot(FormatHelper.PKCapitalFormat(oqcLotNo), OQCFacade.Lot_Sequence_Default);
                if (objs == null)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$CS_LOT_NOT_EXIST"));
                    return;
                }

                // Added By Hi1/Venus.Feng on 20081111 for Hisense : 根据产生批的资源获取该资源对应的大线的最后一个工序的资源(取一个)
                //string rightResource = (new BaseModelFacade(this.DataProvider)).GetRightResourceForOQCOperate(objFrozen.ResourceCode,
                //            (objs[0] as Simulation).ItemCode, (objs[0] as Simulation).RouteCode);
                //if (string.IsNullOrEmpty(rightResource))
                //{
                //    msg.Add(new UserControl.Message(MessageType.Error, "$Error_NoBigLineFQCResource"));
                //    return;
                //}
                string rightResource = ApplicationService.Current().ResourceCode;
                // End Added

                //对批通过的处理
                if (lotStatus == OQCLotStatus.OQCLotStatus_Pass)
                {
                    IAction actionPass = actionFactory.CreateAction(ActionType.DataCollectAction_OQCPass);

                    OQCPASSEventArgs actionEventArgs = new OQCPASSEventArgs(ActionType.DataCollectAction_OQCPass, ((Domain.DataCollect.Simulation)objs[0]).RunningCard, ApplicationService.Current().
                                                                            UserCode, rightResource, oqcLotNo, null);

                    actionEventArgs.Lot         = obj;
                    actionEventArgs.CardOfLot   = objs;
                    actionEventArgs.IsForcePass = isForce;
                    actionEventArgs.Memo        = FormatHelper.CleanString(this.ucLabelEditStatusMemo.Value.Trim(), 100);

                    //frozen operate
                    actionEventArgs.IsUnFrozen     = isFrozen;
                    actionEventArgs.UnFrozenReason = this.frozenReason;

                    msg.AddMessages(actionPass.Execute(actionEventArgs));
                    if (msg.IsSuccess())
                    {
                        msg.Add(new UserControl.Message(MessageType.Success, "$CS_OQCPASSSUCCESS"));
                    }
                }

                //对批判退的处理
                if (lotStatus == OQCLotStatus.OQCLotStatus_Reject)
                {
                    IAction actionReject = actionFactory.CreateAction(ActionType.DataCollectAction_OQCReject);

                    OQCRejectEventArgs actionEventArgs = new OQCRejectEventArgs(ActionType.DataCollectAction_OQCReject, ((Domain.DataCollect.Simulation)objs[0]).RunningCard, ApplicationService.Current().
                                                                                UserCode, ApplicationService.Current().ResourceCode, oqcLotNo, null);

                    actionEventArgs.Lot                       = obj;
                    actionEventArgs.CardOfLot                 = objs;
                    actionEventArgs.IsForceReject             = isForce;
                    actionEventArgs.IsAutoGenerateReworkSheet = this.chkBoxAutoGenerate.Checked;
                    actionEventArgs.IsCreateNewLot            = this.checkBoxAutoLot.Checked;
                    actionEventArgs.Memo                      = FormatHelper.CleanString(this.ucLabelEditStatusMemo.Value.Trim(), 100);

                    //frozen operate
                    actionEventArgs.IsUnFrozen     = isFrozen;
                    actionEventArgs.UnFrozenReason = frozenReason;
                    actionEventArgs.rightResource  = rightResource;

                    msg.AddMessages(actionReject.Execute(actionEventArgs));

                    if (msg.IsSuccess())
                    {
                        msg.Add(new UserControl.Message(MessageType.Success, "$CS_OQCREJECTSUCCESS"));
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                msg.Add(new UserControl.Message(ex));
            }
            finally
            {
                ApplicationRun.GetInfoForm().Add(msg);

                if (!msg.IsSuccess())
                {
                    this.DataProvider.RollbackTransaction();
                    this.DataProvider.BeginTransaction();
                }

                obj = oqcFacade.GetOQCLot(((OQCLot)obj).LOTNO, ((OQCLot)obj).LotSequence);
                if (obj != null)
                {
                    oqcFacade.UpdateOQCLotCapacity(((OQCLot)obj).LOTNO, reallyLotCapacity);
                }

                this.DataProvider.CommitTransaction();

                this.ucLabelEditLotNo.TextFocus(false, true);

                //缓解性能问题
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = false;
            }
        }