📄 instoreadd.aspx
字号:
else
thediscount=1
end if
end if
thebookcode=therow(0).tostring
theInnum=therow(5)
sql="insert into instoresheet(code,ddate,providercode,bookcode,instorenum,discount,prooutcode) values('" & trim(unitcode) & "','" & thedate & "','" & providercode & "','" & thebookcode & "'," & theinnum & "," & thediscount & ",'" & strprooutcode & "')"
cmd=new sqlcommand(sql,cnn)
cmd.executeNonQuery
theTag=1
end if
end if
next
if thetag<>1 then
page.registerstartupscript("",getalertinfo("没有添加入库数,无法保存!"))
else
mydatarowcollection.clear()
page.registerstartupscript("",getalertinfo("数据保存成功!"))
bindgrid1()
bindgrid()
proout.text=""
end if
end if
End Sub
Sub grid_delete(Sender as object,E as DataGridCommandEventArgs)
dim theNo as string=E.Item.Cells(0).Text
dim myDataRowCollection as datarowcollection
dim theRow as datarow
mydatarowcollection=dtable.rows
if mydatarowcollection.Contains(theno) then
therow=mydatarowcollection.Find(theno)
mydatarowcollection.Remove(theRow)
bindgrid1()
end if
End Sub
Sub Grid_Update(Sender as object,E as DataGridCommandEventArgs)
dim SubNumStr As string=CType(E.Item.Cells(6).Controls(0),TextBox).Text
dim strdiscount as string=ctype(E.Item.Cells(5).Controls(0),TextBox).text
dim theNo as string=E.Item.Cells(0).Text
dim myDataRowCollection as datarowcollection
dim theRow as datarow
if Isnumeric(subnumstr) then
mydatarowcollection=dtable.rows
if mydatarowcollection.Contains(theno) then
therow=mydatarowcollection.Find(theno)
therow(5)=cint(subnumstr)
if not isdbnull(strdiscount) and isnumeric(strdiscount) then
if csng(strdiscount)>0 and csng(strdiscount)<=1 then
therow(6)=csng(strdiscount)
else
therow(6)=1
end if
else
therow(6)=1
end if
if therow.haserrors then
dtable.RejectChanges
else
dtable.AcceptChanges
end if
end if
end if
DataGrid2.EditItemIndex=-1
BindGrid1()
End Sub
Sub Grid_Cancel(Sender as object,E as DataGridCommandEventArgs)
datagrid2.EditItemIndex=-1
BindGrid1()
End Sub
Sub Grid_Edit(Sender as object,E as DataGridCommandEventArgs)
DataGrid2.EditItemIndex=E.Item.ItemIndex
BindGrid1()
End Sub
Sub Grid1_PageIndexChanged(Sender As Object, E As DataGridPageChangedEventArgs)
datagrid1.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub
Sub Grid2_PageIndexChanged(Sender As Object, E As DataGridPageChangedEventArgs)
datagrid2.CurrentPageIndex = e.NewPageIndex
BindGrid1()
End Sub
Function GetAlertInfo(byval str1 as string) as String
dim Str2 as String
str2="<script language='javascript'>alert('" & str1 & "')<"
str2+="/"
str2+="script>"
return trim(str2)
End Function
</script>
<html>
<head>
<link href="../Main.css" type="text/css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<b>入库单信息</b>
<asp:button class="input_button" id="ClearBtn" onclick="Clear_Click" runat="server" CausesValidation="False" text="清 除"></asp:button>
<asp:button class="input_button" id="SaveBtn" onclick="Save_Click" runat="server" text="保 存"></asp:button>
<hr size="1" />
<table id="search" cellspacing="1" cellpadding="0" width="100%" align="center" border="0">
<tbody>
<tr class="tr2">
<td style="PADDING-LEFT: 5px" width="30%" height="25">
入库时间:
<asp:TextBox class="input_text" id="DDate" runat="server" width="100"></asp:TextBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="DDate" ErrorMessage="必 填"></asp:RequiredFieldValidator>
</td>
<td style="PADDING-LEFT: 5px" width="35%" height="25">
供 应 商:
<asp:DropDownList class="input_text" id="SelBuyer" runat="server" width="200"></asp:DropDownList>
</td>
<td style="PADDING-LEFT: 5px" width="35%" height="25">
供应商来单号:
<asp:TextBox class="input_text" id="proout" runat="server" width="100"></asp:TextBox>
</td>
</tr>
<tr>
<td style="PADDING-LEFT: 5px" colspan="3" height="25">
<asp:DataGrid id="DataGrid2" runat="server" width="100%" PageSize="6" AutoGenerateColumns="False" OnDeletecommand="Grid_Delete" OnupdateCommand="Grid_Update" OnCancelCommand="Grid_Cancel" OnEditCommand="Grid_Edit" headerstyle-backcolor="#F8FAFC" font-size="8pt" font-name="verdana" cellpadding="2" bordercolor="Black" Font-Names="verdana" AllowPaging="True" AllowSorting="True" OnPageIndexChanged="Grid2_PageIndexChanged">
<HeaderStyle font-bold="True" horizontalalign="Center" verticalalign="Middle" backcolor="#F8FAFC"></HeaderStyle>
<PagerStyle nextpagetext="下一页" font-names="宋体" font-bold="True" prevpagetext="上一页" horizontalalign="Right" forecolor="Blue" position="Top" mode="NumericPages"></PagerStyle>
<EditItemStyle backcolor="#E9F0F8"></EditItemStyle>
<Columns>
<asp:BoundColumn DataField="Code" ReadOnly="True" HeaderText="图书编号"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" ReadOnly="True" HeaderText="图书名称"></asp:BoundColumn>
<asp:BoundColumn DataField="cbs" ReadOnly="True" HeaderText="版别"></asp:BoundColumn>
<asp:BoundColumn DataField="author" ReadOnly="True" HeaderText="作者"></asp:BoundColumn>
<asp:BoundColumn DataField="price" ReadOnly="True" HeaderText="定价" DataFormatString="{0:C}"></asp:BoundColumn>
<asp:BoundColumn DataField="discount" HeaderText="折扣"></asp:BoundColumn>
<asp:BoundColumn DataField="Innum" HeaderText="入库数"></asp:BoundColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" HeaderText="编辑" CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
<asp:ButtonColumn Text="删除" HeaderText="删除" CommandName="Delete"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</td>
</tr>
</tbody>
</table>
<br />
<b>图书信息查询</b>
<hr size="1" />
<table class="" id="search" cellspacing="1" cellpadding="0" width="100%" align="center" border="0">
<tbody>
<tr class="tr2">
<td style="PADDING-LEFT: 5px" height="25">
检索条件:
<asp:DropDownList class="input_text" id="query_tj" runat="server" width="97">
<asp:ListItem Value="name" Selected="True">图书名称</asp:ListItem>
<asp:ListItem Value="ISBN">图书ISBN</asp:ListItem>
<asp:ListItem Value="author">作者</asp:ListItem>
<asp:ListItem Value="selfcode">自编码</asp:ListItem>
<asp:ListItem Value="memo">备注</asp:ListItem>
</asp:DropDownList>
检索内容:
<asp:TextBox class="input_text" id="query_content" runat="server" width="120"></asp:TextBox>
<asp:button class="input_button" id="QueryBtn" onclick="Query_Click" runat="server" CausesValidation="False" text="查 询"></asp:button>
<br />
</td>
</tr>
<tr>
<td style="PADDING-LEFT: 5px" height="25">
<asp:DataGrid id="DataGrid1" runat="server" width="100%" PageSize="3" AutoGenerateColumns="False" headerstyle-backcolor="#F8FAFC" font-size="8pt" font-name="verdana" cellpadding="2" bordercolor="Black" Font-Names="verdana" AllowPaging="True" AllowSorting="True" OnPageIndexChanged="Grid1_PageIndexChanged" OnItemCommand="AddToSub_Click">
<HeaderStyle font-bold="True" horizontalalign="Center" verticalalign="Middle" backcolor="#F8FAFC"></HeaderStyle>
<PagerStyle nextpagetext="下一页" font-names="宋体" font-bold="True" prevpagetext="上一页" horizontalalign="Right" forecolor="Blue" mode="NumericPages"></PagerStyle>
<Columns>
<asp:BoundColumn Visible="False" DataField="Code" ReadOnly="True" HeaderText="图书编号"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" HeaderText="图书名称">
<HeaderStyle width="130px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="abbrname" ReadOnly="True" HeaderText="版别">
<HeaderStyle width="40px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="price" HeaderText="定价" DataFormatString="{0:C}">
<HeaderStyle width="30px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="author" HeaderText="作者">
<HeaderStyle width="40px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="version" HeaderText="版次"></asp:BoundColumn>
<asp:BoundColumn DataField="storeamountz" ReadOnly="True" HeaderText="总店库存">
<HeaderStyle width="60px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="storeamounta" ReadOnly="True" HeaderText="门市库存">
<HeaderStyle width="60px"></HeaderStyle>
</asp:BoundColumn>
<asp:ButtonColumn Text="添加至入库单" HeaderText="操作" CommandName="addtosub"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -