Files
sryang 577060bc78 chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
2026-09-10 09:42:37 +08:00

142 lines
9.2 KiB
Plaintext

<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true"
CodeBehind="課程使用經費登錄.aspx.cs" Inherits="Education.Forms.辦訓狀況.課程使用經費登錄" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="WebLib" %>
<%@ Register Src="../Common/訓練企劃搜尋.ascx" TagName="訓練企劃搜尋" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ObjectDataSource ID="ds課程經費" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="Select"
TypeName="Education.DAC_課程經費" DataObjectTypeName="Education.課程經費"
DeleteMethod="DeleteOne" UpdateMethod="UpdateOne">
<SelectParameters>
<asp:ControlParameter ControlID="訓練企劃搜尋" Name="訓練課程企劃編號"
PropertyName="訓練企劃編號" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<uc1:訓練企劃搜尋 ID="訓練企劃搜尋" runat="server" 包含已結案="True" OnClick="btn查詢1_Click"
訓練企劃狀態="已上課未結案" />
<asp:Label ID="lbMessage" runat="server" CssClass="ErrorMessage" EnableViewState="False"></asp:Label>
<asp:Panel ID="Panel1" runat="server" Visible="false">
<table border="1" class="fixedwithborder" style="border-bottom: none;">
<tr>
<th style="width: 140px">&nbsp;</th>
<th style="width: 80px">單據序號</th>
<th style="width: 120px">收支</th>
<th style="width: 80px">金額</th>
<th style="width: 300px">摘要</th>
</tr>
<tr>
<td class="datainput" style="border-bottom: none">
<asp:LinkButton ID="btnInsert" runat="server" CssClass="button blue60"
OnClick="btnInsert_Click" ValidationGroup="insert">新增</asp:LinkButton>
</td>
<td class="datainput" style="text-align: center; border-bottom: none">
<asp:Label ID="Label10" runat="server" Text="自動編號"></asp:Label>
</td>
<td class="datainput" style="text-align: center; border-bottom: none">
<asp:RadioButtonList ID="rbl收支" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Flow" Font-Bold="true"
ValidationGroup="insert">
<asp:ListItem Selected="True" style="color: red" Value="支">支出&nbsp</asp:ListItem>
<asp:ListItem style="color: green" Value="收">收入</asp:ListItem>
</asp:RadioButtonList>
</td>
<td class="datainput" style="border-bottom: none">
<asp:TextBox ID="txt金額" runat="server" Width="76px"
ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
ErrorMessage="請輸入" ControlToValidate="txt金額" ValidationGroup="insert">
</asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ErrorMessage="請輸入 1-999999 的數字" ControlToValidate="txt金額" Display="Dynamic"
MaximumValue="999999" MinimumValue="1" Type="Integer" ValidationGroup="insert">
</asp:RangeValidator>
</td>
<td class="datainput" style="border-bottom: none">
<asp:TextBox ID="txt摘要" runat="server" Width="296px"
ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic"
ErrorMessage="請輸入" ControlToValidate="txt摘要" ValidationGroup="insert">
</asp:RequiredFieldValidator>
</td>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="訓練課程企劃編號,單據序號,DB_APPNO" DataSourceID="ds課程經費"
EnableModelValidation="True" ShowHeader="False" AllowPaging="True">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True"
CommandName="Update" Text="儲存" CssClass="button blue60"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" CssClass="button green60"
OnClientClick='return confirm("是否確定取消更正?");'></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Edit" Text="更正" CssClass="button green60"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
CommandName="Delete" Text="刪除" CssClass="button red60"
OnClientClick='return confirm("是否確定刪除此筆資料?");'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Width="140px" />
<ItemStyle Width="140px" />
</asp:TemplateField>
<asp:BoundField DataField="單據序號" HeaderText="單據序號" ReadOnly="True"
SortExpression="單據序號">
<ItemStyle Width="80px" HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="收支" SortExpression="收支">
<EditItemTemplate>
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" RepeatLayout="Flow" Font-Bold="True"
SelectedValue='<%# Bind("收支") %>'>
<asp:ListItem style="color: red" Value="支">支出&nbsp;</asp:ListItem>
<asp:ListItem style="color: green" Value="收">收入</asp:ListItem>
</asp:RadioButtonList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Font-Bold="true"
Text='<%# Eval("收支", "{0}") == "收" ? "收入" : "支出" %>'
ForeColor='<%# Eval("收支", "{0}") == "收" ? System.Drawing.Color.Green : System.Drawing.Color.Red %>'>
</asp:Label>
</ItemTemplate>
<ItemStyle Width="120px" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="金額" SortExpression="金額">
<EditItemTemplate>
<asp:TextBox ID="txt金額" runat="server" Text='<%# Bind("金額") %>' MaxLength="6" CssClass="inputFull"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
ErrorMessage="請輸入" ControlToValidate="txt金額"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server" Display="Dynamic"
ErrorMessage="請輸入 1-999999 的數字" ControlToValidate="txt金額" MaximumValue="999999"
MinimumValue="1" Type="Integer"></asp:RangeValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("金額", "{0:###,##0}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="80px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="摘要" SortExpression="摘要">
<EditItemTemplate>
<asp:TextBox ID="txt摘要" runat="server" Text='<%# Bind("摘要") %>' CssClass="inputFull"
MaxLength="500"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic"
ErrorMessage="請輸入" ControlToValidate="txt摘要"></asp:RequiredFieldValidator>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("摘要") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="300px" />
</asp:TemplateField>
</Columns>
<PagerTemplate>
<WebLib:GridViewPager ID="GridViewPager1" runat="server" />
</PagerTemplate>
</asp:GridView>
</asp:Panel>
</asp:Content>