• 大小: 662KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-15
  • 语言: C#
  • 标签: c#  

资源简介

C#打印实例--打印商品出库单实例源码(亲测可用)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace PrintGoodsOutBill
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        #region 定义全局变量及对象
        string strCon = “Data Source=(local);Database=db_04;Uid=sa;Pwd=;“;
        public static string strID = ““;
        public static string strOutPeople = ““;
        public static string strOutProvider = ““;
        public static string strPlace = ““;
        public static string strGID = ““;
        public static string strGName = ““;
        public static string strGSpec = ““;
        public static string strGUnit = ““;
        public static string strGMoney = ““;
        public static string strGNum = ““;
        public static string strSMoney = ““;
        public static string strInDate = ““;
        public static string strRemark = ““;
        SqlConnection sqlcon;
        SqlDataAdapter sqlda;
        DataSet myds;
        #endregion

        //窗体初始化时显示所有入库信息
        private void Form1_Load(object sender EventArgs e)
        {
            sqlcon = new SqlConnection(strCon);
            sqlda = new SqlDataAdapter(“select * from tb_OutGoods“sqlcon);
            myds = new DataSet();
            sqlda.Fill(myds);
            dgvInfo.DataSource = myds.Tables[0];
        }

        //记录选中的出库单的详细信息
        private void dgvInfo_CellClick(object sender DataGridViewCellEventArgs e)
        {
            try
            {
                strID = dgvInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                strOutPeople = dgvInfo.Rows[e.RowIndex].Cells[1].Value.ToString();
                strOutProvider = dgvInfo.Rows[e.RowIndex].Cells[2].Value.ToString();
                strPlace = dgvInfo.Rows[e.RowIndex].Cells[3].Value.ToString();
                strGID = dgvInfo.Rows[e.RowIndex].Cells[4].Value.ToString();
                strGName = dgvInfo.Rows[e.RowIndex].Cells[5].Value.ToString();
                strGSpec = dgvInfo.Rows[e.RowIndex].Cells[6].Value.ToString();
                strGUnit = dgvInfo.Rows[e.RowIndex].Cells[7].Value.ToString();
                strGMoney = “¥“ + dgvInfo.Rows[e.RowIndex].Cells[8].Value.ToString();
                strGNum = dgvInfo.Rows[e.RowIndex].Cells[9].Value.ToString();
                strSMoney = “¥“ + dgvInfo.Rows[e.RowIndex].Cells[10].Value.ToString();
                strInDate = dgvInfo.Rows[e.RowIndex].Cells[11].Value.ToString();
                strRemark = dgvInfo.Rows[e.RowIndex].Cells[12].Value.ToString();
            }
            catch { }
        }

        //打印
        private void btnPrint_Click(object sender EventArgs e)
        {
            printPreviewDialog1.ShowDialog();
        }

        //设置打印的商品出库单据
        private voi

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8379  2009-01-17 08:56  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Form1.cs

     文件       4634  2009-01-17 08:49  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Form1.designer.cs

     文件      21937  2009-01-17 08:49  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Form1.resx

     文件       3780  2009-01-16 16:43  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\PrintGoodsOutBill.csproj

     文件        498  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Program.cs

     文件       1390  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Properties\AssemblyInfo.cs

     文件       2884  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Properties\Resources.Designer.cs

     文件       5612  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Properties\Resources.resx

     文件       1102  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Properties\Settings.Designer.cs

     文件        249  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill\Properties\Settings.settings

     文件        941  2009-01-16 16:41  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill.sln

    ..A..H.     17920  2009-02-10 10:22  C#打印实例--打印商品出库单实例源码(亲测可用)\Backup\PrintGoodsOutBill.suo

     文件    1638400  2010-08-18 17:50  C#打印实例--打印商品出库单实例源码(亲测可用)\db\db_04_Data.MDF

     文件    1048576  2010-08-18 17:50  C#打印实例--打印商品出库单实例源码(亲测可用)\db\db_04_Log.LDF

     文件      25600  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\bin\Debug\PrintGoodsOutBill.exe

     文件      32256  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\bin\Debug\PrintGoodsOutBill.pdb

     文件      11608  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\bin\Debug\PrintGoodsOutBill.vshost.exe

     文件       8374  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\Form1.cs

     文件       6239  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\Form1.designer.cs

     文件      21937  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\Form1.resx

     文件        789  2019-02-22 12:30  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6119  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1569  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.csproj.FileListAbsolute.txt

     文件        847  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.csproj.GenerateResource.Cache

     文件      25600  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.exe

     文件      10728  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.Form1.resources

     文件      32256  2019-02-22 12:32  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.pdb

     文件        180  2019-02-22 12:31  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\PrintGoodsOutBill.Properties.Resources.resources

     文件       4608  2019-02-22 12:30  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       4099  2019-02-22 12:30  C#打印实例--打印商品出库单实例源码(亲测可用)\PrintGoodsOutBill\PrintGoodsOutBill.csproj

............此处省略31个文件信息

评论

共有 条评论