当前位置:网站首页>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
边栏推荐
- ESXi on ARM v1.2 (2020年11月更新)
- Deep learning (II) into machine learning and deep learning programming
- Cyclic neural network
- PLC的选型
- Model Inversion Attacks that Exploit Confidence Informati on and Basic Countermeasures 阅读心得
- 使用MS图表控件创建基本报表
- Reversible watermarking method based on difference expansion
- N positions of bouncing shell
- VB-ocx应用于Web
- AEM online product promotion conference - Cable certification tester
猜你喜欢

AEM testpro K50 and south Guangdong survey

(PHP graduation design) obtained based on PHP fruit sales store management system

浪涌冲击抗扰度实验(SURGE)-EMC系列 硬件设计笔记6

Getting started with latex

Basic usage of word2vec and Bert

Protecting Against DNN Model Stealing Attacks 论文阅读心得

3、 Openvino practice: image classification

(PHP graduation project) based on PHP user online submission management system

Best practices to ensure successful deployment of Poe devices

深度学习数据窃取攻击在数据沙箱模式下的威胁分析与防御方法研究阅读心得
随机推荐
Agilent Agilent e5071 test impedance and attenuation are normal, except crosstalk ng--- Repair plan
(PHP graduation project) obtained based on PHP novel website management system
ESXi on Arm 10/22 更新
The difference between router and switch
Nanjing University of Posts and Telecommunications CTF topic writeup (II) including topic address
Tensorflow2.1 basic concepts and common functions
(PHP graduation project) based on PHP user online submission management system
MAE 掩码自编码是可扩展的学习
端接电阻详解 信号完整系列 硬件学习笔记7
EXFO 730c optical time domain reflectometer only has IOLm optical eye to upgrade OTDR (open OTDR permission)
(PHP graduation project) based on thinkphp5 community property management system
Differences between processes and threads
Fluke fluke aircheck WiFi tester cannot configure file--- Ultimate solution experience
Triode design, understanding saturation, linear region and cut-off region
硬件电路设计学习笔记1--温升设计
ESXi Arm Edition version 1.10更新
What are the general wechat applet development languages?
How to view the transfer function of the module directly built by Simulink
1、 Amd - openvino environment configuration
在Asp.net 中Cookie的用法