Ejemplo n.º 1
0
        protected override int Print( )
        {
            int[] rows = gridView1.GetSelectedRows( );

            if (rows.Length < 1)
            {
                XtraMessageBox.Show("请选择需要打印的内容");
                return(0);
            }

            idxList.Clear( );
            foreach (int i in rows)
            {
                model.idx = string.IsNullOrEmpty(gridView1.GetDataRow(i) ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(gridView1.GetDataRow(i) ["idx"].ToString( ));
                if (!idxList.Contains(model.idx.ToString( )))
                {
                    idxList.Add(model.idx.ToString( ));
                }
            }

            if (idxList.Count < 1)
            {
                XtraMessageBox.Show("请选择需要打印的内容");
                return(0);
            }

            strWhere  = "1=1";
            strWhere += " AND A.idx in (" + string.Join(",", idxList) + ")";

            DataTable tablePrint = _bll.getTablePrint(strWhere);

            tablePrint.TableName = "TableOne";
            Print(new DataTable [] { tablePrint }, "二维码.frx");
            idxList.Clear( );

            return(base.Print( ));
        }