示例#1
0
        protected override object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider);

            Domain.Warehouse.Sapcloseperiod route = this._facade.CreateNewSapcloseperiod();

            route.Serial       = string.IsNullOrEmpty(this.txtserial.Text.Trim()) ? 0: Int32.Parse(this.txtserial.Text.Trim());
            route.StartDate    = FormatHelper.TODateInt(this.txtDateUseEdit.Text.Trim());
            route.StartTime    = FormatHelper.TOTimeInt(this.txtOnTimeEdit.Text.Trim());
            route.EndDate      = FormatHelper.TODateInt(this.txtToDateEdit.Text.Trim());
            route.EndTime      = FormatHelper.TOTimeInt(this.txtOffTimeEdit.Text.Trim());
            route.CDate        = dbDateTime.DBDate;
            route.CTime        = dbDateTime.DBTime;
            route.CUser        = this.GetUserCode();
            route.MaintainUser = this.GetUserCode();
            route.MaintainDate = dbDateTime.DBDate;
            route.MaintainTime = dbDateTime.DBTime;

            return(route);
        }
示例#2
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                ShipToStock shipToStock = this._IQCFacade.CreateNewShipToStock();


                BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
                // shipToStock.OrganizationID = int.Parse(this.drpOrgEdit.SelectedValue);
                shipToStock.OrganizationID = 1;
                shipToStock.VendorCode     = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtVendorCodeEdit.Text));
                shipToStock.EffectDate     = FormatHelper.TODateInt(this.datEffectDateEdit.Text);
                shipToStock.InvalidDate    = FormatHelper.TODateInt(this.datInvalidDateEdit.Text);
                shipToStock.Active         = "Y";
                shipToStock.MaintainUser   = this.GetUserCode();
                shipToStock.DQMCode        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtDQMaterialNO.Text, 40));

                BenQGuru.eMES.Domain.MOModel.Material m = _WarehouseFacade.GetMaterialFromDQMCode(shipToStock.DQMCode);
                if (m != null)
                {
                    shipToStock.MaterialCode = m.MCode;
                }


                return(shipToStock);
            }
            else
            {
                return(null);
            }
        }
 protected override int GetRowCount()
 {
     if (_WarehouseFacade == null)
     {
         _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     }
     return(this._WarehouseFacade.QueryASNDetailSNCount(txtSTNOQuery.Text, txtSTLINEQuery.Text));
 }
示例#4
0
 protected override int GetRowCount()
 {
     if (_WarehouseFacade == null)
     {
         _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     }
     return(this._WarehouseFacade.QueryPackageReceiptsDetailsSNCount(txtCARINVNOQuery.Text, txtPickNoQuery.Text, txtCARTONNOQuery.Text, txtDQMCODEQuery.Text));
 }
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_WarehouseFacade == null)
     {
         _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     }
     return(this._WarehouseFacade.QueryPackageReceiptsDetails(txtCARINVNOQuery.Text, txtPickNoQuery.Text, txtCARTONNOQuery.Text, txtDQMCODEQuery.Text, txtGFHWITEMCODEQuery.Text, inclusive, exclusive));
 }
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_WarehouseFacade == null)
     {
         _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     }
     return(this._WarehouseFacade.QueryASNDetailSN(txtSTNOQuery.Text, txtSTLINEQuery.Text, inclusive, exclusive));
 }
示例#7
0
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            return(this._WarehouseFacade.QuerySPECSTORAGEINFO(txtDQMCODEQuery.Text, txtStorageCodeQuery.Text, inclusive, exclusive));
        }
示例#8
0
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            this._facade.DeleteSapcloseperiod((Domain.Warehouse.Sapcloseperiod[])domainObjects.ToArray(typeof(Domain.Warehouse.Sapcloseperiod)));
        }
示例#9
0
        protected override int GetRowCount()
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            return(this._WarehouseFacade.QuerySPECSTORAGEINFOCOUNT(txtDQMCODEQuery.Text, txtStorageCodeQuery.Text));
        }
示例#10
0
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }
            int beginDate = FormatHelper.TODateInt(this.txtDateUseBeginQuery.Text.Trim());
            int endDate   = FormatHelper.TODateInt(this.txtDateUseEndQuery.Text.Trim());

            return(this._facade.QueryRecordDetail(beginDate, endDate, inclusive, exclusive));
        }
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_WarehouseFacade == null)
            {
                _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }



            return(_WarehouseFacade.GetStockPortionCheckDetails(txtStockCheckCodeQuery.Text, drpLocationCodeQuery.SelectedValue, txtStorageCodeQuery.Text, txtDQMCODEQuery.Text, inclusive, exclusive));
        }
示例#12
0
        protected override int GetRowCount()
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            int beginDate = FormatHelper.TODateInt(this.txtDateUseBeginQuery.Text.Trim());
            int endDate   = FormatHelper.TODateInt(this.txtDateUseEndQuery.Text.Trim());

            return(this._facade.QueryRecordDetailCOUNT(beginDate, endDate));
        }
示例#13
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }
            object obj = _facade.GetSapcloseperiod(Int32.Parse(row.Items.FindItemByKey("serial").Text));

            if (obj != null)
            {
                return((Domain.Warehouse.Sapcloseperiod)obj);
            }

            return(null);
        }
示例#14
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            object obj = _facade.GetSapcloseperiod(Int32.Parse(this.txtserial.Text.Trim()));

            ((Domain.Warehouse.Sapcloseperiod)domainObject).CUser = ((Domain.Warehouse.Sapcloseperiod)obj).CUser;
            ((Domain.Warehouse.Sapcloseperiod)domainObject).CDate = ((Domain.Warehouse.Sapcloseperiod)obj).CDate;
            ((Domain.Warehouse.Sapcloseperiod)domainObject).CTime = ((Domain.Warehouse.Sapcloseperiod)obj).CTime;

            this._facade.UpdateSapcloseperiod((Domain.Warehouse.Sapcloseperiod)domainObject);
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                // 初始化页面语言
                string CheckNo     = Request.QueryString["CheckNo"];
                string StorageCode = Request.QueryString["StorageCode"];
                this.InitPageLanguage(this.languageComponent1, false);
                txtStorageCodeQuery.Text    = StorageCode;
                txtStockCheckCodeQuery.Text = CheckNo;
                if (_WarehouseFacade == null)
                {
                    _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
                }

                if (_InventoryFacade == null)
                {
                    _InventoryFacade = new BenQGuru.eMES.Material.InventoryFacade(base.DataProvider);
                }


                object[] objs = _WarehouseFacade.GetLocations(CheckNo, StorageCode, txtDQMCODEQuery.Text);
                this.drpLocationCodeQuery.Items.Add(new ListItem("", ""));
                int orgId = GlobalVariables.CurrentOrganizations.First().OrganizationID;
                if (objs != null && objs.Length > 0)
                {
                    foreach (Location l in objs)
                    {
                        Location lll = (Location)_InventoryFacade.GetLocation(l.LocationCode, orgId);
                        if (lll != null)
                        {
                            this.drpLocationCodeQuery.Items.Add(new ListItem(lll.LocationName, lll.LocationCode));
                        }
                        else
                        {
                            this.drpLocationCodeQuery.Items.Add(new ListItem(l.LocationCode, l.LocationCode));
                        }
                    }
                }
            }
            InitHander();

            //txtPickNoQuery.Text = pickNO;

            this.InitWebGrid();
            this.cmdQuery_Click(null, null);
            this.RequestData();
        }
 protected override int GetRowCount()
 {
     if (_WarehouseFacade == null)
     {
         _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     }
     return(_WarehouseFacade.GetStockPortionCheckDetailsCount(txtStockCheckCodeQuery.Text, drpLocationCodeQuery.SelectedValue, txtStorageCodeQuery.Text, txtDQMCODEQuery.Text));
     // return this._WarehouseFacade.QueryPackageReceiptsCount(
     //    FormatHelper.CleanString(this.txtCARINVNOQuery.Text),
     //FormatHelper.CleanString(this.txtPickNoQuery.Text),
     //FormatHelper.CleanString(this.drpPickTypeQuery.SelectedValue),
     //FormatHelper.CleanString(this.txtItemNameQuery.Text),
     //    FormatHelper.CleanString(this.txtOrderNoQuery.Text),
     //FormatHelper.TODateInt(this.txtCBDateQuery.Text),
     //FormatHelper.TODateInt(this.txtCEDateQuery.Text));
 }
 private void InitPage()
 {
     BenQGuru.eMES.Material.WarehouseFacade facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
     object[] objs = facade.GetAllTransactionType();
     if (objs == null)
     {
         return;
     }
     listTransType.RepeatColumns = (objs.Length / 5) + 1;
     for (int i = 0; i < objs.Length; i++)
     {
         BenQGuru.eMES.Domain.Warehouse.TransactionType type = (BenQGuru.eMES.Domain.Warehouse.TransactionType)objs[i];
         listTransType.Items.Add(new ListItem(type.TransactionTypeName, type.TransactionTypeCode));
         type = null;
     }
     objs = null;
 }
示例#18
0
        protected override void AddDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            }

            int num = this._facade.GetRecordCount(((Domain.Warehouse.Sapcloseperiod)domainObject).StartDate, ((Domain.Warehouse.Sapcloseperiod)domainObject).StartTime, ((Domain.Warehouse.Sapcloseperiod)domainObject).EndDate, ((Domain.Warehouse.Sapcloseperiod)domainObject).EndTime);

            if (num == 0)
            {
                this._facade.AddSapcloseperiod((Domain.Warehouse.Sapcloseperiod)domainObject);
            }
            else
            {
                WebInfoPublish.Publish(this, "$Error_SAPCloseTime_Exist  ", languageComponent1);
            }
        }
示例#19
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (txtMOCodeEdit.Enabled == true && FormatHelper.CleanString(this.txtMOCodeEdit.Text) == string.Empty)
            {
                throw new Exception("$CS_MO_NotExit");
            }

            if (facade == null)
            {
                facade = new BenQGuru.eMES.SelectQuery.SPFacade(base.DataProvider);
            }
            BenQGuru.eMES.Material.WarehouseFacade _facade = new BenQGuru.eMES.Material.WarehouseFacade(this.facade.DataProvider);
            ArrayList list = new ArrayList();

            for (int i = 0; i < this.gridSelected.Rows.Count; i++)
            {
                if (IsDecimal(this.gridSelected.Rows[i].Cells[3].Text) && decimal.Parse(this.gridSelected.Rows[i].Cells[3].Text) != 0)
                {
                    WarehouseTicketDetail item = _facade.CreateNewWarehouseTicketDetail();
                    item.TicketNo     = this.GetRequestParam("ticketno");
                    item.ItemCode     = this.gridSelected.Rows[i].Cells[1].Text;
                    item.ItemName     = this.gridSelected.Rows[i].Cells[2].Text;
                    item.MOCode       = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeEdit.Text));
                    item.Qty          = decimal.Parse(this.gridSelected.Rows[i].Cells[3].Text);
                    item.ActualQty    = 0;
                    item.MaintainUser = this.GetUserCode();
                    list.Add(item);
                }
            }
            if (FormatHelper.CleanString(this.txtMOCodeEdit.Text) != string.Empty)
            {
                BenQGuru.eMES.MOModel.MOFacade  mof = new BenQGuru.eMES.MOModel.MOFacade(this.facade.DataProvider);
                BenQGuru.eMES.Domain.MOModel.MO mo  = (BenQGuru.eMES.Domain.MOModel.MO)mof.GetMO(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeEdit.Text)));
                if (mo == null || (mo.MOStatus != MOManufactureStatus.MOSTATUS_RELEASE && mo.MOStatus != MOManufactureStatus.MOSTATUS_OPEN && mo.MOStatus != MOManufactureStatus.MOSTATUS_PENDING))
                {
                    throw new Exception("$CS_MO_NotExit");
                }
            }
            _facade.AddWarehouseTicketDetail(list);
            this.Page.RegisterStartupScript("close window", "<script language='javascript'>CloseWindow();</script>");
        }
示例#20
0
        private bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblDQMaterialNO, txtDQMaterialNO, 40, true));
            //  manager.Add(new LengthCheck(lblOrgEdit, drpOrgEdit, 2000, true));
            manager.Add(new LengthCheck(lblVendorCodeEdit, txtVendorCodeEdit, 40, true));
            manager.Add(new DateCheck(lblEffectDateEdit, datEffectDateEdit.Text, false));
            manager.Add(new DateCheck(lblInvalidDateEdit, datInvalidDateEdit.Text, false));
            manager.Add(new DateRangeCheck(this.lblEffectDateEdit, this.datEffectDateEdit.Text, this.lblInvalidDateEdit, this.datInvalidDateEdit.Text, true));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, languageComponent1);
                return(false);
            }

            ItemFacade itemFacade = new ItemFacade(this.DataProvider);

            //if (itemFacade.GetMaterial(
            //    FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtMaterialCodeEdit.Text)),
            //    int.Parse(drpOrgEdit.SelectedValue)) == null)

            BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
            if (_WarehouseFacade.GetMaterialInfoByQDMCode(
                    FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtDQMaterialNO.Text))) == null)
            {
                WebInfoPublish.Publish(this, "$Error_Material_NotFound", languageComponent1);
                return(false);
            }

            if (Convert.ToDateTime(this.datEffectDateEdit.Text) > Convert.ToDateTime(this.datInvalidDateEdit.Text))
            {
                WebInfoPublish.Publish(this, "$Error_EffectDateCannotBiggerThanInvalidDate", languageComponent1);
                return(false);
            }

            return(true);
        }
示例#21
0
 public CINNOActionEventArgs(string actionType, string runningCard, string userCode, string resourceCode, ProductInfo productInfo, string iNNO, BenQGuru.eMES.Material.WarehouseFacade warehouse
                             )
     : base(actionType, runningCard, userCode, resourceCode)
 {
     this.INNO        = iNNO.ToUpper();
     this.ProductInfo = productInfo;
     this.Warehouse   = warehouse;
 }
示例#22
0
        public Messages CheckIn(ActionEventArgs actionEventArgs)
        {
            ((GoToMOActionEventArgs)actionEventArgs).PassCheck = true;

            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "GetIDInfo");

            dataCollectDebug.WhenFunctionIn(messages);

            try
            {
                DataCollectFacade   dataCollectFacade = new DataCollectFacade(this.DataProvider);
                MOFacade            moFacade          = new MOFacade(this.DataProvider);
                MOLotFacade         moLotFacade       = new MOLotFacade(this.DataProvider);
                BaseModelFacade     dataModel         = new BaseModelFacade(this.DataProvider);
                ModelFacade         mf           = new ModelFacade(this.DataProvider);
                SystemSettingFacade systemFacade = new SystemSettingFacade(this.DataProvider);

                //AMOI  MARK  START  20050803 序号默认为初始,FOR 重工序列号重复
                actionEventArgs.ProductInfo.NowSimulation.LotSeq = ActionOnLineHelper.StartSeq;
                //AMOI  MARK  END

                if (((GoToMOActionEventArgs)actionEventArgs).MOCode == null || ((GoToMOActionEventArgs)actionEventArgs).MOCode.Trim() == string.Empty)
                {
                    throw new Exception("$CS_Sys_GoToMO_Lost_MOParam");
                }


                #region 检查途程
                MO mo = null;
                if (actionEventArgs.CurrentMO != null)
                {
                    mo = actionEventArgs.CurrentMO;
                }
                else
                {
                    mo = (MO)moFacade.GetMO(((GoToMOActionEventArgs)actionEventArgs).MOCode);
                    actionEventArgs.CurrentMO = mo;
                }
                if (mo == null)
                {
                    throw new Exception("$CS_MO_Not_Exit");
                }

                MO2Route route = (MO2Route)moFacade.GetMONormalRouteByMOCode(mo.MOCode);
                if (route == null)
                {
                    throw new Exception("$CS_MOnotNormalRoute");
                }

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

                if (dataModel.GetOperation2Resource(op.OPCode, actionEventArgs.ResourceCode) == null)
                {
                    throw new Exception("$CS_Route_Failed_FirstOP $Domain_MO =" + mo.MOCode);
                }
                #endregion

                #region 检查工单

                //工单状态检查
                if (!dataCollectFacade.CheckMO(mo))
                {
                    throw new Exception("$CS_MO_Status_Error $CS_Param_MOStatus=$" + mo.MOStatus);
                }

                /*1.Simulation 没有记录
                 *	    a. MO Running Card 没有重复		OK
                 *     b. MO Running Card 有重复		Exception
                 *
                 * 2. Simulation 有记录
                 *		a.  Simulation 工单 和 当前工单 一样			OK
                 *		b.  Simulation 工单 和 当前工单 不一样
                 *			 b1.  当前工单 是重工工单
                 *					b11.  MO Running Card 没有重复		OK
                 *					b12.  MO Running Card 有重复			Exception
                 *			 b2.  当前工单不是重工工单						Exception
                 *
                 */

                Parameter parameter = (Parameter)systemFacade.GetParameter(mo.MOType, BenQGuru.eMES.Web.Helper.MOType.GroupType);

                if (parameter == null)
                {
                    throw new Exception("$CS_MOType_Lost");
                }
                mo.MOType = parameter.ParameterValue;

                if (actionEventArgs.ProductInfo.LastSimulation != null)
                {
                    //归属工单和归属工序相同也不允许
                    if ((mo.MOCode == actionEventArgs.ProductInfo.LastSimulation.MOCode))
                    {
                        ((GoToMOActionEventArgs)actionEventArgs).PassCheck = false;
                        return(messages);
                    }
                    //Laws Lu,2005/10/20,修改	Lucky的需求	CS112
                    //建议返工工单归属采集时增加判断条件,也就是说只有没有在制记录的或者已经拆解的产品序列号才能归属返工工单
                    if (actionEventArgs.ProductInfo.LastSimulation.IsComplete == "0")
                    {
                        throw new Exception("$CS_PRODUCT_STILL_INLINE_NOT_BELONG_MO ,$CS_Param_ID=" + actionEventArgs.LotCode);
                    }
                }

                // 投入量检查
                if (mo.IsControlInput == "1")   // 客户在工单中勾选了“限制投入量”则检查工单可投入量,否则不检查
                {
                    if (mo.MOPlanQty - mo.MOInputQty + mo.MOScrapQty + mo.MOOffQty - mo.IDMergeRule < 0)
                    {
                        throw new Exception("$CS_MOInputOut $Domain_MO =" + mo.MOCode);
                    }
                }
                #endregion

                #region 检查库房状态
                if (System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"] != null &&
                    System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"].Trim() == "1")
                {
                    Material.WarehouseFacade wFAC = new BenQGuru.eMES.Material.WarehouseFacade(DataProvider);
                    //读资源对应的产线
                    BenQGuru.eMES.BaseSetting.BaseModelFacade facade = new BenQGuru.eMES.BaseSetting.BaseModelFacade(this.DataProvider);
                    object objResource = facade.GetResource(actionEventArgs.ResourceCode);

                    string strSSCode = ((BenQGuru.eMES.Domain.BaseSetting.Resource)objResource).StepSequenceCode;
                    object obj       = wFAC.GetWarehouseByMoSS(mo.MOCode, strSSCode);
                    if (obj != null)
                    {
                        Domain.Warehouse.Warehouse wh = obj as Domain.Warehouse.Warehouse;
                        //Laws Lu,2006/02/20,修改/无需工段代码
                        string strStatus = wFAC.GetWarehouseStatus(wh.WarehouseCode, wh.FactoryCode);
                        if (strStatus == Domain.Warehouse.Warehouse.WarehouseStatus_Cycle)
                        {
                            throw new Exception("$CS_LINE_IS_HOLD");
                        }
                    }
                }
                #endregion

                #region 填写新SIMULATION 归属工单 批次数量从tblmo2lotlink 中获取

                Domain.MOModel.MO2LotLink mo2lotlink = moLotFacade.GetMO2LotLink(actionEventArgs.LotCode, mo.MOCode) as Domain.MOModel.MO2LotLink;
                if (mo2lotlink != null)
                {
                    if (mo2lotlink.LotStatus != LotStatusForMO2LotLink.LOTSTATUS_STOP)
                    {
                        mo2lotlink.LotStatus = LotStatusForMO2LotLink.LOTSTATUS_USE;
                        moLotFacade.UpdateMO2LotLink(mo2lotlink);

                        actionEventArgs.ProductInfo.NowSimulation.LotQty  = mo2lotlink.LotQty;
                        actionEventArgs.ProductInfo.NowSimulation.GoodQty = mo2lotlink.LotQty;
                        actionEventArgs.ProductInfo.NowSimulation.NGQty   = 0;
                    }
                    else
                    {
                        throw new Exception("$CS_Mo2LotLink_Error_Status");
                    }
                }
                else
                {
                    throw new Exception("$CS_Mo2LotLink_Not_Exist");
                }


                //messages.AddMessages( dataCollectFacade.WriteSimulation(id,actionType,resourceCode,userCode,product));
                actionEventArgs.ProductInfo.NowSimulation.RouteCode  = route.RouteCode;
                actionEventArgs.ProductInfo.NowSimulation.OPCode     = op.OPCode;
                actionEventArgs.ProductInfo.NowSimulation.LotStatus  = LotStatusForMO2LotLink.LOTSTATUS_USE;
                actionEventArgs.ProductInfo.NowSimulation.LastAction = ActionType.DataCollectAction_GoMO;
                actionEventArgs.ProductInfo.NowSimulation.ActionList = ";" + ActionType.DataCollectAction_GoMO + ";";
                actionEventArgs.ProductInfo.NowSimulation.LotCode    = actionEventArgs.LotCode;
                actionEventArgs.ProductInfo.NowSimulation.MOCode     = mo.MOCode;
                actionEventArgs.ProductInfo.NowSimulation.ItemCode   = mo.ItemCode;
                Model model = mf.GetModelByItemCode(mo.ItemCode);
                if (model == null)
                {
                    throw new Exception("$CS_Model_Lost $CS_Param_ItemCode=" + mo.ItemCode);
                }
                actionEventArgs.ProductInfo.NowSimulation.ModelCode     = model.ModelCode;
                actionEventArgs.ProductInfo.NowSimulation.IsComplete    = ProductComplete.NoComplete;
                actionEventArgs.ProductInfo.NowSimulation.CollectStatus = CollectStatus.CollectStatus_BEGIN;
                actionEventArgs.ProductInfo.NowSimulation.ResCode       = actionEventArgs.ResourceCode;
                actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.GOOD;
                actionEventArgs.ProductInfo.NowSimulation.FromOP        = ActionOnLineHelper.StringNull;
                actionEventArgs.ProductInfo.NowSimulation.FromRoute     = ActionOnLineHelper.StringNull;
                actionEventArgs.ProductInfo.NowSimulation.CartonCode    = ActionOnLineHelper.StringNull;
                actionEventArgs.ProductInfo.NowSimulation.LotNo         = ActionOnLineHelper.StringNull;
                actionEventArgs.ProductInfo.NowSimulation.PalletCode    = ActionOnLineHelper.StringNull;
                actionEventArgs.ProductInfo.NowSimulation.NGTimes       = ActionOnLineHelper.StartNGTimes;
                actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.GOOD;
                actionEventArgs.ProductInfo.NowSimulation.LotStatus     = LotStatusForMO2LotLink.LOTSTATUS_USE;
                actionEventArgs.ProductInfo.NowSimulation.IsHold        = 0;
                actionEventArgs.ProductInfo.NowSimulation.MOSeq         = (int)mo.MOSeq; // Added by Icyer 2007/07/03
                //update by andy.xin rmaBillCode
                //actionEventArgs.ProductInfo.NowSimulation.RMABillCode = rmaBillCode; //mo.RMABillCode;

                #endregion
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }

            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
示例#23
0
        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            if (_opBOMFacade == null)
            {
                _opBOMFacade = new FacadeFactory(base.DataProvider).CreateOPBOMFacade();
            }
            if (_itemFacade == null)
            {
                _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
            }

            ArrayList array = this.GetNoRepeatSelectObjs(this.gridHelper.GetCheckedRows());

            if (array.Count > 0)
            {
                ArrayList sboms        = new ArrayList();
                Hashtable notInOPBOMHT = this.GetNotInOPBOMHashtalbe();
                string    returnMsg    = string.Empty;

                foreach (GridRecord row in array)
                {
                    object obj = this.GetEditObject(row);
                    if (obj != null)
                    {
                        if (notInOPBOMHT.Contains(((SBOM)obj).SBOMItemCode))//只有不在opbom中的子阶料才可以添加到列表中
                        {
                            sboms.Add((SBOM)obj);
                        }
                    }
                }
                if (sboms.Count > 0)
                {
                    ItemRoute2OP itemRoute2Operation = (ItemRoute2OP)_itemFacade.GetItemRoute2Op(OPID, GlobalVariables.CurrentOrganizations.First().OrganizationID);
                    _opBOMFacade.AssignBOMItemToOperation(OPBOMCode, OPBOMVersion, itemRoute2Operation, (SBOM[])sboms.ToArray(typeof(SBOM)), this.Actiontype);

                    //Laws Lu,2006/09/01

                    /*1,目前工序BOM建立逻辑不变,增加生效检查功能和失效功能,
                     * 初始建立的工序BOM资料处于失效状态,通过生效检查后处于生效状态,
                     * 此时不允许修改,只有失效状态的工序BOM才可以修改。
                     * 生效检查逻辑包括:完整的工序BOM包含的子阶物料(替代料)必须包含某工单所有的已发料物料代码,
                     * 比如,工单发料资料中包含5种物料,则工序BOM中的子阶物料必须也有这五种物料,
                     * 且首选料不能有这五种物料之外的其他物料。具体的工单由用户在界面指定。
                     * 举例如下:工单发料资料中有A,B,C,D四种物料*/
                    DataProvider.BeginTransaction();
                    try
                    {
                        MOFacade moFac = (new FacadeFactory(DataProvider)).CreateMOFacade();

                        object objOPBOM = moFac.GetOPBOM(itemRoute2Operation.ItemCode, OPBOMCode, OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);

                        if (objOPBOM != null)
                        {
                            OPBOM opBOM = objOPBOM as OPBOM;

                            opBOM.Avialable = 0;

                            moFac.UpdateOPBOM(opBOM);
                        }
                        // Added by Icyer 2005/08/16
                        // 同时将物料加入到物料主档中
                        BenQGuru.eMES.Material.WarehouseFacade wf = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
                        wf.AddWarehouseItem((SBOM[])sboms.ToArray(typeof(SBOM)));

                        DataProvider.CommitTransaction();
                        //this.cmdReturn_ServerClick(sender,e);
                        // Added end
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.Message);

                        DataProvider.RollbackTransaction();
                        throw ex;
                    }
                    finally
                    {
                        ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                    }

                    foreach (SBOM somobject in (SBOM[])sboms.ToArray(typeof(SBOM)))
                    {
                        ItemFacade itemFacade = new ItemFacade(this.DataProvider);
                        Domain.MOModel.Material MaterialObject = (Domain.MOModel.Material)itemFacade.GetMaterial(somobject.SBOMItemCode.Trim().ToUpper(), GlobalVariables.CurrentOrganizations.First().OrganizationID);
                        if (MaterialObject != null)
                        {
                            if (MaterialObject.MaterialCheckType.IndexOf(OPBOMDetailCheckType.CHECK_LINKBARCODE) < 0)
                            {
                                returnMsg += "$ITEM_NOT_LINKBARCODE:" + somobject.SBOMItemCode.Trim().ToUpper() + "\n ";
                            }
                        }
                    }
                }

                //if (addItemMessage.Trim()!=string.Empty && addItemMessage.Trim().Length>0)
                //{
                //    WebInfoPublish.Publish(this, addItemMessage, this.languageComponent1);
                //}

                this.RequestData();
                this.Return(sender, e, returnMsg);
            }
        }
示例#24
0
        public Messages Execute(ActionEventArgs actionEventArgs)
        {
            Messages         messages         = new Messages();
            DataCollectDebug dataCollectDebug = new DataCollectDebug(this.GetType().ToString() + "Collect");

            dataCollectDebug.WhenFunctionIn(messages);
            try
            {
                ActionOnLineHelper dataCollect = new ActionOnLineHelper(this.DataProvider);
                //填写SIMULATION 检查工单、ID、途程、操作
                messages.AddMessages(dataCollect.CheckID(actionEventArgs));

                //检查是否完工
                if (actionEventArgs.ProductInfo.LastSimulation.IsComplete == "1")
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$CS_PRODUCT_ALREADY_COMPLETE $CS_Param_OPCode  =" + actionEventArgs.ProductInfo.LastSimulation.OPCode));
                }
                if (messages.IsSuccess())
                {
                    //Laws Lu,2005/08/15,新增	完工逻辑,在其他Check都通过的情况下,所有的RunningCard应该是GOOD状态
                    //暂时不考虑线外工序
                    actionEventArgs.ProductInfo.NowSimulation.IsComplete    = "1";
                    actionEventArgs.ProductInfo.NowSimulation.EAttribute1   = ProductStatus.OffMo;
                    actionEventArgs.ProductInfo.NowSimulation.ProductStatus = ProductStatus.OffMo;


                    //End Laws Lu
                    messages.AddMessages(dataCollect.Execute(actionEventArgs));
                    if (messages.IsSuccess())
                    {
                        //更新维修记录
                        if (actionEventArgs.ProductInfo.LastTS != null)
                        {
                            //2006/02/08	修改	修改维修记录状态
                            Domain.TS.TS ts = actionEventArgs.ProductInfo.LastTS;

                            TS.TSFacade tsFAC = new BenQGuru.eMES.TS.TSFacade(DataProvider);

//							if(ts.TSStatus == TSStatus.TSStatus_New)
//							{
//								tsFAC.DeleteTS(ts);
//							}
//							else
//							{
                            tsFAC.UpdateTSStatus(ts.TSId, TSStatus.TSStatus_OffMo, actionEventArgs.UserCode);
//							}

//							ts.TSId = FormatHelper.GetUniqueID(actionEventArgs.ProductInfo.NowSimulation.MOCode
//								,ts.RunningCard,ts.RunningCardSequence.ToString());
//
//							ts.MaintainUser = actionEventArgs.UserCode;
//							ts.MaintainDate = FormatHelper.TODateInt(DateTime.Now);
//							ts.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
//
//							ts.TSStatus = TSStatus.TSStatus_OffMo;
//
//
//							tsFAC.AddTS(ts);
                        }

                        ///下料扣库存
                        ///
                        //Laws Lu,2005/10/20,新增	使用配置文件来控制物料模块是否使用
                        if (System.Configuration.ConfigurationSettings.AppSettings["NeedMaterialModule"].Trim() == "1")
                        {
                            BenQGuru.eMES.Material.CastDownHelper castHelper = new BenQGuru.eMES.Material.CastDownHelper(DataProvider);
                            ArrayList arRcard = new ArrayList();

                            castHelper.GetAllRCardByMo(ref arRcard, actionEventArgs.ProductInfo.NowSimulation.RunningCard, actionEventArgs.ProductInfo.NowSimulation.MOCode);

                            if (arRcard.Count == 0)
                            {
                                arRcard.Add(actionEventArgs.RunningCard);
                            }

                            string runningCards = "('" + String.Join("','", (string[])arRcard.ToArray(typeof(string))) + "')";
                            //下料并归还库房
                            BenQGuru.eMES.Material.WarehouseFacade wfacade = new BenQGuru.eMES.Material.WarehouseFacade(this.DataProvider);
                            wfacade.DropMaterialStock(runningCards
                                                      , actionEventArgs.ProductInfo.NowSimulation.MOCode, actionEventArgs.ProductInfo.NowSimulation.OPCode);
                        }

                        //填写测试报表 TODO
                        //ReportHelper reportCollect= new ReportHelper(this.DataProvider);
                        //messages.AddMessages(reportCollect.ReportLineQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo));
                        //messages.AddMessages(reportCollect.ReportResQuanMaster(this.DataProvider,actionEventArgs.ActionType,actionEventArgs.ProductInfo));

                        //填写脱离工单表
                        MOFacade moFAC = new MOFacade(DataProvider);

                        OffMoCard offCard = new OffMoCard();
                        offCard.PK     = System.Guid.NewGuid().ToString();
                        offCard.MoCode = actionEventArgs.ProductInfo.NowSimulation.MOCode;
                        offCard.RCARD  = actionEventArgs.RunningCard;
                        offCard.MoType = (actionEventArgs as OffMoEventArgs).MOType;
                        offCard.MUSER  = actionEventArgs.UserCode;
                        offCard.MDATE  = actionEventArgs.ProductInfo.NowSimulation.MaintainDate;
                        offCard.MTIME  = actionEventArgs.ProductInfo.NowSimulation.MaintainTime;


                        moFAC.AddOffMoCard(offCard);
                    }
                }
            }
            catch (Exception e)
            {
                messages.Add(new Message(e));
            }
            dataCollectDebug.WhenFunctionOut(messages);
            return(messages);
        }
示例#25
0
 public CKeypartsActionEventArgs(string actionType, string runningCard, string userCode, string resourceCode, ProductInfo productInfo, OPBomKeyparts keyParts, BenQGuru.eMES.Material.WarehouseFacade warehouse
                                 )
     : base(actionType, runningCard, userCode, resourceCode)
 {
     this.Keyparts    = keyParts;
     this.ProductInfo = productInfo;
     this.Warehouse   = warehouse;
 }
示例#26
0
 private object[] GetAllFactory()
 {
     Material.WarehouseFacade wareHouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(this.DataProvider);
     return(wareHouseFacade.GetAllFactory());
 }
        //private void gridWebGrid_DblClick(object sender, Infragistics.WebUI.UltraWebGrid.ClickEventArgs e)
        //{
        //    object obj = this.GetEditObject(e.Row);

        //    if (obj != null)
        //    {
        //        this.SetEditObject(obj);

        //        this.buttonHelper.PageActionStatusHandle(PageActionType.Update);
        //    }

        //}

        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            if (chbSourceSBOMEdit.Checked)
            {
                Response.Redirect(this.MakeRedirectUrl("FOPBOMOperationItemSP.aspx",
                                                       new string[] { "itemcode", "opbomcode", "opbomversion", "routecode", "opid", "actiontype", "OrgID" },
                                                       new string[] { ItemCode, OPBOMCode, OPBOMVersion, RouteCode, OPID, this.Actiontype.ToString(), OrgID.ToString() }));
            }
            else
            {
                object opBOMDetail = this.GetEditObject();

                if (opBOMDetail != null)
                {
                    if (_itemFacade == null)
                    {
                        _itemFacade = new FacadeFactory(base.DataProvider).CreateItemFacade();
                    }
                    if (_itemFacade.GetMaterial(((OPBOMDetail)opBOMDetail).OPBOMItemCode, ((OPBOMDetail)opBOMDetail).OrganizationID) == null)
                    {
                        ExceptionManager.Raise(this.GetType().BaseType, "$Error_Material_NotFound", lblBOMItemCodeEdit.Text + ": " + ((OPBOMDetail)opBOMDetail).OPBOMItemCode);
                    }

                    if (_itemFacade.GetMaterial(((OPBOMDetail)opBOMDetail).OPBOMSourceItemCode, ((OPBOMDetail)opBOMDetail).OrganizationID) == null)
                    {
                        ExceptionManager.Raise(this.GetType().BaseType, "$Error_Material_NotFound", lblSourceItemCode.Text + ": " + ((OPBOMDetail)opBOMDetail).OPBOMSourceItemCode);
                    }

                    if (_opBOMFacade == null)
                    {
                        _opBOMFacade = new FacadeFactory(base.DataProvider).CreateOPBOMFacade();
                    }
                    DataProvider.BeginTransaction();
                    try
                    {
                        OPBOMDetail opBOPDTL = opBOMDetail as OPBOMDetail;
                        this._opBOMFacade.AddOPBOMItem(opBOPDTL);
                        //Laws Lu,2006/09/01

                        /*1,目前工序BOM建立逻辑不变,增加生效检查功能和失效功能,
                         * 初始建立的工序BOM资料处于失效状态,通过生效检查后处于生效状态,
                         * 此时不允许修改,只有失效状态的工序BOM才可以修改。
                         * 生效检查逻辑包括:完整的工序BOM包含的子阶物料(替代料)必须包含某工单所有的已发料物料代码,
                         * 比如,工单发料资料中包含5种物料,则工序BOM中的子阶物料必须也有这五种物料,
                         * 且首选料不能有这五种物料之外的其他物料。具体的工单由用户在界面指定。
                         * 举例如下:工单发料资料中有A,B,C,D四种物料*/
                        //Laws Lu,2006/12/15 取消默认为失效状态

                        MOFacade moFac = (new FacadeFactory(DataProvider)).CreateMOFacade();

                        object objOPBOM = moFac.GetOPBOM(opBOPDTL.ItemCode, opBOPDTL.OPBOMCode, opBOPDTL.OPBOMVersion, GlobalVariables.CurrentOrganizations.First().OrganizationID);
                        //
                        if (objOPBOM != null)
                        {
                            OPBOM opBOM = objOPBOM as OPBOM;

                            opBOM.Avialable = 1;

                            moFac.UpdateOPBOM(opBOM);
                        }
                        // Added by Icyer 2005/08/16
                        // 同时将物料加入到物料主档中
                        BenQGuru.eMES.Material.WarehouseFacade wf = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider);
                        wf.AddWarehouseItem((OPBOMDetail)opBOMDetail);

                        DataProvider.CommitTransaction();
                        // Added end
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex.Message);

                        DataProvider.RollbackTransaction();
                        throw ex;
                    }
                    finally
                    {
                        ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                    }

                    this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                    this.pagerToolBar.RowCount = GetRowCount();
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Add);
                }
            }
            SetcbSourceSBOMEdit(true);
        }