Exemple #1
0
        private void BindDataGridView()
        {
            STK_StockReserveParam param = new STK_StockReserveParam();

            param.Model              = txtModel.Text.Trim();
            param.SourceBillGuid     = SourceBillGuid;
            param.SourceBillLineGuid = SourceBillLineGuid;
            param.SRGuid             = SRGuid;
            param.Model              = Model;
            param.NoSRGuids          = NoSRGuids;
            List <STK_StockReserveResult> lstRst = reserveLogic.GetList(param);

            dgvStockReserve.DataSource = lstRst;
            this.SetDataSource <STK_StockReserveResult>(lstRst);
            SetGridCheck(this.dgvStockReserve, _idColName, _chkColName);
        }
Exemple #2
0
        void BindSuperGridControl()
        {
            List <ORD_PurchaseNoticeResult> noticeList = noticeLogic.GetList(new ORD_PurchaseNoticeParam()
            {
                SOGuid = soguid
            });

            if (noticeList != null)
            {
                usgNoticed.PrimaryGrid.DataSource = noticeList;
            }
            List <STK_StockReserveResult> reserveList = reserveLogic.GetList(new STK_StockReserveParam()
            {
                SourceBillGuid = soguid
            });

            if (reserveList != null)
            {
                usgReserve.PrimaryGrid.DataSource = reserveList;
            }
        }
Exemple #3
0
        public void InitSourceData(string billType, object obj)
        {
            if (obj != null)
            {
                if (cboBillType.SelectedValue.ToStringHasNull() == "")
                {
                    SYS_DictItemLineLogic.SetCombolSelectedIndex(cboBillType, billType, true);
                }
                if (obj is ORD_SalesOrderResult)
                {
                    ORD_SalesOrderResult salesOrderResult = obj as ORD_SalesOrderResult;
                    if (salesOrderResult != null)
                    {
                        txtSourceBillGuid.Text    = salesOrderResult.SOGuid.ToStringHasNull();
                        txtSourceBillNo.Text      = salesOrderResult.BillNo;
                        cboTaxRate.SelectedValue  = salesOrderResult.TaxRate == null ? 0 : salesOrderResult.TaxRate;
                        cboCurrency.SelectedValue = salesOrderResult.Currency;
                        List <STK_StockReserveResult> reserveList = reserveLogic.GetList(new STK_StockReserveParam()
                        {
                            SourceBillGuid = salesOrderResult.SOGuid, IsUsedOver = false
                        });
                        List <ORD_SalesOrderLineResult> lineList = null;
                        if (salesOrderResult.OrderLineList != null)//从其他窗体点击出库进入,只传递guid,通过guid获取的对象中含有明细
                        {
                            lineList = salesOrderResult.OrderLineList.Where(a => a.StkOutOccQty.ToInt32() < a.Qty).ToList();
                        }
                        else//在出库窗体打开选择窗体得到的对象是没有包含明细的,需要去单独获取明细
                        {
                            lineList = orderLineLogic.GetList(new ORD_SalesOrderLineParam()
                            {
                                SOGuid = salesOrderResult.SOGuid
                            }).Where(a => a.StkOutOccQty.ToInt32() < a.Qty).ToList();
                        }

                        foreach (STK_StockReserveResult reserveResult in reserveList)
                        {
                            STK_OutLineResult        stkOutLineResult = new STK_OutLineResult();
                            ORD_SalesOrderLineResult lineResult       = lineList.FirstOrDefault(a => a.SOLineGuid == reserveResult.SourceBillLineGuid);
                            if (lineResult != null)
                            {
                                stkOutLineResult.UnitPrice = lineResult.UnitPrice;
                            }
                            SetStkLineObjectValue(stkOutLineResult, reserveResult);
                            bsStkOutLine.Add(stkOutLineResult);
                        }
                    }
                }
                else if (obj is ORD_PurchaseReturnResult)
                {
                    ORD_PurchaseReturnResult purReturnResult = obj as ORD_PurchaseReturnResult;
                    if (purReturnResult != null)
                    {
                        txtSourceBillGuid.Text = purReturnResult.POGuid.ToStringHasNull();
                        txtSourceBillNo.Text   = purReturnResult.BillNo;
                        decimal?taxRate = 0;
                        cboTaxRate.SelectedValue  = taxRate;
                        cboCurrency.SelectedValue = purReturnResult.Currency;
                        List <STK_StockReserveResult> reserveList = reserveLogic.GetList(new STK_StockReserveParam()
                        {
                            SourceBillGuid = purReturnResult.PRGuid, IsUsedOver = false
                        });
                        List <ORD_PurchaseReturnLineResult> lineList = null;
                        if (purReturnResult.ReturnLineList != null)
                        {
                            lineList = purReturnResult.ReturnLineList.Where(a => a.StkOutOccQty.ToInt32() < a.Qty).ToList();
                        }
                        else
                        {
                            lineList = returnLineLogic.GetList(new ORD_PurchaseReturnLineParam()
                            {
                                PRGuid = purReturnResult.PRGuid
                            }).Where(a => a.StkOutOccQty.ToInt32() < a.Qty).ToList();
                        }

                        foreach (STK_StockReserveResult reserveResult in reserveList)
                        {
                            STK_OutLineResult            stkOutLineResult = new STK_OutLineResult();
                            ORD_PurchaseReturnLineResult lineResult       = lineList.FirstOrDefault(a => a.PRLineGuid == reserveResult.SourceBillLineGuid);
                            if (lineResult != null)
                            {
                                stkOutLineResult.UnitPrice = lineResult.UnitPrice;
                            }
                            SetStkLineObjectValue(stkOutLineResult, reserveResult);
                            bsStkOutLine.Add(stkOutLineResult);
                        }
                    }
                }
                CalcExchangeRate();
            }
        }