Beispiel #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);
            }
        }
Beispiel #2
0
 //取料器描述
 private void cbxItemCode_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (this.cbxItemCode.ComboBoxData.SelectedItem != null)
     {
         ItemFacade _facade = new ItemFacade(this.DataProvider);
         BenQGuru.eMES.Domain.MOModel.Item item = _facade.GetItem(this.cbxItemCode.ComboBoxData.SelectedItem.ToString(), GlobalVariables.CurrentOrganizations.First().OrganizationID) as BenQGuru.eMES.Domain.MOModel.Item;
         if (item != null)
         {
             this.txtItemDesc.InnerTextBox.Text = item.ItemDescription;
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// 根据工单把产品,产品别信息取出来
        /// </summary>
        private void txtMoCode_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                string mocode = this.txtMoCode.Text.Trim().ToUpper();
                if (mocode.Length == 0)
                {
                    return;
                }

                BenQGuru.eMES.MOModel.MOFacade  facade = new MOFacade(this.DataProvider);
                BenQGuru.eMES.Domain.MOModel.MO mo     = facade.GetMO(mocode) as BenQGuru.eMES.Domain.MOModel.MO;
                if (mo == null || mo.MOCode == null)
                {
                    ErrorMsg("$CS_MO_Not_Exist");
                    this.txtMoCode.Focus();
                    return;
                }

                BenQGuru.eMES.MOModel.ModelFacade  modelfacade = new ModelFacade(this.DataProvider);
                BenQGuru.eMES.Domain.MOModel.Model model       = modelfacade.GetModelByItemCode(mo.ItemCode) as BenQGuru.eMES.Domain.MOModel.Model;

                if (model == null)
                {
                    ErrorMsg("$CS_Model_Lost");
                    return;
                }
                BenQGuru.eMES.MOModel.ItemFacade  itemfacade = new ItemFacade(this.DataProvider);
                BenQGuru.eMES.Domain.MOModel.Item item       = itemfacade.GetItem(mo.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID) as BenQGuru.eMES.Domain.MOModel.Item;
                if (item == null)
                {
                    ErrorMsg("$Error_ItemCode_NotExist");
                    return;
                }

                this.cbxModel.SetSelectItem(model.ModelCode);
                this.cbxItemCode.SetSelectItem(mo.ItemCode);
                this.txtItemDesc.Value = item.ItemDescription;

                this.txtNum.Focus();
            }
        }