当前位置:网站首页>An example of bill printing
An example of bill printing
2022-07-28 06:20:00 【Haile learning】
design sketch :

Technical realization :
The front desk :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RuKD.aspx.cs" Inherits="HuoDGL_DaY_RuKD" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title> Print stock in order </title>
<style>
@media print{
.noprint{
display:none
}
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="DaYGridView" runat="server" AutoGenerateColumns="False"
onrowdatabound="DaYGridView_RowDataBound" BorderWidth="0" PageSize="1" BorderStyle="None" RowStyle-BorderStyle="None" ShowHeader="False" GridLines="None" Width="100%">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td></td>
</tr>
</table>
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr align="center">
<td>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/1.gif" Height="60px" Width="100px" />
</td>
<td colspan="2" align="center"><asp:Label ID="TitleLabel" runat="server"
Font-Size="18px" Text=" Guolitou warehouse of Sinotrans Jiangsu Group Nantong company " Font-Bold="True"/>
<br/><center><asp:Label ID="Label1" runat="server" Font-Size="18px" Text=" Goods warehousing list "
Font-Bold="True"/></center>
</td>
<td></td>
</tr>
<tr>
<td width="25%"> Owner name <asp:TextBox ID="HuoZTextBox" SkinID="hengx" Width="160" runat="server" Text='<%#Bind("HuoZ") %>'></asp:TextBox></td>
<td width="25%"> single Number <asp:TextBox ID="DanJHMTextBox" SkinID="hengx" Width="160" runat="server" Text='<%#Bind("DanJH") %>'></asp:TextBox></td>
<td width="25%"> Preparation date <asp:TextBox ID="ZhiDRQTextBox" Width="160" SkinID="hengx" runat="server" Text='<%#Bind("ZhiDRQ") %>'></asp:TextBox></td>
<td width="25%"></td>
</tr>
<tr>
<td > Pick up warehouse <asp:TextBox ID="CangKMCTextBox" runat="server" Width="160" SkinID="hengx" Text='<%#Bind("CangKMC") %>'/></td>
<td > Nature of delivery <asp:TextBox ID="SongHXZTextBox" runat="server" Width="160" SkinID="hengx" Text='<%#Bind("SongHXZ") %>'/></td>
<td > vehicle Number <asp:TextBox ID="CheHTextBox" Width="160" SkinID="hengx" runat="server"></asp:TextBox></td>
<td></td>
</tr>
<tr>
<td > seal Number <asp:TextBox ID="HuoHTextBox" Width="160" SkinID="hengx" runat="server"></asp:TextBox></td>
<td> Delivery order No <asp:TextBox ID="JiaoHDHTextBox" Width="160" SkinID="hengx" runat="server" Text='<%#Bind("JiaoHDH") %>'/></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="4" align="center">
<asp:GridView ID="MingXGridView" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="NO" FooterText=" remarks ">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField HeaderText=" Name of commodity ">
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="PinMXH" HeaderText=" model ">
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="GuiG" HeaderText=" specifications " />
<asp:BoundField HeaderText=" Company " FooterText=" total " />
<asp:BoundField DataField="ShuL" HeaderText=" Number " />
<asp:BoundField HeaderText=" Paid in amount " />
<asp:BoundField DataField="BeiZ" HeaderText=" remarks " />
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td ><asp:Label ID="BeiZLabel" runat="server" Text=" To prepare notes " Visible="false"/><asp:TextBox ID="BeiZTextBox" SkinID="hengx" runat="server" Text='<%#Bind("BeiZ") %>' Visible="false" /></td>
<td><asp:Label ID="HeJLabel" runat="server" Text=" close meter " Visible="false"/><asp:TextBox ID="HeJTextBox" SkinID="hengx" runat="server" Text='<%#Bind("ShuL") %>' Visible="false" /></td>
<td colspan="2"></td>
</tr>
<tr>
<td> Prepared by <asp:TextBox ID="ZhiDRTextBox" runat="server" SkinID="hengx" Text='<%#Bind("ZhiDR") %>'/></td>
<td> Consignee <asp:TextBox ID="ShouHRTextBox" SkinID="hengx" runat="server"/></td>
<td> Collaborators <asp:TextBox ID="XieZRTextBox" SkinID="hengx" runat="server"/></td>
<td></td>
</tr>
<tr>
<td colspan="3"> explain :1. This warehouse receipt is from the date of issuance 7 Within days :<br/> 2. White copy, financial retention copy , The green copy is the delivery receipt , The blue copy is reserved for the receiving unit , The yellow page is the freight settlement page , The red copy is reserved for the warehouse <br/></td>
<td align="right"> Printer <asp:TextBox ID="TextBox1" Width="110" runat="server" SkinID="hengx" Text='<%#Bind("DaYR") %>'/><br /> Print time <asp:TextBox ID="DaYSJTextBox" Width="110" SkinID="hengx" runat="server" Text='<%#Bind("DaYSJ") %>'></asp:TextBox>
<br/><asp:Label runat="server" ID="YeMLabel" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle CssClass="noprint" />
<RowStyle BorderStyle="None" />
</asp:GridView>
</div>
<p align="center" class="noprint">
<asp:Button ID="DaYButton" runat="server" Text=" Print " onclick="DaYButton_Click" />
<asp:Button ID="GuanBButton" runat="server" onclientclick="window.close();"
Text=" close " /></p>
</form>
</body>
</html>backstage :
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Common;
using System.Collections.Generic;
public partial class HuoDGL_DaY_RuKD : System.Web.UI.Page
{
SqlGetDataBinder SqlGetDataBinder = new SqlGetDataBinder();
int PageRows = 0;
int PageCount = 0;
string BeiZ, ShuL;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["LiuSDH"] != null)
{
ViewState["LiuSDH"] = Request.QueryString["LiuSDH"];
ViewState["UserName"] = Request.QueryString["username"].Replace("td", "");
this.GetDataMessage();
}
}
}
// Get the report data to be bound
protected void GetDataMessage()
{
if (SqlGetDataBinder.GetDataHasRows("select DanH from ChuRKD where LiuSDH='" + ViewState["LiuSDH"].ToString() + "'"))
{
// Get the total number of data
double count = Convert.ToDouble(SqlGetDataBinder.GetFirst("select count(*) from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "'"));
PageCount = Convert.ToInt32(count);
count = count /8;
count = Math.Ceiling(count);
List<string> str = null;
str = SqlGetDataBinder.GetStrList("select ShangJHZXX.ShangJMC,DanH,ChuRKD.BeiZ,CangKMC,SongHXZ,RiQ,CaoZR,JiaoHDH from ChuRKD inner join ShangJHZXX on ShangJHZXX.ShangJBH=ChuRKD.HuoZBH where LiuSDH='" + ViewState["LiuSDH"].ToString() + "'");
ShuL=SqlGetDataBinder.GetFirst("select sum(ShuL) from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "'").ToString();
DataTable table = new DataTable();
table.Columns.Add("HuoZ", typeof(string)); // Shipper
table.Columns.Add("ZhiDRQ", typeof(string)); // Preparation date
table.Columns.Add("DanJH", typeof(string)); // Document number
table.Columns.Add("ZhiDR", typeof(string)); // Prepared by
table.Columns.Add("DaYSJ", typeof(string)); // Print time
table.Columns.Add("Title", typeof(string)); // title
table.Columns.Add("ShuL",typeof(string)); // Number
table.Columns.Add("BeiZ", typeof(string)); // remarks
table.Columns.Add("CangKMC",typeof(string)); // Warehouse name
table.Columns.Add("SongHXZ",typeof(string)); // Nature of delivery
table.Columns.Add("DaYR",typeof(string)); // Printer
table.Columns.Add("JiaoHDH",typeof(string)); // Delivery order No
for (double n = 0; n <count; n++)
{
DataRow row = table.NewRow();
row[0] = str[0];
row[1] = Convert.ToDateTime(str[5]).ToShortDateString();
row[2] = str[1];
row[3] = str[6].ToString();
row[4] = DateTime.Now.ToString("g");
row["BeiZ"] = str[2];
row["ShuL"] = ShuL;
row["CangKMC"] = str[3];
row["SongHXZ"] = str[4];
row["DaYR"] = ViewState["UserName"].ToString();
row["JiaoHDH"] = str[7];
table.Rows.Add(row);
}
PageRows = table.Rows.Count;
this.DaYGridView.DataSource = table;
this.DaYGridView.DataBind();
// Number
int BianH=1;
for (int n = 0; n < this.DaYGridView.Rows.Count; n++)
{
GridView grid = (GridView)this.DaYGridView.Rows[n].FindControl("MingXGridView");
for (int p = 0; p < grid.Rows.Count; p++)
{
if (grid.Rows[p].Cells[2].Text.Replace(" ", "").Trim().Length > 0)
{
grid.Rows[p].Cells[1].Text = str[0];
}
grid.Rows[p].Cells[0].Text = BianH.ToString();
BianH++;
}
}
}
}
protected void DaYGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// The current page number
int count2 = e.Row.RowIndex;
count2 = count2 *8;
// Binding details
GridView grid = (GridView)e.Row.FindControl("MingXGridView");
if (e.Row.RowIndex == PageRows - 1)
{
grid.ShowFooter = true;
int p = PageCount % 8;
if (p == 0)
{
p =8;
}
DataTable table = new DataTable();
table.Columns.Add("PinMXH", typeof(string));
table.Columns.Add("GuiG", typeof(string));
table.Columns.Add("ShuL", typeof(string));
table.Columns.Add("BeiZ", typeof(string));
table.Columns.Add("XuH",typeof(int)); // Serial number
for (int n = 0; n < 8- p; n++)
{
DataRow row = table.NewRow();
row[0] = "";
row[1] = "";
row[2] = "";
row[3] = "";
row[4] = 10000000 + n;
table.Rows.Add(row);
}
table.Merge(SqlGetDataBinder.GetDataTable("select top 8 PinMXH,GuiG,cast(ShuL as varchar(10)) as ShuL,BeiZ,XuH from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "' and PinMXH not in (select top " + count2 + " PinMXH from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "' order by XuH asc) order by XuH asc"));
table.DefaultView.Sort = " XuH asc";
grid.DataSource = table;
grid.DataBind();
grid.FooterRow.Cells[1].ColumnSpan = 3;
grid.FooterRow.Cells[2].Visible = false;
grid.FooterRow.Cells[3].Visible = false;
grid.FooterRow.Cells[1].Text = BeiZ;
grid.FooterRow.Cells[5].Text = ShuL;
}
else
{
grid.DataSource = SqlGetDataBinder.GetDataTable("select top 8 PinMXH,GuiG,ShuL,BeiZ from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "' and PinMXH not in (select top " + count2 + " PinMXH from ChuLKDMXB where DanH='" + ViewState["LiuSDH"].ToString() + "' order by XuH asc) order by XuH asc");
grid.DataBind();
}
// Set page number
int index = e.Row.RowIndex + 1;
((Label)e.Row.FindControl("YeMLabel")).Text = " The first "+index.ToString()+" page , common "+PageRows+" page ";
}
}
protected void DaYButton_Click(object sender, EventArgs e)
{
RegisterStartupScript("c", "<script>window.print();</script>");
}
}notes : This article is reproduced to White clothes Pavilion
边栏推荐
猜你喜欢

在win7 上安装 Visual Studio 2019 步骤 及 vs2019离线安装包

Adaface: quality adaptive margin for face recognition image quality adaptive edge loss for face recognition

Geek challenge 2019-sql injection five questions PW

一个票据打印实例

硬件电路设计学习笔记1--温升设计

(PHP graduation project) based on PHP Gansu tourism website management system to obtain

PLC的选型

Realization of topic function

Tf.keras build neural network function expansion

Research on threat analysis and defense methods of deep learning data theft attack in data sandbox mode
随机推荐
福禄克DSX2-5000 网络线缆测试仪为什么每年都要校准一次?
Fluke fluke aircheck WiFi tester cannot configure file--- Ultimate solution experience
硬件电路设计学习笔记1--温升设计
Difference between shallow copy and deep copy
开关电源电路EMI设计在layout过程中注意事项
一、AMD - OpenVINO环境配置
针对大量数据,MATLAB生成EXCEL文件并进行排版处理的源码
Web滚动字幕(MARQUEE示例)
The number of password errors during login is too many, and the user is blocked,
TCL and eltcl? Cdnext and CMRL?
(PHP graduation project) based on PHP Gansu tourism website management system to obtain
Deep learning (II) into machine learning and deep learning programming
CString转char[]函数
生活随机-1
USB Network Native Driver for ESXi更新到支持ESXi7.0.1
Which enterprises are suitable for small program production and small program development?
(PHP graduation project) obtained based on PHP novel website management system
1、 Speech synthesis and autoregressive model
ESXi社区版网卡驱动再次更新
电快速脉冲群(EFT)设计-EMC系列 硬件设计笔记4