Exemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.InitOnPostBack();

            if (!IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                // 初始化界面UI
                this.InitUI();
                this.InitButtonHelp();
                this.SetEditObject(null);
                this.InitWebGrid();

                // 初始化控件
                IInternalSystemVariable IInternalSystemVariableNew = new IQCCheckStatus();
                IInternalSystemVariableNew.Items.Remove(IQCCheckStatus.IQCCheckStatus_WaitCheck);
                RadioButtonListBuilder builder1 = new RadioButtonListBuilder(IInternalSystemVariableNew, this.rblCheckResult, this.languageComponent1);
                builder1.Build();
                this.rblCheckResult.SelectedIndex = 0;
            }

            _MOFacade = new MOFacade(base.DataProvider);
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        private void edtMoCode_TxtboxKeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                string moCode = FormatHelper.CleanString(this.edtMoCode.Value.Trim().ToUpper());
                if (moCode == string.Empty)
                {
                    this.edtMoCode.TextFocus(true, true);
                    return;
                }

                MOFacade          moFacade = new MOFacade(this.DataProvider);
                Domain.MOModel.MO mo       = (Domain.MOModel.MO)moFacade.GetMO(moCode);

                if (mo == null)
                {
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_MO_Not_Exist $CS_Param_MOCode:" + moCode));
                    this.edtMoCode.TextFocus(false, true);
                    return;
                }

                this.edtitemDesc.Value  = mo.MaterialDescription.Trim();
                this.edtMoPlanQty.Value = Convert.ToString(Convert.ToInt32(mo.MOPlanQty - mo.MOActualQty));
                this.edtMoPlanQty.TextFocus(false, true);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 通过察看有没有在工单选择该route如果有则不能删除
        /// 没有则可以删除,删除也删除对应copy途程的详细的信息
        /// </summary>
        /// <param name="model2Route"></param>
        private void DeleteModelRoute(Model2Route model2Route)
        {
            if (model2Route == null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Null_Paramter");
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(ModelFacade),String.Format(ErrorCenter.ERROR_ARGUMENT_NULL,"model2Route")));
            }
            MOFacade _moFacade = new MOFacade(this.DataProvider);

            if (_moFacade.IsModelRouteUsed(model2Route.RouteCode))
            {
                ExceptionManager.Raise(this.GetType(), "$Error_ModelRoute_Used", String.Format("[$ModelCode='{0}']", model2Route.ModelCode), null);
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(ModelFacade),string.Format(ErrorCenter.ERROR_MODELROUTEUSED,model2Route.ModelCode,model2Route.RouteCode)));
            }
            try
            {
                object[] modelOperations = GetModel2Operations(model2Route);
                for (int i = 0; i < modelOperations.Length; i++)
                {
                    this.DataProvider.Delete(modelOperations[i]);
                }
                this.DataProvider.Delete(model2Route);
            }
            catch (Exception ex)
            {
                //_log.Error(ex.Message);
                ExceptionManager.Raise(this.GetType(), "$Error_DeleteModelRoute_Failure", String.Format("[$ModelCode='{0}',$RouteCode='{1}']", model2Route.ModelCode, model2Route.RouteCode), ex);
                //				throw new RemotingException(ErrorCenter.GetErrorServerDescription(typeof(ModelFacade),String.Format(ErrorCenter.ERROR_DELETEMODELROUTE,model2Route.ModelCode,model2Route.RouteCode)),ex);
            }
        }
Exemplo n.º 5
0
        //add by roger.xue
        private void AddDefaultRoute(GridRecord row)
        {
            MOFacade moFacade = new MOFacade(this.DataProvider);
            DefaultItem2Route defroute = (DefaultItem2Route)moFacade.GetDefaultItem2Route(ItemCode);
            // 如果有选择默认途程
            if (row.Items.FindItemByKey("DefaultItemRoute").Value.ToString().ToLower() == "true")
            {
                if (defroute == null || defroute.RouteCode != row.Items.FindItemByKey("RouteCode").Value.ToString())
                {
                    bool bIsNew = false;
                    if (defroute == null)
                    {
                        defroute = new DefaultItem2Route();
                        bIsNew = true;
                    }
                    defroute.ItemCode = ItemCode;
                    defroute.RouteCode = row.Items.FindItemByKey("RouteCode").Value.ToString();
                    defroute.MDate = FormatHelper.TODateInt(DateTime.Now);
                    defroute.MTime = FormatHelper.TOTimeInt(DateTime.Now);
                    if (bIsNew == true)
                        moFacade.AddDefaultItem2Route(defroute);
                    else
                        moFacade.UpdateDefaultItem2Route(defroute);
                }
            }
            else if (row.Items.FindItemByKey("DefaultItemRoute").Value.ToString().ToLower() == "false" &&
                defroute != null && defroute.RouteCode == row.Items.FindItemByKey("RouteCode").Value.ToString())
            {

                moFacade.DeleteDefaultItem2Route(defroute);

            }
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data">工单代码</param>
        /// <returns></returns>
        public Messages CheckData(string data)
        {
            Messages msg = new Messages();

            if (data == string.Empty)
            {
                msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_MO_Empty"));
            }
            else
            {
                object obj = new MOFacade(Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider()).GetMO(data);

                if (obj == null)
                {
                    msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_MO_Not_Exist"));
                }
                else
                {
                    if ((((MO)obj).MOStatus != Web.Helper.MOManufactureStatus.MOSTATUS_RELEASE) &&
                        (((MO)obj).MOStatus != Web.Helper.MOManufactureStatus.MOSTATUS_OPEN))
                    {
                        msg.Add(new UserControl.Message(UserControl.MessageType.Error, "$Error_CS_MO_Should_be_Release_or_Open2"));
                    }
                }
            }

            return(msg);
        }
Exemplo n.º 7
0
        //add by hiro 08/11/05 检查序列号内容为字母,数字和空格
        public Messages CheckSNContent(string moCode, string rcard, Common.DomainDataProvider.SQLDomainDataProvider domainProvider)
        {
            Messages   msg        = new Messages();
            MOFacade   mofcade    = new MOFacade(domainProvider);
            ItemFacade itemfacade = new ItemFacade(domainProvider);
            object     objMo      = mofcade.GetMO(moCode);

            if (objMo == null)
            {
                return(msg);
            }
            string itemCode       = ((MO)objMo).ItemCode.ToString();
            object objItemSNcheck = itemfacade.GetItem2SNCheck(itemCode, ItemCheckType.ItemCheckType_SERIAL);

            if (objItemSNcheck == null)
            {
                return(msg);
            }
            if (((Item2SNCheck)objItemSNcheck).SNContentCheck == SNContentCheckStatus.SNContentCheckStatus_Need)
            {
                string pattern = @"^([A-Za-z0-9]+[ ]*)*[A-Za-z0-9]+$";
                Regex  rex     = new Regex(pattern, RegexOptions.IgnoreCase);
                Match  match   = rex.Match(rcard);
                if (!match.Success)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$CS_SNContent_CheckWrong $CS_Param_RunSeq:" + rcard.Trim()));
                    return(msg);
                }
            }
            return(msg);
        }
Exemplo n.º 8
0
        // Added by Icyer 2006/12/15
        // 检查工单
        private Messages CheckMO(object act)
        {
            Messages msgs = new Messages();

            BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider domainProvider = null;
            if ((act as IDCTClient).DBConnection != null)
            {
                domainProvider = (act as IDCTClient).DBConnection as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider;
            }
            else
            {
                domainProvider = Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider()
                                 as BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider;
                (act as IDCTClient).DBConnection = domainProvider;
            }

            MOFacade moFacade = new MOFacade(domainProvider);
            MO       mo       = (MO)moFacade.GetMO(act.ToString().ToUpper());

            if (mo == null)
            {
                msgs.Add(new UserControl.Message(MessageType.Error, "$CS_MO_NOT_EXIST"));
                ProcessBeforeReturn(this.Status, msgs);
                return(msgs);
            }
            if (mo.MOStatus != BenQGuru.eMES.Web.Helper.MOManufactureStatus.MOSTATUS_RELEASE &&
                mo.MOStatus != BenQGuru.eMES.Web.Helper.MOManufactureStatus.MOSTATUS_OPEN)
            {
                msgs.Add(new UserControl.Message(MessageType.Error, "$Error_CS_MO_Should_be_Release_or_Open"));
                ProcessBeforeReturn(this.Status, msgs);
                return(msgs);
            }

            MO2Route route = (MO2Route)moFacade.GetMONormalRouteByMOCode(mo.MOCode);

            if (route == null)
            {
                msgs.Add(new UserControl.Message(MessageType.Error, "$CS_MOnotNormalRoute"));
                ProcessBeforeReturn(this.Status, msgs);
                return(msgs);
            }

            DataCollectFacade dataCollectFacade = new DataCollectFacade(domainProvider);
            ItemRoute2OP      op = dataCollectFacade.GetMORouteFirstOP(mo.MOCode, route.RouteCode);

            BenQGuru.eMES.BaseSetting.BaseModelFacade dataModel = new BenQGuru.eMES.BaseSetting.BaseModelFacade(domainProvider);
            if (dataModel.GetOperation2Resource(op.OPCode, (act as IDCTClient).ResourceCode) == null)
            {
                msgs.Add(new UserControl.Message(MessageType.Error, "$CS_Route_Failed_FirstOP $Domain_MO =" + mo.MOCode));
                ProcessBeforeReturn(this.Status, msgs);
                return(msgs);
            }

            ProcessBeforeReturn(this.Status, msgs);

            return(msgs);
        }
Exemplo n.º 9
0
 private void DeleteDefaultRoute(Item2Route item2Route)
 {
     MOFacade moFacade = new MOFacade(this.DataProvider);
     DefaultItem2Route defroute = (DefaultItem2Route)moFacade.GetDefaultItem2Route(ItemCode);
     if (defroute != null && defroute.RouteCode == item2Route.RouteCode)
     {
         moFacade.DeleteDefaultItem2Route(defroute);
     }
 }
Exemplo n.º 10
0
        protected void cmdSave_ServerClick(object sender, EventArgs e)
        {
            ViewState["operate"] = "Edit";
            if (this.ValidateInput())
            {
                if (_TransferFacade == null)
                {
                    _TransferFacade = new WarehouseFacade(this.DataProvider);
                }

                object obj = this.GetEditObject();

                if (obj != null)
                {
                    if (((InvTransferDetail)obj).TransferStatus != RecordStatus.RecordStatus_NEW)
                    {
                        WebInfoPublish.Publish(this, "$Error_OnlyNEWCanEdit", this.languageComponent1);
                        return;
                    }

                    if (!String.IsNullOrEmpty(((InvTransferDetail)obj).MOCode))
                    {
                        MOFacade _MOFacade = new MOFacade();
                        object   MO        = _MOFacade.GetMO(((InvTransferDetail)obj).MOCode);
                        if (MO == null)
                        {
                            WebInfoPublish.Publish(this, "$Error_MOCodeNotInTBLMO", this.languageComponent1);
                            return;
                        }
                    }
                    //根据客户代码从表TblCustomer中取得客户名称

                    if (!String.IsNullOrEmpty(((InvTransferDetail)obj).CustomerCode))
                    {
                        Customer customer = (Customer)_TransferFacade.GetCustomer(((InvTransferDetail)obj).CustomerCode);
                        if (customer != null)
                        {
                            ((InvTransferDetail)obj).CustomerName = customer.CustomerName;
                        }
                    }

                    _TransferFacade.UpdateInvTransferDetail((InvTransferDetail)obj);
                }
            }

            this.RequestData();
            this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            if (this.ViewState["TransferStatus"].ToString() == this.languageComponent1.GetString(RecordStatus.RecordStatus_CLOSE))
            {
                this.cmdAdd.Disabled = true;
            }
            else
            {
                this.cmdAdd.Disabled = false;
            }
        }
Exemplo n.º 11
0
        protected void cmdAdd_ServerClick(object sender, EventArgs e)
        {
            ViewState["operate"] = "Add";
            if (this.ValidateInput())
            {
                if (_TransferFacade == null)
                {
                    _TransferFacade = new WarehouseFacade(this.DataProvider);
                }

                object obj = this.GetEditObject();

                if (obj != null)
                {
                    //add前检验唯一性

                    object hasData = _TransferFacade.GetInvTransferDetail(((InvTransferDetail)obj).TransferNO, ((InvTransferDetail)obj).TransferLine);
                    if (hasData != null)
                    {
                        WebInfoPublish.Publish(this, "$Error_TransferHasData", this.languageComponent1);
                        return;
                    }

                    if (!String.IsNullOrEmpty(((InvTransferDetail)obj).MOCode))
                    {
                        MOFacade _MOFacade = new MOFacade();
                        object   MO        = _MOFacade.GetMO(((InvTransferDetail)obj).MOCode);
                        if (MO == null)
                        {
                            WebInfoPublish.Publish(this, "$Error_MOCodeNotInTBLMO", this.languageComponent1);
                            return;
                        }
                    }

                    ((InvTransferDetail)obj).TransferStatus = RecordStatus.RecordStatus_NEW;
                    ((InvTransferDetail)obj).TransferDate   = ((InvTransferDetail)obj).Mdate;
                    ((InvTransferDetail)obj).TransferTime   = ((InvTransferDetail)obj).Mtime;
                    ((InvTransferDetail)obj).TransferUser   = ((InvTransferDetail)obj).Muser;

                    //根据客户代码从表TblCustomer中取得客户名称

                    if (!String.IsNullOrEmpty(((InvTransferDetail)obj).CustomerCode))
                    {
                        Customer customer = (Customer)_TransferFacade.GetCustomer(((InvTransferDetail)obj).CustomerCode);
                        if (customer != null)
                        {
                            ((InvTransferDetail)obj).CustomerName = customer.CustomerName;
                        }
                    }

                    _TransferFacade.AddInvTransferDetail((InvTransferDetail)obj);
                }
            }
            this.RequestData();
            this.buttonHelper.PageActionStatusHandle(PageActionType.Add);
        }
Exemplo n.º 12
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (facade == null)
     {
         facade = new MOFacade(this.DataProvider);
     }
     return(facade.GetMO2SAPLogList(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMoCodeQuery.Text)), decimal.Parse(this.txtPostSeqQuery.Text),
                inclusive, exclusive));
 }
Exemplo n.º 13
0
        protected override int GetRowCount()
        {
            if (facade == null)
            {
                facade = new MOFacade(this.DataProvider);
            }

            return(this.facade.GetMO2SAPLogListCount(
                       FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMoCodeQuery.Text)), decimal.Parse(this.txtPostSeqQuery.Text)));
        }
Exemplo n.º 14
0
        private void ddlBOMVersionWhere_Load(object sender, System.EventArgs e)
        {
            MOFacade moFacade = new MOFacade(_DataProvider);

            DropDownListBuilder builder = new DropDownListBuilder(this.ddlMOBOMVersionWhere);

            builder.HandleGetObjectList += new BenQGuru.eMES.Web.Helper.GetObjectListDelegate(moFacade.GetAllMOBOMVersion);
            builder.Build("BOMVersion", "BOMVersion");
            this.ddlMOBOMVersionWhere.Items.Insert(0, new ListItem("", ""));
        }
Exemplo n.º 15
0
 private int GetRowCount()
 {
     if (_MOFacade == null)
     {
         _MOFacade = new MOFacade(this.DataProvider);
     }
     return(this._MOFacade.QueryFirstCheckByMOCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)),
                FormatHelper.TODateInt(this.firstCheckDateQuery.Text)));
 }
Exemplo n.º 16
0
 public FCollectionEsopPicNGView()
 {
     InitializeComponent();
     this.m_MOFacade          = new MOFacade(this.DataProvider);
     this.m_ItemFacade        = new ItemFacade(this.DataProvider);
     this.m_EsopPicsFacade    = new EsopPicsFacade(this.DataProvider);
     this.m_DataCollectFacade = new DataCollectFacade(this.DataProvider);
     this._facade             = new SystemSettingFacade(this.DataProvider);
     this.m_EsopPicsNGFacade  = new EsopPicsNGFacade(this.DataProvider);
     this._tsFacade           = new TSFacade(this.DataProvider);
     //this.InitPageLanguage();
 }
Exemplo n.º 17
0
 private object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_MOFacade == null)
     {
         _MOFacade = new MOFacade(this.DataProvider);
     }
     return(this._MOFacade.QueryFirstCheckByMO(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeQuery.Text)),
                FormatHelper.TODateInt(this.firstCheckDateQuery.Text),
                inclusive,
                exclusive));
 }
Exemplo n.º 18
0
        private void ImportERPBOM(object[] objs, string type, Log log)
        {
            MOFacade  mofacade = new MOFacade(this.MESProvider);
            Hashtable ht       = new Hashtable();

            object[] impobjs = new object[objs.Length];
            for (int j = 0; j < objs.Length; j++)
            {
                object impObj = importSchema.FillImportObject(objs[j], type);
                //object moobj = mofacade.GetMO( (impObj as ERPBOM).MOCODE );
                impobjs.SetValue(impObj, j);
//				if(!ht.ContainsKey( (impObj as ERPBOM).MOCode ))
//				{
//					(impObj as ERPBOM).ItemCode = (moobj as MO).ItemCode;
//					ht.Add(  (impObj as ERPBOM).MOCode,(moobj as MO).ItemCode );
//				}
//				else
//				{
//					(impObj as ERPBOM).ItemCode = ht[(impObj as ERPBOM).MOCode].ToString();
//				}
            }
//
//			foreach( DictionaryEntry dic in ht )
//			{
//				object[] delobjs = mofacade.GetERPBOM( dic.Key.ToString() );
//				if( delobjs!=null )
//				{
//					for( int k=0; k<delobjs.Length; k++ )
//					{
//						this.MESProvider.Delete(delobjs[k]);
//					}
//				}
//			}
//
            for (int j = 0; j < impobjs.Length; j++)
            {
                try
                {
                    this.MESProvider.Insert(impobjs[j]);
                }
                catch (Exception ex)
                {
                    if (ex.Message != "$ERROR_DATA_ALREADY_EXIST")
                    {
                        throw ex;
                    }

                    Common.Log.Error("\t" + (impobjs[j] as ERPBOM).SEQUENCE.ToString() + "\t" + ex.Message);
                }
                //this.ERPProvider.Delete(objs[j]);
            }
        }
Exemplo n.º 19
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new  FacadeFactory(base.DataProvider).CreateItemFacade();
            }
            MOFacade moFacade = new MOFacade(base.DataProvider);

            if (moFacade.CheckItemCodeUsed(ItemCode))
            {
                WebInfoPublish.Publish(this, "$ERROR_ITEM_USE", this.languageComponent1);
                return;
            }
            this._facade.UpdateItemLocation((ItemLocation)domainObject);
        }
Exemplo n.º 20
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_facade == null)
            {
                _facade = new  FacadeFactory(base.DataProvider).CreateItemFacade();
            }
            MOFacade moFacade = new MOFacade(base.DataProvider);

            if (moFacade.CheckItemCodeUsed(ItemCode))
            {
                WebInfoPublish.Publish(this, "$ERROR_ITEM_USE", this.languageComponent1);
                return;
            }
            this._facade.DeleteItemLoaction((ItemLocation[])domainObjects.ToArray(typeof(ItemLocation)));
        }
Exemplo n.º 21
0
        private void DoQuery()
        {
            if (m_RCard != null)
            {
                this.m_RCard.Rows.Clear();
                this.m_RCard.AcceptChanges();
            }


            if (moFacade == null)
            {
                moFacade = new MOFacade(this.DataProvider);
            }

            string[] rCardList = moFacade.GetRcardsByMoAndItem(this.TxtMoCode.Value.Trim(), this.ItemCode);

            if (rCardList == null || rCardList.Length <= 0)
            {
                return;
            }
            if (rCardList != null)
            {
                DataRow rowNew;
                foreach (string rCard in rCardList)
                {
                    rowNew            = this.m_RCard.NewRow();
                    rowNew["Checked"] = false;
                    rowNew["RCard"]   = rCard;
                    this.m_RCard.Rows.Add(rowNew);
                }
                this.m_RCard.AcceptChanges();
            }
            this.ultraGridRCard.DataSource = m_RCard;
            this.ultraGridRCard.UpdateData();

            if (this.checkBoxSelectedAll.Checked)
            {
                for (int i = 0; i < ultraGridRCard.Rows.Count; i++)
                {
                    this.ultraGridRCard.Rows[i].Cells[0].Value = this.checkBoxSelectedAll.Checked;
                }

                this.ultraGridRCard.UpdateData();
            }

            this.ultraGridRCard.ActiveRow = null;
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            _InventoryFacade = new InventoryFacade(this.DataProvider);
            _MOFacade        = new MOFacade(this.DataProvider);

            if (!this.IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                InitControls();

                this.columnChart.Visible = false;
                this.lineChart.Visible   = false;
            }
            needVScroll = true;
        }
Exemplo n.º 23
0
        private void GetImportObjectType(ref object obj, string importType)
        {
            if (obj == null)
            {
                return;
            }

            DBDateTime now = FormatHelper.GetNowDBDateTime(this._DataProvider);

            switch (importType.ToUpper())
            {
            case "WORKPLAN":
                if (_MOFacade == null)
                {
                    _MOFacade = new MOFacade(_DataProvider);
                }

                WorkPlan workPlan = obj as WorkPlan;
                workPlan.MaintainUser   = _UserCode;
                workPlan.MaintainDate   = now.DBDate;
                workPlan.MaintainTime   = now.DBTime;
                workPlan.ActionStatus   = WorkPlanActionStatus.WorkPlanActionStatus_Init;
                workPlan.MaterialStatus = MaterialWarningStatus.MaterialWarningStatus_No;
                object mo = _MOFacade.GetMO(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(workPlan.MoCode)));
                workPlan.ItemCode = ((MO)mo).ItemCode;

                break;

            case "MATERIALNEED":
                MaterialReqStd materialReqStd = obj as MaterialReqStd;
                materialReqStd.MaintainUser = _UserCode;
                materialReqStd.MaintainDate = now.DBDate;
                materialReqStd.MaintainTime = now.DBTime;
                break;

            case "PLANWORKTIME":
                PlanWorkTime planWorkTime = obj as PlanWorkTime;
                planWorkTime.MaintainUser = _UserCode;
                planWorkTime.MaintainDate = now.DBDate;
                planWorkTime.MaintainTime = now.DBTime;
                break;

            default:
                break;
            }
        }
Exemplo n.º 24
0
        public FCollectionEsopPicNGEdit()
        {
            InitializeComponent();
            this.m_MOFacade             = new MOFacade(this.DataProvider);
            this.m_ItemFacade           = new ItemFacade(this.DataProvider);
            this.m_EsopPicsFacade       = new EsopPicsFacade(this.DataProvider);
            this.m_DataCollectFacade    = new DataCollectFacade(this.DataProvider);
            this._facade                = new SystemSettingFacade(this.DataProvider);
            this.m_EsopPicsNGFacade     = new EsopPicsNGFacade(this.DataProvider);
            this._tsFacade              = new TSFacade(this.DataProvider);
            imageListCache              = new List <Image>();
            ((Control)this).MouseWheel += new MouseEventHandler(FormDemo_MouseWheel);
            this.colorDialog            = new System.Windows.Forms.ColorDialog();
            this.btnColor.BackColor     = Color.Red;

            //this.InitPageLanguage();
        }
Exemplo n.º 25
0
        // Added by Icyer 2006/12/05
        private void TakeDownCarton(ActionEventArgs actionEventArgs)
        {
            bool        bDo     = false;
            ProductInfo product = actionEventArgs.ProductInfo;

            if (System.Configuration.ConfigurationSettings.AppSettings["TakeDownCartonReMORework"] == "1" &&
                product != null &&
                product.NowSimulation != null &&
                product.LastSimulation != null &&
                product.NowSimulation.MOCode != product.LastSimulation.MOCode &&
                product.LastSimulation.CartonCode != string.Empty)
            {
                MOFacade moFacade = new MOFacade(this.DataProvider);
                MO       mo       = (MO)moFacade.GetMO(product.NowSimulation.MOCode);
                if (mo == null)
                {
                    return;
                }
                BenQGuru.eMES.BaseSetting.SystemSettingFacade sysFacade = new SystemSettingFacade(this.DataProvider);
                Parameter param = (Parameter)sysFacade.GetParameter(mo.MOType, BenQGuru.eMES.Web.Helper.MOType.GroupType);
                if (param != null &&
                    param.ParameterValue == BenQGuru.eMES.Web.Helper.MOType.MOTYPE_REWORKMOTYPE)
                {
                    bDo = true;
                }
            }
            if (bDo == false)
            {
                return;
            }

            BenQGuru.eMES.Package.PackageFacade packageFacade = new BenQGuru.eMES.Package.PackageFacade(this.DataProvider);

            string strSql = "UPDATE tblSimulation SET CartonCode='' WHERE RCard='" + product.LastSimulation.LotCode + "' AND MOCode='" + product.LastSimulation.MOCode + "' ";

            this.DataProvider.CustomExecute(new SQLCondition(strSql));

            strSql = "UPDATE tblSimulationReport SET CartonCode='' WHERE RCard='" + product.LastSimulation.LotCode + "' AND MOCode='" + product.LastSimulation.MOCode + "' ";
            this.DataProvider.CustomExecute(new SQLCondition(strSql));

            packageFacade.SaveRemoveCarton2RCARDLog(product.LastSimulation.CartonCode, product.LastSimulation.LotCode, actionEventArgs.UserCode);

            packageFacade.SubtractCollected(product.LastSimulation.CartonCode);
            product.LastSimulation.CartonCode = string.Empty;
        }
Exemplo n.º 26
0
        public FCollectMo()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            UserControl.UIStyleBuilder.FormUI(this);

            this.ucMessage.Add(">>$CS_Please_Input_MOCode");            //请输入工单代码
            this.ucLEMOCode.TextFocus(false, true);

            this._moFacade = new MOFacade(this.DataProvider);
            this._helper   = new ActionOnLineHelper(this.DataProvider);
        }
Exemplo n.º 27
0
        public RouteDataPreparationHelper(DropDownList model, DropDownList item, DropDownList mo, DropDownList op, IDomainDataProvider dataProvider)
        {
            this._model = model;
            this._item  = item;
            this._mo    = mo;
            this._op    = op;

            this._modelFacade = new FacadeFactory(dataProvider).CreateModelFacade();
            this._moFacade    = new FacadeFactory(dataProvider).CreateMOFacade();
            this._itemFacade  = new FacadeFactory(dataProvider).CreateItemFacade();

            if (this._model != null)
            {
                this._model.SelectedIndexChanged += new EventHandler(_model_SelectedIndexChanged);
                this._model.AutoPostBack          = true;

                this._modelBuilder = new DropDownListBuilder(this._model);
                this._modelBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getModelList);
            }

            if (this._item != null)
            {
                this._item.SelectedIndexChanged += new EventHandler(_item_SelectedIndexChanged);
                this._item.AutoPostBack          = true;

                this._itemBuilder = new DropDownListBuilder(this._item);
                this._itemBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getItemList);
            }

            if (this._mo != null)
            {
                this._mo.SelectedIndexChanged += new EventHandler(_mo_SelectedIndexChanged);
                this._mo.AutoPostBack          = true;

                this._moBuilder = new DropDownListBuilder(this._mo);
                this._moBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getMOList);
            }

            if (this._op != null)
            {
                this._opBuilder = new DropDownListBuilder(this._op);
                this._opBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getOperationList);
            }
        }
Exemplo n.º 28
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();
            }
        }
Exemplo n.º 29
0
        protected DataRow GetGridRow(object obj)
        {

            MOFacade moFacade = new MOFacade(this.DataProvider);
            DefaultItem2Route defroute = (DefaultItem2Route)moFacade.GetDefaultItem2Route(ItemCode);
            bool bIsDefRoute = (defroute != null && defroute.RouteCode == ((Route)obj).RouteCode);
            DataRow row = this.DtSource.NewRow();

            row["RouteCode"] = ((Route)obj).RouteCode.ToString();
            row["RouteDescription"] = ((Route)obj).RouteDescription.ToString();
            row["DefaultItemRoute"] = bIsDefRoute.ToString().ToLower();
            row["EffectiveDate"] = FormatHelper.ToDateString(((Route)obj).EffectiveDate);
            row["InvalidDate"] = FormatHelper.ToDateString(((Route)obj).InvalidDate);
            row["MaintainUser"] = ((Route)obj).GetDisplayText("MaintainUser");
            row["MaintainDate"] = FormatHelper.ToDateString(((Route)obj).MaintainDate);
            row["IsReference"] = "";
            row["IsOPBOMUsed"] = ((Route)obj).EAttribute1;
            return row;

        }
Exemplo n.º 30
0
        private void ImportMOBOM(object[] objs, string type, Log log)
        {
            MOFacade  mofacade = new MOFacade(this.MESProvider);
            Hashtable ht       = new Hashtable();

            object[] impobjs = new object[objs.Length];
            for (int j = 0; j < objs.Length; j++)
            {
                object impObj = importSchema.FillImportObject(objs[j], type);
                object moobj  = mofacade.GetMO((impObj as MOBOM).MOCode);
                impobjs.SetValue(impObj, j);
                if (!ht.ContainsKey((impObj as MOBOM).MOCode))
                {
                    (impObj as MOBOM).ItemCode = (moobj as MO).ItemCode;
                    ht.Add((impObj as MOBOM).MOCode, (moobj as MO).ItemCode);
                }
                else
                {
                    (impObj as MOBOM).ItemCode = ht[(impObj as MOBOM).MOCode].ToString();
                }
            }

            foreach (DictionaryEntry dic in ht)
            {
                object[] delobjs = mofacade.GetMOBOM(dic.Key.ToString());
                if (delobjs != null)
                {
                    for (int k = 0; k < delobjs.Length; k++)
                    {
                        this.MESProvider.Delete(delobjs[k]);
                    }
                }
            }

            for (int j = 0; j < objs.Length; j++)
            {
                this.MESProvider.Insert(impobjs[j]);

                this.ERPProvider.Delete(objs[j]);
            }
        }