chore: 首次簽入 Thinkyu ASP.NET 專案

- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
2026-09-10 09:42:37 +08:00
commit 577060bc78
2496 changed files with 501389 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fmBCLS.ascx.cs" Inherits="forms_basedata_fmBcls" %>
<%@ Register Assembly="WNET" Namespace="Wellan.Web.UI"
TagPrefix="cc1" %>
<cc1:wlabel id="WLabel1" runat="server" cssclass="pageTitle"
textmessageid="FMBPSN.NAME"></cc1:wlabel>
<asp:CustomValidator ID="cvMessage" runat="server"
Display="None"></asp:CustomValidator>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<table>
<tr>
<td align="right">
<cc1:WLabel ID="WLabel3" runat="server" TextMessageId="">類別:</cc1:WLabel></td>
<td class="dataEditCell">
<cc1:WDropDownList ID="ddlBSPAR" runat="server"
CssClass="textInput" Width="500px">
<asp:ListItem Value="BPSNTYP">人員類別</asp:ListItem>
<asp:ListItem Value="BPSNSTP">最高學歷</asp:ListItem>
<asp:ListItem Value="BPSNSGR">畢肄業</asp:ListItem>
<asp:ListItem Value="BPSNAMY">兵役狀況</asp:ListItem>
<asp:ListItem Value="BPSNIDT">身份類別</asp:ListItem>
<asp:ListItem Value="BPSNDIS">補助比例</asp:ListItem>
<asp:ListItem Value="BPSNSWY">薪資領取方式</asp:ListItem>
</cc1:WDropDownList></td>
<td class="dataEditCell">
<cc1:WButton ID="Next" runat="server" AccessKey="J"
CausesValidation="False" CssClass="button"
OnClick="Next_Click" Text="J.選擇類別" UseSubmitBehavior="False" /></td>
</tr>
</table>
</asp:View>
<asp:View ID="View2" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server">
</asp:SqlDataSource>
</asp:View>
</asp:MultiView>
+32
View File
@@ -0,0 +1,32 @@
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 System.Data.Common;
using Wellan.Data;
using Wellan.Common;
public partial class forms_basedata_fmBcls : Wellan.Web.UI.WUserControlBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
}
protected void Next_Click(object sender, EventArgs e)
{
ParamList["BSPAR"] = ddlBSPAR.SelectedValue;
DoAfterCommand("BSPAR");
}
}
+168
View File
@@ -0,0 +1,168 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fmBPAP.ascx.cs"
Inherits="forms_basedata_fmBPAP" %>
<%@ Register Assembly="WNET" Namespace="Wellan.Web.UI" TagPrefix="cc1" %>
<cc1:WLabel ID="WLabel1" runat="server" CssClass="pageTitle">外部人員帳號設定</cc1:WLabel>
<asp:CustomValidator ID="cvMessage" runat="server" Display="None"></asp:CustomValidator>
<asp:ObjectDataSource ID="dsBPAP" runat="server" DeleteMethod="DeleteOne"
OldValuesParameterFormatString="OLD_{0}" SelectMethod="SelectAll"
TypeName="BpapDAC" UpdateMethod="UpdateOne" OnObjectCreating="dsBPAP_ObjectCreating">
<DeleteParameters>
<asp:Parameter Name="OLD_BPENO" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="OLD_BPENO" Type="String" />
<asp:Parameter Name="BPENO" Type="String" />
<asp:Parameter Name="BPNME" Type="String" />
<asp:Parameter Name="BPEML" Type="String" />
<asp:Parameter Name="BPZON" Type="String" />
<asp:Parameter Name="BPBRH" Type="String" />
<asp:SessionParameter Name="TRUSR" SessionField="W_CUSR" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:SqlDataSource ID="dsBPZON" runat="server"></asp:SqlDataSource>
<asp:SqlDataSource ID="dsBPBRH" runat="server"></asp:SqlDataSource>
<table style="table-layout: fixed;" cellpadding="3" cellspacing="0"
border="1">
<tr>
<th style="width: 120px">
</th>
<th style="width: 120px">
<asp:Label ID="Label2" runat="server" Text="人員編號"></asp:Label>
</th>
<th style="width: 120px">
<asp:Label ID="Label3" runat="server" Text="人員姓名"></asp:Label>
</th>
<th style="width: 250px">
<asp:Label ID="Label4" runat="server" Text="電子郵件"></asp:Label>
</th>
<th style="width: 120px">
<asp:Label ID="Label5" runat="server" Text="所屬區域"></asp:Label>
</th>
<th style="width: 120px">
<asp:Label ID="Label6" runat="server" Text="所屬單位"></asp:Label>
</th>
</tr>
<tr>
<td valign="top">
<asp:Button ID="btnInsert" runat="server" Text="新增" OnClick="btnInsert_Click"
ValidationGroup="insert" />
</td>
<td valign="top">
<asp:Label ID="Label7" runat="server" Text="(自動編號)"></asp:Label>
</td>
<td valign="top">
<asp:TextBox ID="txtBPNME" runat="server" CssClass="textInput"
MaxLength="20" ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPNME" runat="server" ControlToValidate="txtBPNME"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
<td valign="top">
<asp:TextBox ID="txtBPEML" runat="server" CssClass="textInput"
MaxLength="30" ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPEML" runat="server" ControlToValidate="txtBPEML"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
<td valign="top">
<asp:DropDownList ID="ddlBPZON" runat="server" CssClass="textInput"
DataSourceID="dsBPZON" DataTextField="BSSCR" DataValueField="BSCLS"
ValidationGroup="insert">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvBPZON" runat="server" ControlToValidate="ddlBPZON"
Display="Dynamic" ErrorMessage="請選擇" ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
<td valign="top">
<asp:DropDownList ID="ddlBPBRH" runat="server" CssClass="textInput"
DataSourceID="dsBPBRH" DataTextField="BSSCR" DataValueField="BSCLS"
ValidationGroup="insert">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvBPBRH" runat="server" ControlToValidate="ddlBPBRH"
Display="Dynamic" ErrorMessage="請選擇" ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="BPENO" DataSourceID="dsBPAP" EnableModelValidation="True"
CellPadding="3" CssClass="fixtable" ShowHeader="False" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="False"
CommandName="Edit" Text="更正" />
&nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False"
CommandName="Delete" Text="刪除" OnClientClick="return confirm(msgConfirmDelete);" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="True"
CommandName="Update" Text="存檔" ValidationGroup="update" />
&nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Left" Width="120px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="人員編號">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("BPENO") %>'
ForeColor="Black"></asp:Label>
</ItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Center" Width="120px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="人員姓名">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("BPNME") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" CssClass="textInput"
MaxLength="20" Text='<%# Bind("BPNME") %>' ValidationGroup="update"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPNME" runat="server" ControlToValidate="TextBox2"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Center" Width="120px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="電子郵件">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("BPEML") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" CssClass="textInput"
Text='<%# Bind("BPEML") %>' ValidationGroup="update"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPEML" runat="server" ControlToValidate="TextBox3"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="250px" />
<ItemStyle HorizontalAlign="Center" Width="250px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="所屬區域">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# GetLookup("BCLS", Eval("BPZON", "{0:c}"), "BSSCR", "BSPAR=`BCUSZON`") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlBPZON" runat="server" CssClass="textInput"
DataSourceID="dsBPZON" DataTextField="BSSCR" DataValueField="BSCLS"
SelectedValue='<%# Bind("BPZON") %>' ValidationGroup="update">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvBPZON" runat="server" ControlToValidate="ddlBPZON"
Display="Dynamic" ErrorMessage="請選擇" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Center" Width="120px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="所屬單位">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# GetLookup("BCLS", Eval("BPBRH", "{0:c}"), "BSSCR", "BSPAR=`BPSNBRH` AND SUBSTRING(BSCLS, LEN(BSCLS) - 1, 2) = `00`") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlBPBRH" runat="server" CssClass="textInput"
DataSourceID="dsBPBRH" DataTextField="BSSCR" DataValueField="BSCLS"
SelectedValue='<%# Bind("BPBRH") %>' ValidationGroup="update">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvBPBRH" runat="server" ControlToValidate="ddlBPBRH"
Display="Dynamic" ErrorMessage="請選擇" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle HorizontalAlign="Center" Width="120px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
+66
View File
@@ -0,0 +1,66 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
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 System.Text;
/// <summary>
/// 外部人員帳號設定
/// </summary>
public partial class forms_basedata_fmBPAP : Wellan.Web.UI.WUserControlBase
{
private BpapDAC bpabDao;
protected void Page_Load(object sender, EventArgs e)
{
//if (IsPostBack)
// GridView1.DataBind();
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
bpabDao = new BpapDAC(Query);
dsBPZON.ConnectionString = ConnectionString;
dsBPBRH.ConnectionString = ConnectionString;
dsBPZON.SelectCommand = GetListSql("BCLSEDIT", "BSPAR='BCUSZON'");
dsBPBRH.SelectCommand = GetListSql("BCLSEDIT", "BSPAR='BPSNBRH' AND SUBSTRING(BSCLS, LEN(BSCLS) - 1, 2) = '00'");
}
protected void dsBPAP_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = bpabDao;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
bpabDao.InsertOne(txtBPNME.Text, txtBPEML.Text, ddlBPZON.SelectedValue, ddlBPBRH.SelectedValue, UserId);
txtBPNME.Text = "";
txtBPEML.Text = "";
ddlBPZON.SelectedValue = "";
ddlBPBRH.SelectedValue = "";
GridView1.DataBind();
}
catch (Exception ex)
{
cvMessage.IsValid = false;
cvMessage.ErrorMessage = ex.Message;
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//GridView_RowDataBound_Shrink_ViewState(sender, e);
}
}
+105
View File
@@ -0,0 +1,105 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fmBPSE.ascx.cs" Inherits="forms_basedata_fmBPSE" %>
<%@ Register Assembly="WNET" Namespace="Wellan.Web.UI" TagPrefix="cc1" %>
<cc1:WLabel ID="WLabel1" runat="server" CssClass="pageTitle">片語設定</cc1:WLabel>
<asp:CustomValidator ID="cvMessage" runat="server" Display="None"></asp:CustomValidator>
<asp:ObjectDataSource ID="dsBPSE" runat="server" DeleteMethod="DeleteOne"
OldValuesParameterFormatString="OLD_{0}" SelectMethod="SelectAll"
TypeName="BpseDAC" UpdateMethod="UpdateOne"
onobjectcreating="dsBPSE_ObjectCreating">
<DeleteParameters>
<asp:Parameter Name="OLD_BPTYP" Type="String" />
<asp:Parameter Name="OLD_BPCNT" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="OLD_BPTYP" Type="String" />
<asp:Parameter Name="OLD_BPCNT" Type="String" />
<asp:Parameter Name="BPTYP" Type="String" />
<asp:Parameter Name="BPCNT" Type="String" />
<asp:SessionParameter Name="TRUSR" SessionField="W_CUSR" />
</UpdateParameters>
</asp:ObjectDataSource>
<table style="table-layout: fixed;" cellpadding="4" cellspacing="0"
border="1">
<tr>
<th style="width: 100px">
</th>
<th style="width: 80px">
<asp:Label ID="Label3" runat="server" Text="片語類別"></asp:Label>
</th>
<th style="width: 250px">
<asp:Label ID="Label4" runat="server" Text="片語內容"></asp:Label>
</th>
</tr>
<tr>
<td valign="top">
<asp:Button ID="btnInsert" runat="server" Text="新增" OnClick="btnInsert_Click"
ValidationGroup="insert" />
</td>
<td valign="top">
<asp:TextBox ID="txtBPTYP" runat="server" CssClass="textInput"
MaxLength="20" ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPTYP" runat="server" ControlToValidate="txtBPTYP"
Display="Dynamic" ErrorMessage="請輸入"
ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
<td valign="top">
<asp:TextBox ID="txtBPCNT" runat="server" CssClass="textInput"
MaxLength="100" ValidationGroup="insert"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPCNT" runat="server" ControlToValidate="txtBPCNT"
Display="Dynamic" ErrorMessage="請輸入"
ValidationGroup="insert"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="BPTYP,BPCNT" DataSourceID="dsBPSE" EnableModelValidation="True"
CellPadding="3" CssClass="fixtable" ShowHeader="False">
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="False"
CommandName="Edit" Text="更正" />
&nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False"
CommandName="Delete" Text="刪除" OnClientClick="return confirm(msgConfirmDelete);" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button ID="Button3" runat="server" CausesValidation="True"
CommandName="Update" Text="存檔"
ValidationGroup="update" />
&nbsp;<asp:Button ID="Button4" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
<HeaderStyle Width="100px" />
<ItemStyle HorizontalAlign="Left" Width="100px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="片語類別">
<ItemTemplate>
<asp:Label ID="lbBPTYP" runat="server" Text='<%# Bind("BPTYP") %>'
ForeColor="Black"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtBPTYP" runat="server" CssClass="textInput"
MaxLength="20" Text='<%# Bind("BPTYP") %>' ValidationGroup="update"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPTYP" runat="server" ControlToValidate="txtBPTYP"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="80px" />
<ItemStyle HorizontalAlign="Center" Width="80px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="片語內容">
<ItemTemplate>
<asp:Label ID="lbBPCNT" runat="server"
Text='<%# Bind("BPCNT") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtBPCNT" runat="server" CssClass="textInput"
MaxLength="20" Text='<%# Bind("BPCNT") %>' ValidationGroup="update"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBPCNT" runat="server" ControlToValidate="txtBPCNT"
Display="Dynamic" ErrorMessage="請輸入" ValidationGroup="update"></asp:RequiredFieldValidator>
</EditItemTemplate>
<HeaderStyle Width="250px" />
<ItemStyle HorizontalAlign="Center" Width="250px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class forms_basedata_fmBPSE : Wellan.Web.UI.WUserControlBase
{
private BpseDAC bpseDao;
protected void Page_Load(object sender, EventArgs e)
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
bpseDao = new BpseDAC(Query);
}
protected void btnInsert_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
bpseDao.InsertOne(txtBPTYP.Text, txtBPCNT.Text, UserId);
txtBPTYP.Text = "";
txtBPCNT.Text = "";
GridView1.DataBind();
}
catch (Exception ex)
{
cvMessage.IsValid = false;
cvMessage.ErrorMessage = ex.Message;
}
}
protected void dsBPSE_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = bpseDao;
}
}
+308
View File
@@ -0,0 +1,308 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fmBTME.ascx.cs" Inherits="forms_basedata_fmBTME" %>
<%@ Register Assembly="WNET" Namespace="Wellan.Web.UI" TagPrefix="cc1" %>
<%@ Register Src="../../utility/TimeInput.ascx" TagName="TimeInput" TagPrefix="uc1" %>
<cc1:WLabel ID="WLabel1" runat="server" CssClass="pageTitle">班表設定</cc1:WLabel>
<asp:CustomValidator ID="cvMessage" runat="server" Display="None"></asp:CustomValidator>
<asp:ObjectDataSource runat="server" ID="dsBTMEGrid"
DataObjectTypeName="BtmeItem"
TypeName="BtmeDAC"
SelectMethod="SelectAll"
OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
<asp:ObjectDataSource runat="server" ID="dsBTMEForm"
DataObjectTypeName="BtmeItem"
TypeName="BtmeDAC"
SelectMethod="SelectOne"
InsertMethod="InsertOne"
UpdateMethod="UpdateOne"
DeleteMethod="DeleteOne"
OldValuesParameterFormatString="{0}">
<SelectParameters>
<asp:ControlParameter ControlID="gvBTME" PropertyName="SelectedValue" Name="BTTID" Type="String"></asp:ControlParameter>
</SelectParameters>
</asp:ObjectDataSource>
<asp:FormView runat="server" ID="fvBTME" DataSourceID="dsBTMEForm" DataKeyNames="BTTID">
<EmptyDataTemplate>
<cc1:WButton ID="btnInsert" runat="server"
CommandName="New" CssClass="button"
Text="I.新增" TextMessageId="I.+INSERT"
AccessKey="I" />
<table border="0" cellpadding="3" cellspacing="3" width="1" style="table-layout: fixed">
<tr>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTTIDLabel" runat="server" CssClass="controlLabel">班表編號:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell"></td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTNMELabel" runat="server" CssClass="controlLabel">班表名稱:</cc1:WLabel>
</td>
<td colspan="3" class="dataDisplayCell"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTSTMLabel" runat="server" CssClass="controlLabel">上班時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell"></td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTETMLabel" runat="server" CssClass="controlLabel">下班時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTRSTLabel" runat="server" CssClass="controlLabel">午休開始時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell"></td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTREDLabel" runat="server" CssClass="controlLabel">午休結束時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell"></td>
</tr>
</table>
</EmptyDataTemplate>
<ItemTemplate>
<cc1:WButton ID="btnInsert" runat="server"
CommandName="New" CssClass="button"
Text="I.新增" TextMessageId="I.+INSERT"
AccessKey="I" />
<cc1:WButton ID="btnEdit" runat="server"
CommandName="Edit" CssClass="button"
Text="M.更正" TextMessageId="M.+UPDATE"
AccessKey="M" />
<cc1:WButton ID="btnDelete" runat="server"
CommandName="Delete" CssClass="button"
Text="T.刪除" TextMessageId="T.+DELETE"
OnClientClick="return confirm(msgConfirmDelete);"
Enabled='<%# !BhrdDAC.ItemIsHoliday(Eval("BTTID", "{0}")) %>'
AccessKey="T" />
<table border="0" cellpadding="3" cellspacing="3" width="1" style="table-layout: fixed">
<tr>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTTIDLabel" runat="server" CssClass="controlLabel">班表編號:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTTID" runat="server" Text='<%# Bind("BTTID", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTNMELabel" runat="server" CssClass="controlLabel">班表名稱:</cc1:WLabel>
</td>
<td colspan="3" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTNME" runat="server" Text='<%# Bind("BTNME", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTSTMLabel" runat="server" CssClass="controlLabel">上班時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTSTM" runat="server" Text='<%# Bind("BTSTM", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTETMLabel" runat="server" CssClass="controlLabel">下班時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTETM" runat="server" Text='<%# Bind("BTETM", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTRSTLabel" runat="server" CssClass="controlLabel">午休開始時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTRST" runat="server" Text='<%# Bind("BTRST", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTREDLabel" runat="server" CssClass="controlLabel">午休結束時間:</cc1:WLabel>
</td>
<td colspan="1" class="dataDisplayCell">
<asp:Label ID="lbBTME_BTRED" runat="server" Text='<%# Bind("BTRED", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<InsertItemTemplate>
<cc1:WButton ID="WButton1" runat="server"
AccessKey="S" CommandName="Insert"
CssClass="button" OnClientClick="return confirm(msgConfirmSave);"
Text="S.存檔" TextMessageId="S.+SAVE" />
<cc1:WButton ID="WButton2" runat="server"
AccessKey="C" CommandName="Cancel"
CssClass="button" OnClientClick="return confirm(msgConfirmCancel);"
Text="C.取消" TextMessageId="C.+CANCEL" />
<table border="0" cellpadding="3" cellspacing="3" width="1" style="table-layout: fixed">
<tr>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTTIDLabel" runat="server" CssClass="controlLabel">班表編號:</cc1:WLabel>
</td>
<td colspan="1">
<asp:Label ID="lbBTME_BTTID" runat="server" Text="(自動編號)" CssClass="textInput"></asp:Label>
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTNMELabel" runat="server" CssClass="controlLabel">班表名稱:</cc1:WLabel>
</td>
<td colspan="3">
<asp:TextBox ID="txtBTME_BTNME" runat="server" Text='<%# Bind("BTNME", "{0}") %>' CssClass="textInput"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTSTMLabel" runat="server" CssClass="controlLabel">上班時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTSTM" runat="server" Time='<%# Bind("BTSTM", "{0}") %>' />
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTETMLabel" runat="server" CssClass="controlLabel">下班時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTETM" runat="server" Time='<%# Bind("BTETM", "{0}") %>' />
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTRSTLabel" runat="server" CssClass="controlLabel">午休開始時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTRST" runat="server" Time='<%# Bind("BTRST", "{0}") %>' />
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTREDLabel" runat="server" CssClass="controlLabel">午休結束時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTRED" runat="server" Time='<%# Bind("BTRED", "{0}") %>' />
</td>
</tr>
</table>
</InsertItemTemplate>
<EditItemTemplate>
<cc1:WButton ID="WButton1" runat="server"
AccessKey="S" CommandName="Update"
CssClass="button" OnClientClick="return confirm(msgConfirmSave);"
Text="S.存檔" TextMessageId="S.+SAVE" />
<cc1:WButton ID="WButton2" runat="server"
AccessKey="C" CommandName="Cancel"
CssClass="button" OnClientClick="return confirm(msgConfirmCancel);"
Text="C.取消" TextMessageId="C.+CANCEL" />
<table border="0" cellpadding="3" cellspacing="3" width="1" style="table-layout: fixed">
<tr>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
<td height="0" colspan="1" width="120"></td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTTIDLabel" runat="server" CssClass="controlLabel">班表編號:</cc1:WLabel>
</td>
<td colspan="1">
<asp:Label ID="lbBTME_BTTID" runat="server" Text='<%# Bind("BTTID", "{0}") %>' CssClass="textInput"></asp:Label>
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTNMELabel" runat="server" CssClass="controlLabel">班表名稱:</cc1:WLabel>
</td>
<td colspan="3">
<asp:TextBox ID="txtBTME_BTNME" runat="server" Text='<%# Bind("BTNME", "{0}") %>' CssClass="textInput"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTSTMLabel" runat="server" CssClass="controlLabel">上班時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTSTM" runat="server" Time='<%# Bind("BTSTM", "{0}") %>' />
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTETMLabel" runat="server" CssClass="controlLabel">下班時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTETM" runat="server" Time='<%# Bind("BTETM", "{0}") %>' />
</td>
</tr>
<tr>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTRSTLabel" runat="server" CssClass="controlLabel">午休開始時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTRST" runat="server" Time='<%# Bind("BTRST", "{0}") %>' />
</td>
<td colspan="1" align="right">
<cc1:WLabel ID="lbBTME_BTREDLabel" runat="server" CssClass="controlLabel">午休結束時間:</cc1:WLabel>
</td>
<td colspan="1">
<uc1:TimeInput ID="timeBTME_BTRED" runat="server" Time='<%# Bind("BTRED", "{0}") %>' />
</td>
</tr>
</table>
</EditItemTemplate>
</asp:FormView>
<asp:GridView runat="server" ID="gvBTME"
DataSourceID="dsBTMEGrid"
EnableModelValidation="True"
AutoGenerateColumns="false"
AllowPaging="True"
DataKeyNames="BTTID">
<Columns>
<asp:TemplateField HeaderText="班表編號" SortExpression="BTTID">
<ItemTemplate>
<asp:LinkButton runat="server" Text="" CommandName="Select" CausesValidation="False" ID="LinkButton1"></asp:LinkButton>
<asp:Label runat="server" Text='<%# Bind("BTTID") %>' ID="Label1"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="BTNME" HeaderText="班表名稱" SortExpression="BTNME"></asp:BoundField>
<asp:BoundField DataField="BTSTM" HeaderText="上班時間" SortExpression="BTSTM">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="BTETM" HeaderText="下班時間" SortExpression="BTETM">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="BTRST" HeaderText="午休開始" SortExpression="BTRST">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="BTRED" HeaderText="午休結束" SortExpression="BTRED">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
<PagerTemplate>
<cc1:WGridViewPager runat="server" ID="Pager1" />
</PagerTemplate>
</asp:GridView>
<br />
<%= string.Format("提示:預設班表不需要設定<ul><li>上班時間:{0}</li><li>下班時間:{1}</li><li>午休開始:{2}</li><li>午休結束:{3}</li></ul>",
Wellan.Common.WGuard1.WSetR("UNRPARTIME", 1),
Wellan.Common.WGuard1.WSetR("UNRPARTIME", 2),
Wellan.Common.WGuard1.WSetR("UNRPARTIME", 3),
Wellan.Common.WGuard1.WSetR("UNRPARTIME", 4)) %>
+83
View File
@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wellan.Data;
public partial class forms_basedata_fmBTME : Wellan.Web.UI.WUserControlBase
{
protected void Page_Load(object sender, EventArgs e)
{
//if (IsPostBack)
// gvBTME.DataBind();
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Form_View = fvBTME;
Grid_View = gvBTME;
CustomMessage = cvMessage;
}
protected override bool CheckInput(IOrderedDictionary values)
{
var BTNME = WDAC.GetStringValue(values["BTNME"]).Trim();
var BTSTM = WDAC.GetStringValue(values["BTSTM"]).Trim();
var BTETM = WDAC.GetStringValue(values["BTETM"]).Trim();
var BTRST = WDAC.GetStringValue(values["BTRST"]).Trim();
var BTRED = WDAC.GetStringValue(values["BTRED"]).Trim();
bool result = true;
CustomMessage.ErrorMessage = string.Empty;
CustomMessage.IsValid = true;
if (string.IsNullOrEmpty(BTNME))
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "班表名稱必須輸入<br/>";
}
if (string.IsNullOrEmpty(BTSTM))
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "上班時間必須輸入<br/>";
}
if (string.IsNullOrEmpty(BTETM))
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "下班時間必須輸入<br/>";
}
if (!string.IsNullOrEmpty(BTSTM) && !string.IsNullOrEmpty(BTETM) && BTSTM.CompareTo(BTETM) >= 0)
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "上班時間必須早於下班時間<br/>";
}
if (string.IsNullOrEmpty(BTRST) ^ string.IsNullOrEmpty(BTRED))
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "午休開始時間與午休結束時間必須同時輸入或同時不輸入<br/>";
}
if (!string.IsNullOrEmpty(BTRST) && !string.IsNullOrEmpty(BTRED) && BTRST.CompareTo(BTRED) >= 0)
{
result = false;
CustomMessage.IsValid = false;
CustomMessage.ErrorMessage += "午休開始時間必須早於午休結束時間<br/>";
}
ProcessCustomValidatorMessage(CustomMessage);
return result;
}
}
+63
View File
@@ -0,0 +1,63 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fmBhrd.ascx.cs" Inherits="forms_basedata_fmBhrd" %>
<%@ Register Assembly="WNET" Namespace="Wellan.Web.UI"
TagPrefix="cc1" %>
<cc1:WLabel ID="WLabel1" runat="server" CssClass="pageTitle"
TextMessageId="">行事曆設定</cc1:WLabel>
<asp:CustomValidator ID="cvMessage" runat="server"
Display="None"></asp:CustomValidator><br />
<div style="width: 650px">
<table cellpadding="3" cellspacing="0" style="border:0; width:100%; background-color:#E0E0E0 ">
<tr style="height: 40px">
<td style="width: 45px">
<asp:TextBox ID="txtYear" runat="server"
CssClass="textInput" MaxLength="4"></asp:TextBox></td>
<td style="text-align:center; width: 20px">
<asp:Label ID="Label3" runat="server" Font-Bold="True"
Text="年"></asp:Label></td>
<td style="width: 70px">
<asp:DropDownList ID="ddlMonth" runat="server" CssClass="textInput">
<asp:ListItem Value="01">一月</asp:ListItem>
<asp:ListItem Value="02">二月</asp:ListItem>
<asp:ListItem Value="03">三月</asp:ListItem>
<asp:ListItem Value="04">四月</asp:ListItem>
<asp:ListItem Value="05">五月</asp:ListItem>
<asp:ListItem Value="06">六月</asp:ListItem>
<asp:ListItem Value="07">七月</asp:ListItem>
<asp:ListItem Value="08">八月</asp:ListItem>
<asp:ListItem Value="09">九月</asp:ListItem>
<asp:ListItem Value="10">十月</asp:ListItem>
<asp:ListItem Value="11">十一月</asp:ListItem>
<asp:ListItem Value="12">十二月</asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 90px">
<asp:Button ID="btnGoto" runat="server" AccessKey="G"
CssClass="button" Text="G.跳至" OnClick="btnGoto_Click" /></td>
<td style="text-align:right">
<asp:Button ID="btnSave" runat="server" AccessKey="S"
CssClass="button" Text="S.儲存" OnClick="btnSave_Click" />
</td>
</tr>
</table>
<asp:Calendar ID="Calendar1" runat="server"
BorderStyle="None" CellSpacing="3" CellPadding="0"
NextPrevFormat="ShortMonth" SelectionMode="None"
EnableViewState="False" Width="100%" DayNameFormat="Shortest" TitleFormat="MonthYear"
OnDayRender="Calendar1_DayRender" OnPreRender="Calendar1_PreRender"
OnVisibleMonthChanged="Calendar1_VisibleMonthChanged">
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />
<DayStyle BackColor="#FFFFFF" Font-Bold="False"
Height="64px" VerticalAlign="Top" Font-Size="16pt" />
<NextPrevStyle Font-Bold="True" Font-Size="8pt"
ForeColor="Blue" />
<DayHeaderStyle BackColor="#E0E0E0" Font-Bold="True"
Font-Size="8pt" ForeColor="Black" Height="32px" />
<TitleStyle BackColor="#B5C7DE" Font-Bold="True"
Font-Size="12pt" ForeColor="Black" Height="40px" />
</asp:Calendar>
</div>
<asp:HiddenField ID="hfYear" runat="server" />
<asp:HiddenField ID="hfMonth" runat="server" />
+155
View File
@@ -0,0 +1,155 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
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 System.Text;
using Wellan.Common;
public partial class forms_basedata_fmBhrd : Wellan.Web.UI.WUserControlBase
{
private string[] holidayData = null;
protected void Page_Load(object sender, EventArgs e)
{
if (txtYear.Text == "")
{
txtYear.Text = DateTime.UtcNow.AddHours(8).ToString("yyyy");
ddlMonth.SelectedValue = DateTime.UtcNow.AddHours(8).ToString("MM");
Calendar1.VisibleDate = DateTime.UtcNow.AddHours(8).Date;
StoreYYMM();
}
}
private void StoreYYMM()
{
hfYear.Value = Calendar1.VisibleDate.ToString("yyyy", WGuard1.InvariantCulture);
hfMonth.Value = Calendar1.VisibleDate.ToString("MM");
}
protected void Calendar1_PreRender(object sender, EventArgs e)
{
// 取得節假日資料
holidayData = new BhrdDAC().GetYear(Calendar1.VisibleDate.Year);
}
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
e.Cell.Style["padding"] = "3px";
e.Cell.Style["border"] = "2px solid white";
// 非本月,結束處理
if (e.Day.IsOtherMonth)
return;
// 本月,清除重畫
e.Cell.Controls.Clear();
Label aLabel = new Label();
aLabel.Text = e.Day.Date.Day.ToString();
aLabel.Font.Name = "Tahoma";
aLabel.Font.Size = new FontUnit("16pt");
aLabel.Font.Bold = true;
aLabel.ForeColor = System.Drawing.Color.Black;
e.Cell.Controls.Add(aLabel);
// 加入換行的 Literal
Literal aBR = new Literal();
aBR.Text = "<br/>";
e.Cell.Controls.Add(aBR);
//加入 DropDownList 用以挑選假日型態
DropDownList aDDL = new DropDownList();
aDDL.ID = String.Format("HolidayType{0:00}", e.Day.Date.Day);
aDDL.Style.Add("width", "95%");
// aDDL.Style.Add("position", "relative");
aDDL.Style.Add("top", "2px");
aDDL.Style.Add("font-size", "9pt");
aDDL.Items.Add(new ListItem("上班", "-"));
aDDL.Items.Add(new ListItem("補班", "B"));
aDDL.Items.Add(new ListItem("國定/民俗", "N"));
aDDL.Items.Add(new ListItem("例假日", "H"));
aDDL.Items.Add(new ListItem("彈性休假", "V"));
aDDL.Items.Add(new ListItem("補假", "O"));
aDDL.Items.Add(new ListItem("颱風假", "T"));
aDDL.Items.Add(new ListItem("選舉假", "E"));
aDDL.Items.Add(new ListItem("公司活動", "A"));
//if (Request["HolidayType01"] == null || holidayData == null)
if (holidayData == null)
{
if (e.Day.IsWeekend)
aDDL.SelectedValue = "H";
else
aDDL.SelectedValue = "-";
}
else
{
aDDL.SelectedValue = holidayData[e.Day.Date.Month - 1].Substring(e.Day.Date.Day - 1, 1);
}
switch (aDDL.SelectedValue)
{
case "-":
e.Cell.BackColor = System.Drawing.Color.White;
break;
case "H":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0xFF99CC);
break;
case "B":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0xFFFF99);
break;
case "N":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0x0099FF);
break;
case "V":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0xFF9900);
break;
case "O":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0x99CC00);
break;
case "T":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0x999999);
break;
case "E":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0xCC7FFF);
break;
case "A":
e.Cell.BackColor = System.Drawing.Color.FromArgb(0x7FCCFF);
break;
}
e.Cell.Controls.Add(aDDL);
}
protected void btnSave_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= 31; i++)
{
sb.Append(Request[String.Format("HolidayType{0:00}", i)]);
}
BhrdDAC bhrd = new BhrdDAC();
bhrd.SetMonth(Convert.ToInt32(hfYear.Value), Convert.ToInt32(hfMonth.Value), sb.ToString());
Calendar1.VisibleDate = Convert.ToDateTime(hfYear.Value + "/" + hfMonth.Value + "/01", WGuard1.InvariantCulture);
}
protected void btnGoto_Click(object sender, EventArgs e)
{
Calendar1.VisibleDate = Convert.ToDateTime(txtYear.Text + "/" + ddlMonth.SelectedValue + "/01");
StoreYYMM();
}
protected void Calendar1_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
{
txtYear.Text = Calendar1.VisibleDate.ToString("yyyy");
ddlMonth.SelectedValue = Calendar1.VisibleDate.ToString("MM");
StoreYYMM();
}
}