Example #1
0
    public void InitPageParameter(Flow flow)
    {
        this.PartyFromCode = flow.PartyFrom.Code;
        this.PartyToCode   = flow.PartyTo.Code;
        this.FlowType      = flow.Type;
        this.FlowCode      = flow.Code;

        int seqInterval = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value);

        if (flow.AllowCreateDetail && false) //新增的Detail打印有问题,暂时不支持
        {
            FlowDetail blankFlowDetail = new FlowDetail();
            if (flow.FlowDetails == null || flow.FlowDetails.Count == 0)
            {
                blankFlowDetail.Sequence = seqInterval;
            }
            else
            {
                int CurrentSeq = flow.FlowDetails.Last <FlowDetail>().Sequence + seqInterval;
                blankFlowDetail.Sequence = CurrentSeq;
            }
            blankFlowDetail.IsBlankDetail = true;
            flow.AddFlowDetail(blankFlowDetail);
        }

        #region 设置默认LotNo
        string lotNo = LotNoHelper.GenerateLotNo();
        foreach (FlowDetail flowDetail in flow.FlowDetails)
        {
            flowDetail.HuLotNo = lotNo;
        }
        #endregion

        this.GV_List.DataSource = flow.FlowDetails;
        this.GV_List.DataBind();

        BindShift();

        if (flow.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
        {
            this.TabProd.Visible            = false;
            this.GV_List.Columns[8].Visible = true;
        }
        else
        {
            this.TabProd.Visible            = true;
            this.GV_List.Columns[8].Visible = false;
        }
    }