Beispiel #1
0
 //获取所有的Model(产品别)
 private object[] GetModels()
 {
     if (_modelFacade == null)
     {
         _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
     }
     return(this._modelFacade.QueryModels(""));
 }
Beispiel #2
0
        private string[] GetCellIMEIString(string modelCode, string barCodeString)
        {
            string      tmpBarCodeString = barCodeString;
            string      tmpString        = string.Empty;
            string      aModelCode       = string.Empty;
            ArrayList   arrayList        = new ArrayList();
            ModelFacade _modelFacade     = new ModelFacade(DataProvider);

            while (tmpBarCodeString.Length >= ID_CELL_LENGTH)
            {
                tmpString  = tmpBarCodeString.Substring(0, ID_CELL_LENGTH);
                aModelCode = tmpString.Substring(0, AMODELCODE_LENGTH);
                object barCodeRule = _modelFacade.GetBarcodeRule(modelCode, aModelCode);
                if (barCodeRule == null)
                {
                    ExceptionManager.Raise(this.GetType().BaseType, "$Error_BarCodeRule_NotMaintain", String.Format("[$ModelCode='{0}',$aModelCode='{1}']", modelCode, aModelCode));
                }
                arrayList.Add(((BarcodeRule)barCodeRule).Description + tmpString.Substring(AMODELCODE_LENGTH, ID_CELL_LENGTH - AMODELCODE_LENGTH));
                tmpBarCodeString = tmpBarCodeString.Substring(ID_CELL_LENGTH, tmpBarCodeString.Length - ID_CELL_LENGTH);
            }
            return((string[])arrayList.ToArray(typeof(string)));
        }
Beispiel #3
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);
                    }
                }
            }
        }
Beispiel #4
0
        private void SetEditObject(object obj)
        {
            if (_modelFacade == null)
            {
                _modelFacade = new FacadeFactory(base.DataProvider).CreateModelFacade();
            }
            if (obj == null)
            {
                this.txtItemCodeEdit.Text          = string.Empty;
                this.txtItemDescEdit.Text          = string.Empty;
                this.drpItemTypeEdit.SelectedIndex = 0;
                this.txtItemNameEdit.Text          = string.Empty;
                //				this.txtItemVersionEdit.Text=string.Empty;
                this.txtItemUOMEdit.Text        = string.Empty;
                this.txtConfig.Text             = string.Empty;
                this.txtVolumnEdit.Text         = String.Empty;
                this.txtCartonQty.Text          = String.Empty;
                this.txtMaxElectricCurrent.Text = "0";
                this.txtMinElectricCurrent.Text = "0";
                txtVolumnEdit.Text = "0";
                this.DropDownListOrg.SelectedIndex       = 0;
                this.txtOPCodeEdit.Text                  = "";
                this.txtLotSizeEdit.Text                 = "";
                this.txtPcbAcountEdit.Text               = "";
                this.TextboxItemProductCodeEdit.Text     = "";
                this.CheckboxNeedCheckCartonEdit.Checked = false;
                this.CheckboxNeedCheckComApp.Checked     = false;
                txtPcbAcountEdit.Text           = "1";
                this.txtBurnUseMinutesEdit.Text = "0";
                return;
            }

            this.txtItemCodeEdit.Text = ((Item)obj).ItemCode.ToString();
            this.txtItemDescEdit.Text = ((Item)obj).ItemDescription.ToString();
            try
            {
                this.drpItemTypeEdit.SelectedValue = ((Item)obj).ItemType.ToString();
            }
            catch
            {
                this.drpItemTypeEdit.SelectedIndex = 0;
            }
            this.txtItemNameEdit.Text = ((Item)obj).ItemName.ToString();
            //			this.txtItemVersionEdit.Text	= ((Item)obj).ItemVersion.ToString();
            this.txtItemUOMEdit.Text = ((Item)obj).ItemUOM.ToString();
            this.txtVolumnEdit.Text  = ((Item)obj).ItemBurnInQty.ToString("##.##");
            this.txtCartonQty.Text   = ((Item)obj).ItemCartonQty.ToString("##.##");
            this.txtConfig.Text      = ((Item)obj).ItemConfigration;

            this.TextboxItemProductCodeEdit.Text     = ((Item)obj).ItemProductCode;
            this.CheckboxNeedCheckCartonEdit.Checked = (((Item)obj).NeedCheckCarton == FormatHelper.TRUE_STRING);
            this.CheckboxNeedCheckComApp.Checked     = (((Item)obj).NeedCheckAccessory == FormatHelper.TRUE_STRING);

            this.txtMaxElectricCurrent.Text = ((Item)obj).ElectricCurrentMaxValue.ToString();
            this.txtMinElectricCurrent.Text = ((Item)obj).ElectricCurrentMinValue.ToString();
            //Add by Terry  2010-10-29
            this.txtPcbAcountEdit.Text = ((Item)obj).PcbaCount.ToString();
            try
            {
                this.DropDownListOrg.SelectedValue = ((Item)obj).OrganizationID.ToString();
            }
            catch
            {
                this.DropDownListOrg.SelectedIndex = 0;
            }

            object[] oldItems = this._modelFacade.GetModel2ItemByItemCode(this.txtItemCodeEdit.Text);
            if (oldItems != null && oldItems.Length > 0)
            {
                this.drpModelEdit.SelectedValue = ((Model2Item)oldItems[0]).ModelCode;
            }
            MOFacade moFacade = new MOFacade(base.DataProvider);

            if (moFacade.CheckItemCodeUsed(((Item)obj).ItemCode))
            {
                setDropDownListEnabled(false);
            }
            else
            {
                setDropDownListEnabled(true);
            }
            this.txtOPCodeEdit.Text         = ((Item)obj).CheckItemOP;
            this.txtLotSizeEdit.Text        = ((Item)obj).LotSize.ToString();
            this.txtBurnUseMinutesEdit.Text = ((Item)obj).BurnUseMinutes.ToString();
        }