コード例 #1
0
ファイル: RepAsnTransfer.cs プロジェクト: uwitec/wms-1
        public RepAsnTransfer(int billID, short copies)
            : this()
        {
            BillID      = billID;
            this.copies = copies;

            //获取数据
            try
            {
                header = GetBillHeader(BillID);
                WarehouseEntity warehouseEntity = GetWarehouseByCode(header.Sales);
                if (warehouseEntity != null)
                {
                    this.lblFormWarehouse.Text = warehouseEntity.WarehouseName;
                }
                else
                {
                    this.lblFormWarehouse.Text = header.Sales;
                }
                this.xrLabel10.Text = GlobeSettings.LoginedUser.WarehouseName;
                List <PODetailEntity> details = GetDetailByBillID(BillID);

                dataSource         = new ASNBody();
                dataSource.Header  = header;
                dataSource.Details = details;
                decimal n = 0;
                foreach (PODetailEntity entity in this.dataSource.Details)
                {
                    decimal num = Math.Ceiling(ConvertUtil.ToDecimal(entity.MaterialName.Length) / ConvertUtil.ToDecimal(12));
                    if (num > 2)
                    {
                        n += num;
                    }
                }
                // 更新打印次数
                if (header.Printed == 0)
                {
                    this.xrLabel7.Text = (header.Printed + 1).ToString();
                    UpdatePrinted(header.BillID, header.Printed);
                    header.Printed++;
                    UpdatePrinted(header.BillID, header.Printed);
                }
                else
                {
                    header.Printed++;
                    this.xrLabel7.Text = header.Printed.ToString();
                    UpdatePrinted(header.BillID, header.Printed);
                }

                this.PageHeight = (int)(details.Count + n) * 65 + 920;
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
        }
コード例 #2
0
ファイル: RepAsn.cs プロジェクト: uwitec/wms-1
        public RepAsn(int billID, short copies, int tag)
            : this()
        {
            BillID      = billID;
            this.copies = copies;

            //获取数据
            try
            {
                header = GetBillHeader(BillID);
                List <PODetailEntity> details = GetDetailByBillID(BillID);

                dataSource         = new ASNBody();
                dataSource.Header  = header;
                dataSource.Details = details;
                decimal n = 0;
                foreach (PODetailEntity entity in this.dataSource.Details)
                {
                    decimal num = Math.Ceiling(ConvertUtil.ToDecimal(entity.MaterialName.Length) / ConvertUtil.ToDecimal(12));
                    if (num > 2)
                    {
                        n += num;
                    }
                }
                // 更新打印次数
                //header.Printed++;
                //this.xrLabel4.Text = header.Printed.ToString();
                UpdatePrinted(header.BillID, header.Printed);
                if (tag == 1)
                {
                    header.Printed++;
                    this.xrLabel4.Text = header.Printed.ToString();
                    UpdatePrinted(header.BillID, header.Printed);
                    this.xrlblUnin.Text = "*记账联*";
                }
                else
                {
                    this.xrlblUnin.Text = "*供应商存查联*";
                    this.xrLabel4.Text  = header.Printed.ToString();
                }
                this.PageHeight = (int)(details.Count + n) * 65 + 1000;
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
        }