Exemple #1
0
        private void SetRaflowPanel(object obj)
        {
            ClearReflowPanel();
            this.ucLabEditMOCode.Value   = ((BenQGuru.eMES.Domain.TS.TS)obj).MOCode;
            this.ucLabEditItemCode.Value = ((BenQGuru.eMES.Domain.TS.TS)obj).ItemCode;
            if (((BenQGuru.eMES.Domain.TS.TS)obj).FromRouteCode != string.Empty)
            {
                this.ucLabEditRoute.Value = ((BenQGuru.eMES.Domain.TS.TS)obj).FromRouteCode;
            }
            else
            {
                TSFacade tsFacade = new TSFacade(this.DataProvider);
                BenQGuru.eMES.Domain.DataCollect.Simulation simulation = tsFacade.GetSimulation(((BenQGuru.eMES.Domain.TS.TS)obj).RunningCard, ((BenQGuru.eMES.Domain.TS.TS)obj).MOCode);
                if (simulation == null)
                {
                    Messages message = new Messages();
                    message.Add(new UserControl.Message(MessageType.Error, "$CSError_Card_HasNot_RouteCode"));
                    ApplicationRun.GetInfoForm().Add(message);
                    ClearReflowPanel();
                    this.ultraCheckEditor1.Checked = false;
                    return;
                }
                else
                {
                    this.ucLabEditRoute.Value = simulation.FromRoute;
                }
            }

            BenQGuru.eMES.MOModel.ItemFacade itemFacade = new BenQGuru.eMES.MOModel.ItemFacade(this.DataProvider);
            object[] item2Op = itemFacade.QueryItem2Operation(this.ucLabEditItemCode.Value, this.ucLabEditRoute.Value);
            if (item2Op == null)
            {
                return;
            }
            else
            {
                for (int i = 0; i < item2Op.Length; i++)
                {
                    this.ucLabComboxOPCode.AddItem(((BenQGuru.eMES.Domain.MOModel.ItemRoute2OP)item2Op[i]).OPCode, ((BenQGuru.eMES.Domain.MOModel.ItemRoute2OP)item2Op[i]).OPCode);
                }
            }
        }