zoukankan      html  css  js  c++  java
  • ERP出库审核业务(四十四)

    结束表单流程的代码:

       protected void btnSubmit_Click(object sender, EventArgs e)
            {
                if(this.txtreceiveDate.Text!="")
                {
                    SqlComm.UpdateTableByCondition("BioSendAppInfo", "receiveDate='" + Convert.ToDateTime(this.txtreceiveDate.Text) + "'", "SendId=" + taskid);
                }
            }
    

    根据销售表单统计此表单总金额:

    -- Description:	根据销售表单统计此表单总金额
    -- =============================================
    ALTER FUNCTION [dbo].[FN_getSendTotalMoneyBySendID] 
    (
    	@SendID int
    )
    RETURNS money
    AS
    BEGIN
    	DECLARE @TotalMoney money
    	
    SELECT @TotalMoney=sum(ProPrice*ProCount) FROM dbo.BioSendGoodsPro
    WHERE SendID=@SendID
        RETURN @TotalMoney
    
    END
    

     创建查询视图:

    CREATE VIEW [dbo].[View_SendAppInfoShowList]
    AS
    SELECT *,AuditingSate=dbo.FN_CurrentAuditingSate(3,SendId),
        Transmitter=ISNULL(dbo.FN_CurrentTransmitter(3,SendId),'数据错误'),
    	Listid= ISNULL(dbo.FN_GetDynamicId(3,SendId),0),
    SendTotal=dbo.FN_getSendTotalMoneyBySendID(SendId) FROM dbo.View_BioSendAppInfo
    

     产品销售发货列表查询:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendGoodsListShow.aspx.cs" Inherits="BioErpWeb.SendGoods.SendGoodsListShow" %>
    <%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
    <%@ Register src="../UserControl/SendProTop.ascx" tagname="SendProTop" tagprefix="uc1" %>
    <!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></title>
        <link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" />
        <link href="../Styles/AspNetPagerStyle.css" rel="stylesheet" type="text/css" />
        <link href="../Styles/InputStyle1.css" rel="stylesheet" type="text/css" />
        <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
        <link href="../Scripts/jquery-ui-1.7.custom.css" rel="stylesheet" type="text/css" />
        <script src="../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script>  
        
        <script type="text/javascript">
            $().ready(function () {
                $("#txtOrderTime").datepicker({ dateFormat: 'yy-mm-dd' });
            });
        </script>
    
    
    </head>
    
    <body>
        <form id="form1" runat="server">     
        <div>
             <table class="Inupttable" style=" 900px; margin:0px auto;">
                 <tr>
                     <td colspan="5">               
                         <uc1:SendProTop ID="SendProTop1" runat="server" />               
                     </td>
                 </tr>
                 <tr>
                     <td class="tdsearch">
                         <asp:Label ID="Label1" runat="server" Text="主题:"></asp:Label>
                         <asp:TextBox ID="txtName" runat="server" Width="100px"></asp:TextBox>
                     </td>
                     <td class="tdsearch">
                      <asp:Label ID="Label2" runat="server" Text="申请申请人:"></asp:Label>
                         <asp:TextBox ID="txtUserName" runat="server"  Width="100px"></asp:TextBox>
                    </td>
                      <td class="tdsearch">
                         <asp:Label ID="Label11" runat="server" Text="提交时间"></asp:Label>
                         <asp:TextBox ID="txtOrderTime" runat="server"  Width="100px"></asp:TextBox>
                    </td>
                     <td class="tdsearch">
                         <asp:Label ID="Label3" runat="server" Text="是否删除"></asp:Label>
                         <asp:DropDownList ID="ddlState" runat="server">
                             <asp:ListItem Value="0">否</asp:ListItem>
                             <asp:ListItem Value="1">是</asp:ListItem>
                         </asp:DropDownList>
                     </td>
                       
                     <td class="tdsearch">
                         <asp:ImageButton ID="imgbutnSearch" Width="60" Height="22" runat="server" 
                             ImageUrl="~/Web/images/Btnsearch.gif" onclick="imgbutnSearch_Click" /> 
                         </td>
                 </tr>
                 <tr>
                     <td colspan="6" class="bottomtd">
                         <asp:GridView ID="GridView1" Width="100%"  runat="server"  AutoGenerateColumns="False" DataKeyNames="SendID">
                             <Columns>                   
                               <asp:HyperLinkField DataNavigateUrlFields="SendID,Listid" DataNavigateUrlFormatString="ToOtherAspx.aspx?id={0}&listid={1}"
                                    DataTextField="Subject" Target="MainFrame" HeaderText="主题"> 
                                    <ItemStyle  Width="150px" HorizontalAlign="Center" />  
                                    <HeaderStyle Width="150px"  HorizontalAlign="Center"/>
                                </asp:HyperLinkField>
    
    
                                 <asp:BoundField  DataField="AuditingSate" HeaderText="状态" HeaderStyle-HorizontalAlign="Center"/>
                                 
                                 
    
                                   <asp:TemplateField HeaderText="订货申请人" HeaderStyle-HorizontalAlign="Center">
                                     <ItemTemplate>
                                          <asp:Label ID="Label8" runat="server" Text='<%#Eval("AppUserName") %>'></asp:Label>
                                     </ItemTemplate>
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />
                                 </asp:TemplateField>
                              
                                 <asp:TemplateField HeaderText="申请发货部门" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="Label9" runat="server" Text='<%# Eval("Departname") %>'></asp:Label>
                                     </ItemTemplate>   
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />                          
                                 </asp:TemplateField>
    
                                   <asp:TemplateField HeaderText="发货公司" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="Label9" runat="server" Text='<%# Eval("OurCom") %>'></asp:Label>
                                     </ItemTemplate>   
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />                          
                                 </asp:TemplateField>
    
    
                                   <asp:TemplateField HeaderText="订货单位" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="Label9" runat="server" Text='<%# Eval("ReceiveComName") %>'></asp:Label>
                                     </ItemTemplate>   
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />                          
                                 </asp:TemplateField>
                                   <asp:TemplateField HeaderText="订货时间" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="lbortime" runat="server" Text='<%#  Convert.ToDateTime(Eval("submitTime")).ToString("yyyy-MM-dd") %>'></asp:Label>
                                     </ItemTemplate>   
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />                          
                                 </asp:TemplateField>
                                   <asp:TemplateField HeaderText="订货总额" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="lbtotal" runat="server" Text='<%# Eval("SendTotal") %>'></asp:Label>
                                     </ItemTemplate>   
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />                          
                                 </asp:TemplateField>
                                 <asp:TemplateField HeaderText="传达人" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                          <asp:Label ID="Label10" runat="server" Text='<%#Eval("Transmitter").ToString()%>'></asp:Label>
                                     </ItemTemplate>
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                     <ItemStyle HorizontalAlign="Center" />
                                 </asp:TemplateField> 
                                     
                                     
                                <asp:TemplateField HeaderText="" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                         <a href="SendGoodsShow.aspx?taskid=<%#Eval("SendID") %>&listid=<%#Eval("Listid")%>">查看详细</a>
                                     </ItemTemplate>
    
    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
    
                                     <ItemStyle HorizontalAlign="Center" />
                                 </asp:TemplateField>                
                               
                             </Columns>
                         </asp:GridView>
                     </td>
                 </tr>
                 <tr>
                  <td  colspan="5">
                      <webdiyer:AspNetPager ID="AspNetPager1" runat="server"    CssClass="paginator" CurrentPageButtonClass="cpb"
                          onpagechanged="AspNetPager1_PageChanged" FirstPageText="第一页" 
                          LastPageText="末页" NextPageText="下一页" PrevPageText="上一页">
                      </webdiyer:AspNetPager>
                     </td>
                 </tr>
                 <tr><td  colspan="5"  style=" text-align:center;">
                     <asp:Button ID="Button1" runat="server" Text="报表导出" 
                         onclick="Button1_Click" Width="100px" CssClass="btnorange"/></td></tr>
    
         </table>
    
        </div>
        </form>
    </body>
    </html>
    

     后台代码:

    public partial class SendGoodsListShow: BasePage
        {
            
            public static int pageindex = 0;
            public static int pagesize = 10;
            public static string condition = "";
    
            protected void Page_Load(object sender, EventArgs e)
            {
                //Session["Userid"] = "29";
                if (Session["Userid"] == null)
                {
                    Response.Redirect("../../web/UserLogin.aspx");
                }
    
            
                if (!IsPostBack)
                {
                    getallBioCRMContractList();
                }
            }
    
    
    
            /// <summary>
            /// 查询所有员工信息
            /// </summary>
            private void getallBioCRMContractList()
            {
                //如果有发货管理权限(特许权限)的人员可以查看所有表单 
                if (SqlComm.getUserRightsByUserId(Session["Userid"].ToString()).Contains(",51,"))
                {
                    this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_SendAppInfoShowList", condition);
                    this.AspNetPager1.PageSize = pagesize;
                    this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_SendAppInfoShowList", "*", "SendId", condition, pageindex, pagesize);
                    this.GridView1.DataBind();
                }
                else if (Web.UserLogin.user.RoleId == ((int)RoseEmun.DepartMentManager))
                {
                    condition = condition + " and DepartMentID=" + Web.UserLogin.user.DepartmentId;
                    this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_SendAppInfoShowList", condition);
                    this.AspNetPager1.PageSize = pagesize;
                    this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_SendAppInfoShowList", "*", "SendId", condition, pageindex, pagesize);
                    this.GridView1.DataBind();
                }
                else //员工只能看自己的购进单
                {
                    condition = condition + " and AppUserId=" + Session["Userid"].ToString();
                    this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_SendAppInfoShowList", condition);
                    this.AspNetPager1.PageSize = pagesize;
                    this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_SendAppInfoShowList", "*", "SendId", condition, pageindex, pagesize);
                    this.GridView1.DataBind();
                }
                
                for (int i = 0; i < GridView1.Rows.Count; i++)
                {
                    switch (GridView1.Rows[i].Cells[1].Text)
                    {
                        case "0":
                            GridView1.Rows[i].Cells[1].Text = "待审核";
                            GridView1.Rows[i].Cells[1].ForeColor = System.Drawing.Color.Green;
                            break;
                        case "2":
                            GridView1.Rows[i].Cells[1].Text = "执行中";
                            GridView1.Rows[i].Cells[1].ForeColor = System.Drawing.Color.Orange;
                            break;
                        case "3":
                            GridView1.Rows[i].Cells[1].Text = "已完成";
                            GridView1.Rows[i].Cells[1].ForeColor = System.Drawing.Color.Green;
                            break;
                        default:
                            GridView1.Rows[i].Cells[1].Text = "出现错误";
                            break;
                    }
    
                }
            }
    
            protected void AspNetPager1_PageChanged(object sender, EventArgs e)
            {
                pageindex = this.AspNetPager1.CurrentPageIndex - 1;
                getallBioCRMContractList();
            }
    
            protected void imgbutnSearch_Click(object sender, ImageClickEventArgs e)
            {
                pageindex = 0;
                condition = "";
                if (txtName.Text.Trim() != null && this.txtName.Text.Trim().Length != 0)
                {
                    condition = condition + " and Subject like '" + txtName.Text + "%'";
                }
    
                if (this.txtUserName.Text.Trim() != null && this.txtUserName.Text.Trim().Length != 0)
                {
                    condition = condition + " and AppUserName like '" + txtUserName.Text + "%'";
                }
    
                if (this.ddlState.SelectedValue == "1")
                {
                    condition = condition + " and DeleteSate ='True'";
                }
                else
                {
                    condition = condition + " and DeleteSate ='False'";
                }
    
                if (this.txtOrderTime.Text.Trim() != null && this.txtOrderTime.Text.Trim().Length != 0)
                {
                    condition = condition + " and (submitTime>= '" + Convert.ToDateTime(this.txtOrderTime.Text) + "' and  submitTime<'" + Convert.ToDateTime(this.txtOrderTime.Text).AddDays(1) + "')";
                }
    
                getallBioCRMContractList();
    
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                Response.Redirect("../SendGoods/BaoBiao/SendProInfoOutput.aspx");
            }
        }
    

     权限的判断:

    public partial class ToOtherAspx :BasePage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (Request.QueryString["id"] == null || Request.QueryString["listid"] == null)
                {
                    Response.Redirect("SendGoodsListShow.aspx");
                    return;
                }
    
                string id = Request.QueryString["id"].ToString();
                string listid = Request.QueryString["listid"].ToString();
                System.Data.DataTable dt = CommTool.SqlComm.GetDataByCondition("dbo.TaskListRecord", "ListID,TaskID,TaskTableID,Accepter,AuditingSate", " ListID=" + listid).Tables[0];
                if (dt.Rows.Count == 0)
                {
                    Response.Redirect("SendGoodsListShow.aspx");
                    return;
                }
    
                if (dt.Rows[0]["Accepter"].ToString() != Session["Userid"].ToString())
                {
                    Response.Redirect("SendGoodsShow.aspx?taskid=" + id + "&listid=" + listid);
                    return;
                }
                else
                {
                    if (dt.Rows[0]["AuditingSate"].ToString() == "0")
                    {
                        Response.Redirect("SendGoodsEdit.aspx?taskid=" + id + "&listid=" + listid);
                        return;
                    }
                    else if (dt.Rows[0]["AuditingSate"].ToString() == "2")
                    {
                        Response.Redirect("SendGoodsRun.aspx?taskid=" + id + "&listid=" + listid);
                        return;
                    }
                    else if (dt.Rows[0]["AuditingSate"].ToString() == "3")
                    {
                        Response.Redirect("SendGoodsShow.aspx?taskid=" + id + "&listid=" + listid);
                        return;
                    }
                    else
                    {
                        Response.Redirect("SendGoodsListShow.aspx");
                        return;
                    }
                }
            }
        }
    

     水晶报表打印:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendProInfoOutput.aspx.cs" Inherits="BioErpWeb.SendGoods.BaoBiao.SendProInfoOutput" %>
    
    <%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
    
    <!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></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        
        </div>
        <rsweb:ReportViewer ID="ReportViewer1" Width="100%" runat="server" 
            Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(集合)" 
            WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
            <LocalReport ReportPath="SendGoodsBaoBiaoReport1.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BioErpDbConnectionString %>" 
            SelectCommand="SELECT * FROM [View_SendAppInfoShowList]">
        </asp:SqlDataSource>
        </form>
    </body>
    </html>
    

     出库单打印:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChuKuPrint.aspx.cs" Inherits="BioErpWeb.Print.ChuKuPrint" %>
    
    <!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 id="Head1"  runat="server">
        <title>产品出库(验收、通知)单打印</title>
        <link href="../Styles/Print.css" rel="stylesheet" type="text/css" />
        <link href="../css/Printaround.css" rel="stylesheet" type="text/css" />
        <link href="../css/printbelow.css" rel="stylesheet" type="text/css" />
        <link href="../css/printleft.css" rel="stylesheet" type="text/css" />
         <link rel="stylesheet" type="text/css" href="../css/printright.css" />
        <link href="../css/printrightdan.css" rel="stylesheet" type="text/css" />
    
    
    </head>
    
    <body>
      <form id="form1" runat="server" style="margin:0; padding:0;" >
      <table>
         <%
             //产品发货单基本信息(1条)
             System.Data.DataSet ds = GetDataSet();
             //产品批号信息(多条)
             System.Data.DataSet ds1 = this.GetProBatchsDataSet();
             int mypage = 0;
    
    
             if ((ds1.Tables[0].Rows.Count) % 5 == 0)
             {
                 mypage = (int)((ds1.Tables[0].Rows.Count) / 5);
             }
             else
             {
                 mypage = ((int)((ds1.Tables[0].Rows.Count) / 5)) + 1;
             }
    
             decimal mon = 0;
             for (int n = 0; n < ds1.Tables[0].Rows.Count; n++)
             {
                 mon += Convert.ToDecimal(ds1.Tables[0].Rows[n]["ProBatchPriceTotal"].ToString().Trim());
             }
             //Convert.ToDecimal(mon);
    
             int x = ds1.Tables[0].Rows.Count;
    
             //绑定固定的联系人或者制单人名
          
             
            for (int i = 0; i < x;)
            {
                %>
                  <tr>
      <td>
       <table style="height: 310px;  210mm;" align="left" 
               border="0" cellpadding="0" cellspacing="0">
           <tr>
               <td height="24mm" width="223mm">             
                          <table  border="0" cellpadding="0" cellspacing="0" 
                              style="height: 20mm;  210mm;" align="left">
                              <tr>
                                  <td colspan="6" style="font-size: larger; font-weight: bold" 
                                      align="center" class="style17">
                                      <font size="4"><%=ds.Tables[0].Rows[0]["OurCom"]%>产品出库(验收、通知)单</font></td>
                                                </tr>
                                                <tr>
                                                    <td align="right" width="75px" height="8mm" >
                                                        <font style="font-family: 宋体; font-size:12px;">发货单位:</font></td>
                                  <td align="left" width="254px">
                                      <font style="font-family: 宋体; font-size:12px;"><%=ds.Tables[0].Rows[0]["OurCom"]%></font>
                                  </td>
                                  <td align="right" width="75px" >
                                      <font style="font-family: 宋体; font-size:12px;">联系人:</font></td>
                                  <td align="left" width="231px" >
                                       <font style="font-family: 宋体; font-size:12px;"><%=ds.Tables[0].Rows[0]["RealUser"]%></font></td>
                                  <td align="right" width="75px" >
                                      <font style="font-family: 宋体; font-size:12px;">系统单号:</font></td>
                                  <td align="left" >
                                      <font style="font-family: 宋体; font-size:12px;"><%=DateTime.Now.ToString("yyyyMMddhhmmss")+ds.Tables[0].Rows[0]["SendID"]%></font></td>
                              </tr>
                              <tr>
                                  <td align="right" height="8mm" >
                                      <font style="font-family: 宋体; font-size:12px;">收货单位:</font></td>
                                  <td align="left" width="254px" >
                                    <%=ds.Tables[0].Rows[0]["ReceiveComName"]%></td>
                                  <td align="right" >
                                      <font style="font-family: 宋体; font-size:12px;">发货时间:</font></td>
                                  <td align="left" width="231px">
                                      <font style="font-family: 宋体; font-size:12px;"><%=Convert.ToDateTime(ds.Tables[0].Rows[0]["sendDate"]).ToString("yyyy-MM-dd")%></font></td>
                                  <td align="right">
                                      <font style="font-family: 宋体; font-size:12px;">自定义单号:</font></td>
                                  <td align="left">
                                      </td>
                              </tr>
                          </table>                     
                          </td>
        </tr>
        <tr>
            <td align="left" valign="top" height="43mm">
                          <table border="0" cellpadding="0" cellspacing="0">
                              <tr>
                                  <td align="left" valign="top" height="43mm" class="style8">
                                      <table align="left" border="0" cellpadding="0" cellspacing="0"  
                                          class="Prinaround">
                                          <tr align="center" valign="middle" style="height: 6mm">
                                              <td width="40px" class="Printright" height="6mm">
                                                  <font style="font-family: 宋体; font-size:12px;">   </font></td>
                                              <td class="style16">
                                                  <font style="font-family: 宋体; font-size:12px;">商品名称</font></td>
                                              <td class="style14">
                                                  <font style="font-family: 宋体; font-size:12px;">规 格</font></td>
                                              <td class="style22">
                                                  <font style="font-family: 宋体; font-size:12px;">生产企业</font></td>
                                              <td class="style23">
                                                  <font style="font-family: 宋体; font-size:12px;">单位</font></td>
                                              <td class="style10">
                                                  <font style="font-family: 宋体; font-size:12px;">数量</font></td>
                                             <td class="style28">
                                                  <font style="font-family: 宋体; font-size:12px;">单价</font></td>   
                                                  
                                              <td class="style18">
                                                  <font style="font-family: 宋体; font-size:12px;">金额</font></td>
                                              <td class="style29">
                                                  <font style="font-family: 宋体; font-size:12px;">生产日期</font></td>
                                              <td class="style26">
                                                  <font style="font-family: 宋体; font-size:12px;">批号</font></td>
                                              <td class="style27">
                                                  <font style="font-family: 宋体; font-size:12px;">有效期</font></td>  
                                           
                                          </tr>         
                <%
                decimal currentmoney = 0;
                for (int j = 0; j < 5 && i < x; j++, i++)
                {
                    currentmoney += Convert.ToDecimal(ds1.Tables[0].Rows[i]["ProBatchPriceTotal"]);
                 
                    
                    %>                      
                                          <tr align="center" valign="middle" style="height: 6mm">
                                              <td class="Printright" height="6mm">
                                                 <table><tr><td> <font style="font-family: 宋体; font-size:12px;"> <%=i+1 %></font></td></tr></table></td>
                                              <td class="style16">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=ds1.Tables[0].Rows[i]["ProName"]%> </span></font></td>
                                              <td class="style14">
                                                  <font style="font-family: 宋体; font-size:11px;"><span><%=ds1.Tables[0].Rows[i]["Spec"]%></span></font></td>
                                              <td class="style22">
                                                  <font style="font-family: 宋体; font-size:11px;"><span><%=ds1.Tables[0].Rows[i]["MadeEnterprise"]%></span></font></td> 
                                             <td class="style23">
                                                  <font style="font-family: 宋体; font-size:11px;"><span><%=ds1.Tables[0].Rows[i]["Unit"]%></span></font></td>
                                             <td class="style10">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=ds1.Tables[0].Rows[i]["proCount"]%></span></font></td>    
                                              <td class="style28">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=Convert.ToDecimal(ds1.Tables[0].Rows[i]["ProPrice"]).ToString("0.00")%></span></font></td>
                                              <td class="style18">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=Convert.ToDecimal(ds1.Tables[0].Rows[i]["ProBatchPriceTotal"]).ToString("0.00")%></span></font></td>
                                              <td class="style29">
                                                 <font style="font-family: 宋体; font-size:12px;"><span><%=Convert.ToDateTime(ds1.Tables[0].Rows[i]["makeDate"]).ToString("yyyy-MM-dd")%></span></font></td>
                                              <td class="style26">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=ds1.Tables[0].Rows[i]["batchNum"]%></span></font></td>
                                              <td class="style27">
                                                  <font style="font-family: 宋体; font-size:12px;"><span><%=Convert.ToDateTime(ds1.Tables[0].Rows[i]["expirationDate"]).ToString("yyyy-MM-dd")%></span></font></td>
                                             
                                          </tr>
                    <%
                }
                %>
                 </table>
                                  </td>
                              </tr>
                              </table>                 
                      </td>
        </tr>
        <tr>
            <td height="18mm" valign="top">  
                          <table  border="0" cellpadding="0" cellspacing="0" 
                              style="height: 21mm;  770px;">
                              <tr>
                                  <td colspan="2" class="style20">
                                      <font style="font-family:font-family: 宋体; font-size:12px;">本单入库金额小计:<%=CommTool.StringHandler.CmycurD(currentmoney)+"(¥"+currentmoney.ToString("0.00")+")" %></font></td>
                                  <td colspan="5" class="style20" >
                                      <font style="font-family: 宋体; font-size:12px;">整单入库金额合计:<%=CommTool.StringHandler.CmycurD(mon)+"(¥"+mon.ToString("0.00")+")"%></font></td>
                              </tr>                          
                              <tr>
                                  <td class="style21" >
                                      <font style="font-family: 宋体; font-size:12px;">单位:合格</font></td>
                                  <td class="style21">
                                      <font style="font-family: 宋体; font-size:12px;">发货人:<input id="Text3" maxlength="6" style="border-0px; border-color:Transparent ; 50px; font-family:宋体 ; font-size:12px;" value='<%=ds.Tables[0].Rows[0]["StockUser"]%>' /></font>
                                  </td>
                                  <td class="style21">
                                      <font style="font-family: 宋体; font-size:12px;">质量审核人:<input id="senduser" maxlength="6" style="border-0px; border-color:Transparent ; 50px; font-family:宋体 ; font-size:12px;"  value="" /></font>
                                  </td>
                                  <td class="style21">
                                      <font style="font-family: 宋体; font-size:12px;">送货人:<input id="stockuser" maxlength="6" style="border-0px; border-color:Transparent ; 50px; font-family:宋体 ; font-size:12px;"  value='<%=ds.Tables[0].Rows[0]["PostUnit"]%>'/></font>
                                  </td>                              
                                  <td colspan="2" class="style21">
                                   <font style="font-family: 宋体; font-size:12px;">收货人:<input id="appuser" name="username" maxlength="6" style="border-0px; border-color:Transparent ; 50px; font-family:宋体 ; font-size:12px;"  value='' /></font>                              
                                  </td>
                              </tr>
                               <tr>
                                  <td height="6mm">
                                      <font style="font-family: 宋体; font-size:12px;">白  联:存根联</font></td>
                                  <td>
                                      <font style="font-family: 宋体; font-size:12px;">红  联:财务联</font></td>
                                  <td>
                                      <font style="font-family: 宋体; font-size:12px;">绿  联:发货联</font></td>
                                  <td>
                                       <font style="font-family: 宋体; font-size:12px;">蓝  联:收货联</font></td>
                                  <td>
                                       <font style="font-family: 宋体; font-size:12px;">黄  联:随货</font></td>
                                  <td>
                                       <font style="font-family: 宋体; font-size:12px;">制单人:<input ID="Text4" maxlength="6" name="userman"  onchange="setTbConSame2(this)" style="border-0px; border-color:Transparent ; 50px; font-family:宋体 ; font-size:12px;"  value="<%=ds.Tables[0].Rows[0]["AppUserName"].ToString() %>" /></font></td>
                                  <td>
                                      <font style="font-family: 宋体; font-size:12px;">P.<%=((int)((i - 1) / 5)) + 1%>/<%=mypage%></font></td>
                              </tr>
                              </table>
                      
                      </td>
        </tr>
    </table> 
                    <%
            }
        %>
          </td>
      </tr>
      </table>
    </form>
    </body>
    </html>
    

     后台的代码:

     public partial class ChuKuPrint: System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (Request.QueryString["Sendid"] != null)
                {
    
                }
                else
                {
                    Response.Redirect("SendGoodsShow.aspx");
                    return;
                }
            }
    
            /// <summary>
            /// 获取发货申请表单基本信息
            /// </summary>
            /// <returns></returns>
            public DataSet GetDataSet()
            {
                string id = Request.QueryString["Sendid"].ToString();
                DataSet ds = SqlComm.GetDataByCondition("dbo.View_SendAppInfoShowList", "*", "Sendid=" + id);
               return ds;
            }
            /// <summary>
            /// 发货产品批号信息
            /// </summary>
            /// <returns>DataSet</returns>
            public DataSet GetProBatchsDataSet()
            {
                string id = Request.QueryString["Sendid"].ToString();
                DataSet ds = SqlComm.GetDataByCondition("dbo.View_SendGoodsBatchInfoPrint", "*", "Sendid=" + id);
                return ds;
            }
    
        }
    

     打印的视图:

    CREATE VIEW [dbo].[View_SendGoodsBatchInfoPrint]
    AS
    SELECT
    	ProName,
    	Spec=dbo.FN_getProSpecbyProID(ProID),
    	MadeEnterprise=dbo.FN_getMadeEnterpriseByProID(ProID),
    	Unit=dbo.FN_getProUnitbyProID(ProID),
        ProBatchID,
        SendProID,
        batchNum,
        boxNum,
        proCount,
        ProPrice,
        ProBatchPriceTotal=proCount*ProPrice,
        ProStockID,
        stockDate,
        stockID,
        expirationDate,
        makeDate,
        SendID,
        ProID
           
    FROM
    	dbo.View_SendGoodsProBatchInfo
    

     发货的产品批号的视图:

    CREATE VIEW [dbo].[View_SendGoodsProBatchInfo]
    AS
    SELECT a.*,
    b.ProBatchID,
    b.batchNum,
    b.boxNum,
    b.proCount AS BatchProCount,
    b.ProStockID,
    b.stockDate,
    
    b.expirationDate,
    b.makeDate,
    b.stockID,
    b.isprinted,
     ProName=dbo.FN_getProNameByProID(a.ProID)
      FROM dbo.BioSendGoodsPro  AS a 
      INNER JOIN dbo.BioSendProBatch AS b
    ON b.SendProID = a.SendProID
    
  • 相关阅读:
    设计模式系列
    设计模式系列
    【ABAP系列】SAP ABAP DYNP_VALUES_UPDATE 更新屏幕字段的函数及用法
    【HANA系列】SAP HANA 2.0简介
    【HANA系列】SAP HANA Studio使用insufficient privilege 问题
    【HANA系列】SAP HANA Studio出现"Fetching Children..."问题
    【ABAP系列】SAP ABAP smartforms设备类型CNSAPWIN不支持页格式ZXXX
    【BW系列】SAP BW实时抽取ECC数据的实现
    【ABAP系列】SAP ABAP 行列转换的方法
    【HANA系列】SAP HANA数据处理的理解与分析一
  • 原文地址:https://www.cnblogs.com/sunliyuan/p/7706832.html
Copyright © 2011-2022 走看看