Пример #1
0
        private object CheckRpeat(object obj, string type)
        {
            if (obj == null)
            {
                return(null);
            }

            switch (type)
            {
            case "Model2Item":
                BenQGuru.eMES.Domain.MOModel.Model2Item model2item = obj as BenQGuru.eMES.Domain.MOModel.Model2Item;
                ModelFacade modelfacade = new ModelFacade(this.MESProvider);
                return(modelfacade.GetModel2ItemByItemCode(model2item.ItemCode));

            case "Item":
                BenQGuru.eMES.Domain.MOModel.Item item = obj as BenQGuru.eMES.Domain.MOModel.Item;
                ItemFacade itemfacade = new ItemFacade(this.MESProvider);
                return(itemfacade.GetItem(item.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID));

            case "MO":
                BenQGuru.eMES.Domain.MOModel.MO mo = obj as BenQGuru.eMES.Domain.MOModel.MO;
                MOFacade mofacade = new MOFacade(this.MESProvider);
                return(mofacade.GetMO(mo.MOCode));

            default:
                return(null);
            }
        }
Пример #2
0
        //bind 料品下拉列表
        private void BindItem(BenQGuru.eMES.Common.Domain.IDomainDataProvider provider, string model, UCLabelCombox cbx)
        {
            cbx.Clear();
            this.txtItemDesc.InnerTextBox.Text = string.Empty;
            if (provider == null || model == null || model == string.Empty)
            {
                return;
            }

            BenQGuru.eMES.MOModel.ModelFacade _facade = new BenQGuru.eMES.MOModel.ModelFacade(provider);
            object[] objs = _facade.GetModelAllItem(model);
            if (objs != null)
            {
                foreach (object obj in objs)
                {
                    BenQGuru.eMES.Domain.MOModel.Model2Item mo = obj as BenQGuru.eMES.Domain.MOModel.Model2Item;
                    if (mo != null)
                    {
                        cbx.AddItem(mo.ItemCode, mo.ItemCode);
                    }
                }
            }
        }