Example #1
0
    private void InitPageParameter()
    {
        IList <ProductLineInProcessLocationDetail> productLineIpList = new List <ProductLineInProcessLocationDetail>();

        if (tbProductLine.Text.Trim() != string.Empty)
        {
            productLineIpList = TheProductLineInProcessLocationDetailMgr.GetProductLineInProcessLocationDetailGroupByItem(this.tbProductLine.Text.Trim(), BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE);
        }

        this.GV_List.DataSource = productLineIpList;
        this.GV_List.DataBind();
    }
Example #2
0
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     try
     {
         TheProductLineInProcessLocationDetailMgr.RawMaterialIn(this.tbProductLine.Text.Trim(), GetMaterialInList(), this.CurrentUser);
         ShowSuccessMessage("MasterData.Feed.MaterialIn.Successfully");
         InitPageParameter();
     }
     catch (BusinessErrorException ex)
     {
         ShowErrorMessage(ex);
     }
 }
Example #3
0
    protected void lbtnDelete_Click(object sender, EventArgs e)
    {
        int id = int.Parse(((LinkButton)sender).CommandArgument);

        try
        {
            TheProductLineInProcessLocationDetailMgr.DeleteProductLineInProcessLocationDetail(id);
            this.ShowSuccessMessage("MasterData.Feed.MaterialIn.Delete.Successfully");
            UpdateView();
        }
        catch (BusinessErrorException ex)
        {
            this.ShowErrorMessage(ex);
        }
    }
Example #4
0
    public void UpdateView()
    {
        InitialHuInput();

        #region 已投料
        if (tbProductLine.Text.Trim() != string.Empty)
        {
            this.GV_List_Feeded.DataSource = TheProductLineInProcessLocationDetailMgr.GetProductLineInProcessLocationDetail(this.tbProductLine.Text.Trim(), BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE);
            this.GV_List_Feeded.DataBind();
        }
        #endregion

        #region 新投料

        //BindTransformer(this.TransformerDetailList);
        BindTransformerDetail();

        #endregion
    }
Example #5
0
    public void InitPageParameter()
    {
        #region 已投料
        IList <ProductLineInProcessLocationDetail> productLineIpList = new List <ProductLineInProcessLocationDetail>();
        if (tbProductLine.Text.Trim() != string.Empty)
        {
            productLineIpList = TheProductLineInProcessLocationDetailMgr.GetProductLineInProcessLocationDetail(this.tbProductLine.Text.Trim(), BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE);
        }
        this.GV_List_Feeded.DataSource = productLineIpList;
        this.GV_List_Feeded.DataBind();
        #endregion

        #region 新投料
        //todo 根据flow得到Material的list
        IList <BomDetail>  bomDetailList  = new List <BomDetail>();
        IList <MaterialIn> materialInList = new List <MaterialIn>();
        if (this.tbProductLine.Text.Trim() != string.Empty)
        {
            bomDetailList = TheFlowMgr.GetBatchFeedBomDetail(this.tbProductLine.Text.Trim());
        }


        //暂时放在页面,后面再抽出来
        Flow flow = TheFlowMgr.LoadFlow(this.tbProductLine.Text.Trim(), true);
        if (bomDetailList != null && bomDetailList.Count > 0)
        {
            foreach (BomDetail bomDetail in bomDetailList)
            {
                MaterialIn materialIn = new MaterialIn();
                materialIn.Location    = bomDetail.Location;
                materialIn.Operation   = bomDetail.Operation;
                materialIn.RawMaterial = bomDetail.Item;

                //来源库位查找逻辑BomDetail-->RoutingDetail-->FlowDetail-->Flow
                Location bomLocFrom = bomDetail.Location;

                if (flow.Routing != null)
                {
                    //在Routing上查找,并检验Routing上的工序和BOM上的是否匹配
                    RoutingDetail routingDetail = TheRoutingDetailMgr.LoadRoutingDetail(flow.Routing, bomDetail.Operation, bomDetail.Reference);
                    if (routingDetail != null)
                    {
                        if (bomLocFrom == null)
                        {
                            bomLocFrom = routingDetail.Location;
                        }
                    }
                }

                if (bomLocFrom == null)
                {
                    bomLocFrom = bomDetail.DefaultLocation;
                }
                materialIn.Location = bomLocFrom;
                bool isInclude = false;
                foreach (MaterialIn m in materialInList)
                {
                    if (m.Location.Code == materialIn.Location.Code && m.Operation == materialIn.Operation && m.RawMaterial.Code == materialIn.RawMaterial.Code)
                    {
                        isInclude = true;
                    }
                }
                if (!isInclude)
                {
                    materialInList.Add(materialIn);
                }
            }
        }
        this.GV_List.DataSource = materialInList;
        this.GV_List.DataBind();
        #endregion
    }