資源簡介
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個文件信息
評論
共有 條評論