Exemplo n.º 1
0
        private void GetPrintDataNew(object sender, DataCallBackEventArgs args)
        {
            DataSet ds = null;
            string  PrintTemplateID = this.PrintTemplateID();

            switch (PrintTemplateID)
            {
            //客户-料品交叉表
            case "ee58e305-07e3-4089-8f59-b23c589d64a5":
            {
                ds = this.GetCustomerItemData();
            }
            break;

            case "e033e009-a4bd-43de-a22d-485a59e0537c":
            {
                ds = this.GetCustomerItemData();
            }
            break;

            default:
                break;
            }
            args.ReturnData = ds;
        }
        private void DataCallBackHandle(object sender, DataCallBackEventArgs args)
        {
            DataSet   dataSet = new DataSet();
            DataTable table   = new DataTable();

            dataSet.Tables.Add(table);
            // 构建表的列
            BuildTableColumns(table);

            GetCompleteApplyBarCodePrintDataProxy getProxy = new GetCompleteApplyBarCodePrintDataProxy();

            getProxy.CompleteApplyBarCodeIDs = GetPrintBarCodeIDs();
            List <CompleteApplyBarCodeDTOData> barCodeDTOs = getProxy.Do();

            if (barCodeDTOs != null && barCodeDTOs.Count > 0)
            {
                foreach (CompleteApplyBarCodeDTOData barCodeDTO in barCodeDTOs)
                {
                    DataRow dataRow = table.NewRow();
                    dataRow["BarCodeID"]     = barCodeDTO.BarCodeID;
                    dataRow["BarCode"]       = barCodeDTO.BarCode;
                    dataRow["ItemID"]        = barCodeDTO.ItemID;
                    dataRow["ItemCode"]      = barCodeDTO.ItemCode;
                    dataRow["ItemName"]      = barCodeDTO.ItemName;
                    dataRow["ItemSPECS"]     = barCodeDTO.ItemSPECS;
                    dataRow["OperatorsID"]   = barCodeDTO.OperatorsID;
                    dataRow["OperatorsCode"] = barCodeDTO.OperatorsCode;
                    dataRow["OperatorsName"] = barCodeDTO.OperatorsName;
                    dataRow["ActualLength"]  = barCodeDTO.ActualLength;
                    dataRow["MarkingLength"] = barCodeDTO.MarkingLength;
                    table.Rows.Add(dataRow);
                }
            }

            args.ReturnData = dataSet;
        }