📄 check.aspx
字号:
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtInventory" runat="server" Text='<%# Eval("CheckItemsInventory")%>' Visible=false></asp:TextBox>
<asp:TextBox ID="txtCheckQuantity" runat="server" Width=40 Text='<%# Bind("CheckQuantity") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCheckQuantity"
ErrorMessage="请输入实际数量!" ValidationGroup="QuantityValid" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCheckQuantity"
Display="Dynamic" ErrorMessage="请输入数字" ValidationExpression="^\-?[0-9]*\.?[0-9]*$" ValidationGroup="QuantityValid"></asp:RegularExpressionValidator>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="盈亏数量" SortExpression="CheckItemsExtra" ControlStyle-Width="40">
<ItemTemplate>
<%# Eval("CheckItemsExtra")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="盈亏金额" SortExpression="CheckItemsExtraMoney">
<ItemTemplate>
<%# String.Format("{0:C}",Eval("CheckItemsExtraMoney"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="盈亏原因" SortExpression="CheckItemsReason">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CheckItemsReason") %>' Visible="False"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MySqlProviderConnection %>"
SelectCommand="sp_getCheckItemsReason" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" Name="InventoryReasonID" PropertyName="Text"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:DropDownList ID="drpCheckItemsReason" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Column2" DataValueField="Column1">
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CheckItemsReason") %>' Visible="False"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MySqlProviderConnection %>"
SelectCommand="sp_getCheckItemsReason" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" Name="InventoryReasonID" PropertyName="Text"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:DropDownList ID="drpCheckItemsReason" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Column2" DataValueField="Column1" Enabled=false>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" CancelText="取消"
DeleteText="删除" EditText="编辑" InsertText="插入" NewText="新增"
SelectText="选取" UpdateText="确认" ValidationGroup="QuantityValid" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" Runat="server"
OnClientClick="return confirm('确定删除该条记录?');"
CommandName="Delete">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</sk:myGridView>
</div>
</td></tr>
<tr valign=top runat=server id="TrNew" visible=false><td colspan=6>
<div class="divGridView">
<sk:myGridView ID="GridView2" runat="server" AutoGenerateColumns="False" AllowPagingToggle="false" DataKeyNames="ItemID"
Width=100% OnRowDataBound="GridView2_RowDataBound" OnSelectedIndexChanged="GridView2_SelectedIndexChanged"
OnPageIndexChanging="GridView2_PageIndexChanging" AllowPaging="False" AllowSorting="False">
<Columns>
<asp:CommandField ShowSelectButton="True" SelectText="盘点" />
<asp:BoundField DataField="ItemID" HeaderText="物资编号" SortExpression="ItemID"></asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="物资名称" SortExpression="Name"></asp:BoundField>
<asp:BoundField DataField="Specification" HeaderText="规格型号" SortExpression="Specification"></asp:BoundField>
<asp:BoundField DataField="Unit" HeaderText="计量单位" SortExpression="Unit"></asp:BoundField>
<asp:BoundField DataField="StandardPrice" HeaderText="单价" SortExpression="StandardPrice"></asp:BoundField>
<asp:BoundField DataField="Quantity" HeaderText="现有库存" SortExpression="Quantity"></asp:BoundField>
</Columns>
</sk:myGridView>
</div>
</td>
</tr>
<tr><td colspan=3 align=right>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Enabled="false"
Text="保存">
</asp:LinkButton>
</td>
<td></td>
<td colspan=2 align=left>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="取消" OnClick="InsertCancelButton_Click">
</asp:LinkButton>
</td></tr>
</table>
</InsertItemTemplate>
</asp:FormView>
</asp:View>
<asp:View ID="View2" runat="server">
<div align=center>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:MySqlProviderConnection %>"
SelectCommand="SELECT [InventoryCheckMain].InventoryCheckID, [WareHouses].Description As WareHouseName,
[InventoryCheckMain].CheckDate, [InventoryCheckMain].UserName, [InventoryCheckMain].Description,
[InventoryCheckMain].ReviewerName,[InventoryCheckMain].IsReviewed FROM [InventoryCheckMain]
Join [WareHouses] On ([InventoryCheckMain].WareHouseID=[WareHouses].WareHouseID) Order By InventoryCheckID Desc "
UpdateCommand="Update InventoryCheckMain Set IsReviewed=1, ReviewerName=@ReviewerName Where InventoryCheckID=@InventoryCheckID"
DeleteCommand="sp_deleteInventoryCheck" DeleteCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="InventoryCheckID" Type="Int32" />
<asp:Parameter Name="ReviewerName" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="InventoryCheckID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
盘点历史列表
<sk:myGridView ID="GridView3" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="InventoryCheckID"
DataSourceID="SqlDataSource4" Width="98%" OnRowUpdating="GridView3_RowUpdating"
OnRowDeleted="GridView3_RowDeleted" OnRowDataBound="GridView3_RowDataBound" OnRowUpdated="GridView3_RowUpdated">
<Columns>
<asp:CommandField SelectText="详细盘点" ShowSelectButton="True" />
<asp:BoundField DataField="InventoryCheckID" HeaderText="盘点单编号" InsertVisible="False" ReadOnly="True"
SortExpression="InventoryCheckID" />
<asp:BoundField DataField="WareHouseName" HeaderText="盘点仓库" SortExpression="WareHouseName" />
<asp:TemplateField HeaderText="盘点日期" SortExpression="CheckDate">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ((DateTime)Eval("CheckDate")).ToShortDateString() %>' width="80px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UserName" HeaderText="盘点人" SortExpression="UserName" />
<asp:TemplateField HeaderText="备注" SortExpression="Description">
<ItemTemplate>
<div style="width:100px;overflow: hidden; text-overflow:ellipsis;word-break:keep-all" title=<%# Eval("Description")%>>
<%# Eval("Description")%>
</div>
</ItemTemplate>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -